dslm4515 / CMLFS

Clang-Built Musl Linux From Scratch
MIT License
106 stars 18 forks source link

Linking hell at /cgnutools' LLVM (1-Stage0/7-LLVM.stage0) #104

Open takusuman opened 3 weeks ago

takusuman commented 3 weeks ago

As I said in #91, I rewrote the manual for the CMLFS toolchain as Copacabana pkgbuild scripts (just plain shell scripts, nothing to worry about), and, since then, I started getting the same error at the 79%:

[ 79%] Linking CXX executable ../../bin/llvm-lto
Reading specs from /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/specs
COLLECT_GCC=/cgnutools/bin/x86_64-linux-musl-g++
COLLECT_LTO_WRAPPER=/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/lto-wrapper
Target: x86_64-linux-musl
Configured with: /dsk/0/usr/tmp/obj/mussel-main/sources/gcc/gcc-13.2.0/configure --with-sysroot=/ --with-build-sysroot=/dsk/0/usr/tmp/obj/mussel-main/toolchain --prefix= --exec-prefix= --sbindir=/bin --libexecdir=/lib --datarootdir=/_tmp --target=x86_64-linux-musl --with-pkgversion=mussel --enable-languages=c,c++ --enable-default-hash-style=sysv --enable-default-pie --enable-static-pie --enable-relro --enable-initfini-array --disable-bootstrap --disable-multilib --disable-libsanitizer --disable-linker-build-id --disable-rpath --disable-werror --with-arch=x86-64 --with-tune=generic
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.2.0 (mussel) 
COMPILER_PATH=/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/:/dsk/0/cgnutools/bin/../lib/gcc/:/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/
LIBRARY_PATH=/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/:/dsk/0/cgnutools/bin/../lib/gcc/:/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/:/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../lib/:/dsk/0/cgnutools/bin/../lib/../lib/:/dsk/0/cgnutools/bin/../usr/lib/../lib/:/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/:/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../:/dsk/0/cgnutools/bin/../lib/:/dsk/0/cgnutools/bin/../usr/lib/
COLLECT_GCC_OPTIONS='-fPIC' '-I' '/cgnutools/include' '-I' '/llvmtools/include' '-L/llvmtools/lib' '-v' '-fvisibility-inlines-hidden' '-Wall' '-Wextra' '-Wno-unused-parameter' '-Wwrite-strings' '-Wcast-qual' '-Wno-missing-field-initializers' '-Wpedantic' '-Wno-long-long' '-Wno-maybe-uninitialized' '-Wno-nonnull' '-Wno-class-memaccess' '-Wno-redundant-move' '-Wno-pessimizing-move' '-Wno-noexcept-type' '-Wdelete-non-virtual-dtor' '-Wsuggest-override' '-Wno-comment' '-Wno-misleading-indentation' '-O3' '-D' 'NDEBUG' '-o' '../../bin/llvm-lto' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' '../../bin/llvm-lto.'
 /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/collect2 -plugin /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/liblto_plugin.so -plugin-opt=/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccjicnCF.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/dsk/0/cgnutools/bin/../ --eh-frame-hdr -m elf_x86_64 -dynamic-linker /llvmtools/lib/ld-musl-x86_64.so.1 -pie -o ../../bin/llvm-lto /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/Scrt1.o /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/crti.o /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/crtbeginS.o -L/llvmtools/lib -L/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0 -L/dsk/0/cgnutools/bin/../lib/gcc -L/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib -L/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../lib -L/dsk/0/cgnutools/bin/../lib/../lib -L/dsk/0/cgnutools/bin/../usr/lib/../lib -L/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib -L/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../.. -L/dsk/0/cgnutools/bin/../lib -L/dsk/0/cgnutools/bin/../usr/lib -rpath=/cgnutools/lib --verbose -rpath-link /dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/./lib --gc-sections CMakeFiles/llvm-lto.dir/llvm-lto.cpp.o -rpath $ORIGIN/../lib:/dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/lib: ../../lib/libLLVM-17.so -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/crtendS.o /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/crtn.o
GNU ld (mussel) 2.42
  Supported emulations:
   elf_x86_64
   elf32_x86_64
   elf_i386
   elf_iamcu
using internal linker script:
==================================================
/* Script for -pie -z combreloc -z separate-code */
/* Copyright (C) 2014-2024 Free Software Foundation, Inc.
   Copying and distribution of this script, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.  */
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
              "elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
SEARCH_DIR("=/x86_64-linux-musl/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/x86_64-linux-musl/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
SECTIONS
{
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.gnu.build-id  : { *(.note.gnu.build-id) }
  .hash           : { *(.hash) }
  .gnu.hash       : { *(.gnu.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.ctors)
      *(.rela.dtors)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
      *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
      *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
      *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
      *(.rela.ifunc)
    }
  .rela.plt       :
    {
      *(.rela.plt)
      *(.rela.iplt)
    }
  .relr.dyn : { *(.relr.dyn) }
  . = ALIGN(CONSTANT (MAXPAGESIZE));
  .init           :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt            : { *(.plt) *(.iplt) }
.plt.got        : { *(.plt.got) }
.plt.sec        : { *(.plt.sec) }
  .text           :
  {
    *(.text.unlikely .text.*_unlikely .text.unlikely.*)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(SORT(.text.sorted.*))
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf.em.  */
    *(.gnu.warning)
  }
  .fini           :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  . = ALIGN(CONSTANT (MAXPAGESIZE));
  /* Adjust the address for the rodata segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  . = SEGMENT_START("rodata-segment", ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)));
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1        : { *(.rodata1) }
  .eh_frame_hdr   : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  .sframe         : ONLY_IF_RO { *(.sframe) *(.sframe.*) }
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  .gnu_extab   : ONLY_IF_RO { *(.gnu_extab*) }
  /* These sections are generated by the Sun/Oracle C++ compiler.  */
  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges*) }
  /* Adjust the address for the data segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling  */
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  .sframe         : ONLY_IF_RW { *(.sframe) *(.sframe.*) }
  .gnu_extab      : ONLY_IF_RW { *(.gnu_extab) }
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges*) }
  /* Thread Local Storage sections  */
  .tdata          :
   {
     PROVIDE_HIDDEN (__tdata_start = .);
     *(.tdata .tdata.* .gnu.linkonce.td.*)
   }
  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array    :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array    :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array    :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors          :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic        : { *(.dynamic) }
  .got            : { *(.got) *(.igot) }
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 24 ? 24 : 0, .);
  .got.plt        : { *(.got.plt) *(.igot.plt) }
  .data           :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = ALIGN(ALIGNOF(NEXT_SECTION));
  __bss_start = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we do not
      pad the .data section.  */
   . = ALIGN(. != 0 ? 64 / 8 : 1);
  }
  .lbss   :
  {
    *(.dynlbss)
    *(.lbss .lbss.* .gnu.linkonce.lb.*)
    *(LARGE_COMMON)
  }
  . = ALIGN(64 / 8);
  . = SEGMENT_START("ldata-segment", .);
  .lrodata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
  {
    *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
  }
  .ldata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
  {
    *(.ldata .ldata.* .gnu.linkonce.l.*)
    . = ALIGN(. != 0 ? 64 / 8 : 1);
  }
  . = ALIGN(64 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections.  */
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }
  .stab.excl     0 : { *(.stab.excl) }
  .stab.exclstr  0 : { *(.stab.exclstr) }
  .stab.index    0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment 0 (INFO) : { *(.comment); LINKER_VERSION; }
  .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1.  */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions.  */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2.  */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2.  */
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions.  */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* DWARF 3.  */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  /* DWARF 5.  */
  .debug_addr     0 : { *(.debug_addr) }
  .debug_line_str 0 : { *(.debug_line_str) }
  .debug_loclists 0 : { *(.debug_loclists) }
  .debug_macro    0 : { *(.debug_macro) }
  .debug_names    0 : { *(.debug_names) }
  .debug_rnglists 0 : { *(.debug_rnglists) }
  .debug_str_offsets 0 : { *(.debug_str_offsets) }
  .debug_sup      0 : { *(.debug_sup) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}

==================================================
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/ld: mode elf_x86_64
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/Scrt1.o succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/Scrt1.o
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/crti.o succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/crti.o
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/crtbeginS.o succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/crtbeginS.o
attempt to open CMakeFiles/llvm-lto.dir/llvm-lto.cpp.o succeeded
CMakeFiles/llvm-lto.dir/llvm-lto.cpp.o
attempt to open ../../lib/libLLVM-17.so succeeded
../../lib/libLLVM-17.so
attempt to open /llvmtools/lib/libstdc++.so failed
attempt to open /llvmtools/lib/libstdc++.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libstdc++.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libstdc++.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/libstdc++.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/libstdc++.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libstdc++.so succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libstdc++.so
attempt to open /llvmtools/lib/libm.so failed
attempt to open /llvmtools/lib/libm.a succeeded
/llvmtools/lib/libm.a
attempt to open /llvmtools/lib/libgcc_s.so failed
attempt to open /llvmtools/lib/libgcc_s.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc_s.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc_s.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/libgcc_s.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/libgcc_s.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so succeeded
opened script file /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so
opened script file /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so.1 succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so.1
attempt to open /llvmtools/lib/libgcc.so failed
attempt to open /llvmtools/lib/libgcc.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.a succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.a
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.a
attempt to open /llvmtools/lib/libgcc.so failed
attempt to open /llvmtools/lib/libgcc.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.a succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.a
attempt to open /llvmtools/lib/libc.so succeeded
/llvmtools/lib/libc.so
attempt to open /llvmtools/lib/libgcc_s.so failed
attempt to open /llvmtools/lib/libgcc_s.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc_s.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc_s.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/libgcc_s.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/libgcc_s.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so succeeded
opened script file /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so
opened script file /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so.1 succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/libgcc_s.so.1
attempt to open /llvmtools/lib/libgcc.so failed
attempt to open /llvmtools/lib/libgcc.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.a succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.a
attempt to open /llvmtools/lib/libgcc.so failed
attempt to open /llvmtools/lib/libgcc.a failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.so failed
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.a succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/libgcc.a
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/crtendS.o succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/crtendS.o
attempt to open /dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/crtn.o succeeded
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/lib/../lib/crtn.o
libz.so.1 needed by ../../lib/libLLVM-17.so
attempt to open /dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/./lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//cgnutools/lib/libz.so.1 failed
attempt to open /dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/tools/llvm-lto/../../lib/../lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/lib/libz.so.1 failed
attempt to open libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//cgnutools/lib/libz.so.1 failed
attempt to open /dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/tools/llvm-lto/../../lib/../lib/libz.so.1 failed
attempt to open libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//x86_64-linux-musl/lib64/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//usr/local/lib64/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//lib64/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//usr/lib64/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//x86_64-linux-musl/lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//usr/local/lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//usr/lib/libz.so.1 failed
attempt to open /dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/./lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//cgnutools/lib/libz.so.1 failed
attempt to open /dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/tools/llvm-lto/../../lib/../lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/lib/libz.so.1 failed
attempt to open libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//cgnutools/lib/libz.so.1 failed
attempt to open /dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build/tools/llvm-lto/../../lib/../lib/libz.so.1 failed
attempt to open libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//x86_64-linux-musl/lib64/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//usr/local/lib64/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//lib64/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//usr/lib64/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//x86_64-linux-musl/lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//usr/local/lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//lib/libz.so.1 failed
attempt to open /dsk/0/cgnutools/bin/..//usr/lib/libz.so.1 failed
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/ld: warning: libz.so.1, needed by ../../lib/libLLVM-17.so, not found (try using -rpath or -rpath-link)
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/ld: ../../lib/libLLVM-17.so: undefined reference to `compress2'
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/ld: ../../lib/libLLVM-17.so: undefined reference to `crc32'
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/ld: ../../lib/libLLVM-17.so: undefined reference to `compressBound@ZLIB_1.2.0'
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/ld: ../../lib/libLLVM-17.so: undefined reference to `uncompress'
/dsk/0/cgnutools/bin/../lib/gcc/x86_64-linux-musl/13.2.0/../../../../x86_64-linux-musl/bin/ld: link errors found, deleting executable `../../bin/llvm-lto'
collect2: error: ld returned 1 exit status
gmake[2]: *** [tools/llvm-lto/CMakeFiles/llvm-lto.dir/build.make:98: bin/llvm-lto] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:21896: tools/llvm-lto/CMakeFiles/llvm-lto.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2
gmake: Leaving directory '/dsk/0/usr/tmp/obj/llvm-project-17.0.1.src/build'
[lebleue@tempestade copacabana]$ ls -l /cgnutools/lib
total 38456
-rw-r--r--   1 lebleue  lebleue     1616 Oct 26 20:28 Scrt1.o
drwxr-xr-x   2 lebleue  lebleue     4096 Oct 26 19:50 bfd-plugins
-rw-r--r--   1 lebleue  lebleue     1616 Oct 26 20:28 crt1.o
-rw-r--r--   1 lebleue  lebleue     1000 Oct 26 20:28 crti.o
-rw-r--r--   1 lebleue  lebleue      776 Oct 26 20:28 crtn.o
drwxr-xr-x   3 lebleue  lebleue     4096 Oct 26 20:26 gcc
-rwxr-xr-x   1 lebleue  lebleue   786296 Oct 26 20:28 ld-musl-x86_64.so.1
drwxr-xr-x   2 lebleue  lebleue     4096 Oct 26 19:50 ldscripts
-rw-r--r--   1 lebleue  lebleue  1985406 Oct 26 19:50 libbfd.a
-rwxr-xr-x   1 lebleue  lebleue      935 Oct 26 19:50 libbfd.la
-rw-r--r--   1 lebleue  lebleue  2700074 Oct 26 20:28 libc.a
-rwxr-xr-x   1 lebleue  lebleue   786296 Oct 26 20:28 libc.so
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:28 libcrypt.a
-rw-r--r--   1 lebleue  lebleue   315240 Oct 26 19:50 libctf-nobfd.a
-rwxr-xr-x   1 lebleue  lebleue     1037 Oct 26 19:50 libctf-nobfd.la
-rw-r--r--   1 lebleue  lebleue   325124 Oct 26 19:50 libctf.a
-rwxr-xr-x   1 lebleue  lebleue     1036 Oct 26 19:50 libctf.la
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:28 libdl.a
-rw-r--r--   1 lebleue  lebleue      132 Oct 26 20:28 libgcc_s.so
-rw-r--r--   1 lebleue  lebleue   656400 Oct 26 20:28 libgcc_s.so.1
-rw-r--r--   1 lebleue  lebleue   537640 Oct 26 20:32 libgomp.a
-rwxr-xr-x   1 lebleue  lebleue      938 Oct 26 20:32 libgomp.la
lrwxrwxrwx   1 lebleue  lebleue       16 Oct 29 11:44 libgomp.so -> libgomp.so.1.0.0
lrwxrwxrwx   1 lebleue  lebleue       16 Oct 29 11:44 libgomp.so.1 -> libgomp.so.1.0.0
-rwxr-xr-x   1 lebleue  lebleue   302424 Oct 26 20:32 libgomp.so.1.0.0
-rw-r--r--   1 lebleue  lebleue      164 Oct 26 20:32 libgomp.spec
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:28 libm.a
-rw-r--r--   1 lebleue  lebleue   954568 Oct 26 19:50 libopcodes.a
-rwxr-xr-x   1 lebleue  lebleue      883 Oct 26 19:50 libopcodes.la
-rw-r--r--   1 lebleue  lebleue   124916 Oct 26 20:32 libpkgconf.a
-rwxr-xr-x   1 lebleue  lebleue      967 Oct 26 20:32 libpkgconf.la
lrwxrwxrwx   1 lebleue  lebleue       19 Oct 29 11:44 libpkgconf.so -> libpkgconf.so.4.0.0
lrwxrwxrwx   1 lebleue  lebleue       19 Oct 29 11:44 libpkgconf.so.4 -> libpkgconf.so.4.0.0
-rwxr-xr-x   1 lebleue  lebleue    78040 Oct 26 20:32 libpkgconf.so.4.0.0
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:28 libpthread.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:28 libresolv.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:28 librt.a
-rw-r--r--   1 lebleue  lebleue  6395662 Oct 26 20:31 libstdc++.a
-rwxr-xr-x   1 lebleue  lebleue      953 Oct 26 20:31 libstdc++.la
lrwxrwxrwx   1 lebleue  lebleue       19 Oct 29 11:44 libstdc++.so -> libstdc++.so.6.0.32
lrwxrwxrwx   1 lebleue  lebleue       19 Oct 29 11:44 libstdc++.so.6 -> libstdc++.so.6.0.32
-rwxr-xr-x   1 lebleue  lebleue  2378488 Oct 26 20:31 libstdc++.so.6.0.32
-rw-r--r--   1 lebleue  lebleue     2375 Oct 26 20:31 libstdc++.so.6.0.32-gdb.py
-rw-r--r--   1 lebleue  lebleue     5382 Oct 26 20:31 libstdc++exp.a
-rwxr-xr-x   1 lebleue  lebleue      896 Oct 26 20:31 libstdc++exp.la
-rw-r--r--   1 lebleue  lebleue   719926 Oct 26 20:31 libstdc++fs.a
-rwxr-xr-x   1 lebleue  lebleue      893 Oct 26 20:31 libstdc++fs.la
-rw-r--r--   1 lebleue  lebleue   382994 Oct 26 20:31 libsupc++.a
-rwxr-xr-x   1 lebleue  lebleue      887 Oct 26 20:31 libsupc++.la
lrwxrwxrwx   1 lebleue  lebleue       14 Oct 29 11:44 libunwind.so -> libunwind.so.1
lrwxrwxrwx   1 lebleue  lebleue       16 Oct 29 11:44 libunwind.so.1 -> libunwind.so.1.0
-rwxr-xr-x   1 lebleue  lebleue    96256 Oct 26 20:41 libunwind.so.1.0
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:28 libutil.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:28 libxnet.a
drwxr-xr-x   2 lebleue  lebleue     4096 Oct 26 20:32 pkgconfig
-rw-r--r--   1 lebleue  lebleue     2312 Oct 26 20:28 rcrt1.o
[lebleue@tempestade copacabana]$ ls -l /llvmtools/lib
total 7648
-rw-r--r--   1 lebleue  lebleue     1616 Oct 26 20:39 Scrt1.o
-rw-r--r--   1 lebleue  lebleue     1616 Oct 26 20:39 crt1.o
-rw-r--r--   1 lebleue  lebleue     1000 Oct 26 20:39 crti.o
-rw-r--r--   1 lebleue  lebleue      776 Oct 26 20:39 crtn.o
lrwxrwxrwx   1 lebleue  lebleue        7 Oct 29 11:44 ld-musl-x86_64.so.1 -> libc.so
-rwxr-xr-x   1 lebleue  lebleue    18170 Oct 26 21:01 libatomic.a
lrwxrwxrwx   1 lebleue  lebleue       19 Oct 29 11:44 libatomic.so -> libatomic.so.1.69.0
lrwxrwxrwx   1 lebleue  lebleue       19 Oct 29 11:44 libatomic.so.1 -> libatomic.so.1.69.0
-rwxr-xr-x   1 lebleue  lebleue    27952 Oct 26 21:01 libatomic.so.1.69.0
-rw-r--r--   1 lebleue  lebleue  2634078 Oct 26 20:39 libc.a
-rwxr-xr-x   1 lebleue  lebleue   750720 Oct 26 20:39 libc.so
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:39 libcrypt.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:39 libdl.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:39 libm.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:39 libpthread.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:39 libresolv.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:39 librt.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:39 libutil.a
-rw-r--r--   1 lebleue  lebleue        8 Oct 26 20:39 libxnet.a
-rw-r--r--   1 lebleue  lebleue   245790 Oct 26 21:00 libz.a
lrwxrwxrwx   1 lebleue  lebleue       21 Oct 29 11:44 libz.so -> libz.so.1.3.1.zlib-ng
lrwxrwxrwx   1 lebleue  lebleue       21 Oct 29 11:44 libz.so.1 -> libz.so.1.3.1.zlib-ng
-rwxr-xr-x   1 lebleue  lebleue   165792 Oct 26 21:00 libz.so.1.3.1.zlib-ng
lrwxrwxrwx   1 lebleue  lebleue       21 Oct 29 11:44 libz.so.1.3.11 -> libz.so.1.3.1.zlib-ng
drwxr-xr-x   2 lebleue  lebleue     4096 Oct 26 21:00 pkgconfig
-rw-r--r--   1 lebleue  lebleue     2160 Oct 26 20:39 rcrt1.o

Before you ask: yes, I tried using -Wl,-rpath=/llvmtools/lib along with the already mentioned -Wl,-rpath=/cgnutools/lib, tried to use -L/llvmtools/lib, used -DCMAKE_C_FLAGS and -DCMAKE_CXX_FLAGS instead of export CFLAGS CXXFLAGS, even broke some rules and took CLLVM+="-DZLIB_INCLUDE_DIR=/llvmtools/include " and CLLVM+="-DZLIB_LIBRARY_RELEASE=/llvmtools/lib/libz.so " from the second stage. Zero success. Nothing. Zilch. This last build was made per using -Wl,--verbose along with -v, so I could get a more complete log (I would also recommend doing this for new maintainers both at CMLFS and Copacabana --- or glaucus, or Andes, or any other new Linux distribution part of this new movement) and, as per what I understood, it seems like ld just plain ignores the /llvmtools path after not encountering libm, libgcc_s nor libstdc++. I would like to know how much of this is my fault and if this is just a error from LLVM 17.0.1 on this specific setup.

dslm4515 commented 3 weeks ago

Looks like cgnutools is missing zlib. A possible workaround would possibly copy/link zlib library from llvmtools?

takusuman commented 3 weeks ago

Looks like cgnutools is missing zlib. A possible workaround would possibly copy/link zlib library from llvmtools?

Well, that what I was going to mention: there's no mention of compiling (nor sym'linking) zlib to cgnutools in the first place at the zlib-ng recipe file.

https://github.com/dslm4515/CMLFS/blob/5c47590274286c425066171d1b3e95a8960c353a/1-Stage0/4-zlib-ng#L1-L14

Didn't this happen before on your builds?