Created attachment 764309 [details] build.log [...] [159/167] : && /usr/bin/powerpc-gentoo-linux-musl-g++ -fPIC -O2 -mcpu=7450 -mtune=7450 -pipe -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wl,-O1 -Wl,--as-needed -Wl,-z,stack-size=2097152 -Wl,-z,defs -Wl,-z,nodelete -Wl,-rpath-link,/var/tmp/portage/sys-devel/lld-13.0.1/work/lld-13.0.1_build/./lib -Wl,-O3 -Wl,--gc-sections -shared -Wl,-soname,liblldCOFF.so.13 -o lib/liblldCOFF.so.13 COFF/CMakeFiles/lldCOFF.dir/CallGraphSort.cpp.o COFF/CMakeFiles/lldCOFF.dir/Chunks.cpp.o COFF/CMakeFiles/lldCOFF.dir/DebugTypes.cpp.o COFF/CMakeFiles/lldCOFF.dir/DLL.cpp.o COFF/CMakeFiles/lldCOFF.dir/Driver.cpp.o COFF/CMakeFiles/lldCOFF.dir/DriverUtils.cpp.o COFF/CMakeFiles/lldCOFF.dir/ICF.cpp.o COFF/CMakeFiles/lldCOFF.dir/InputFiles.cpp.o COFF/CMakeFiles/lldCOFF.dir/LLDMapFile.cpp.o COFF/CMakeFiles/lldCOFF.dir/LTO.cpp.o COFF/CMakeFiles/lldCOFF.dir/MapFile.cpp.o COFF/CMakeFiles/lldCOFF.dir/MarkLive.cpp.o COFF/CMakeFiles/lldCOFF.dir/MinGW.cpp.o COFF/CMakeFiles/lldCOFF.dir/PDB.cpp.o COFF/CMakeFiles/lldCOFF.dir/SymbolTable.cpp.o COFF/CMakeFiles/lldCOFF.dir/Symbols.cpp.o COFF/CMakeFiles/lldCOFF.dir/Writer.cpp.o -L/usr/lib/llvm/13/lib -Wl,-rpath,"\$ORIGIN/../lib:/usr/lib/llvm/13/lib" lib/liblldCommon.so.13 /usr/lib/llvm/13/lib/libLLVM-13.so && : FAILED: lib/liblldCOFF.so.13 : && /usr/bin/powerpc-gentoo-linux-musl-g++ -fPIC -O2 -mcpu=7450 -mtune=7450 -pipe -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wl,-O1 -Wl,--as-needed -Wl,-z,stack-size=2097152 -Wl,-z,defs -Wl,-z,nodelete -Wl,-rpath-link,/var/tmp/portage/sys-devel/lld-13.0.1/work/lld-13.0.1_build/./lib -Wl,-O3 -Wl,--gc-sections -shared -Wl,-soname,liblldCOFF.so.13 -o lib/liblldCOFF.so.13 COFF/CMakeFiles/lldCOFF.dir/CallGraphSort.cpp.o COFF/CMakeFiles/lldCOFF.dir/Chunks.cpp.o COFF/CMakeFiles/lldCOFF.dir/DebugTypes.cpp.o COFF/CMakeFiles/lldCOFF.dir/DLL.cpp.o COFF/CMakeFiles/lldCOFF.dir/Driver.cpp.o COFF/CMakeFiles/lldCOFF.dir/DriverUtils.cpp.o COFF/CMakeFiles/lldCOFF.dir/ICF.cpp.o COFF/CMakeFiles/lldCOFF.dir/InputFiles.cpp.o COFF/CMakeFiles/lldCOFF.dir/LLDMapFile.cpp.o COFF/CMakeFiles/lldCOFF.dir/LTO.cpp.o COFF/CMakeFiles/lldCOFF.dir/MapFile.cpp.o COFF/CMakeFiles/lldCOFF.dir/MarkLive.cpp.o COFF/CMakeFiles/lldCOFF.dir/MinGW.cpp.o COFF/CMakeFiles/lldCOFF.dir/PDB.cpp.o COFF/CMakeFiles/lldCOFF.dir/SymbolTable.cpp.o COFF/CMakeFiles/lldCOFF.dir/Symbols.cpp.o COFF/CMakeFiles/lldCOFF.dir/Writer.cpp.o -L/usr/lib/llvm/13/lib -Wl,-rpath,"\$ORIGIN/../lib:/usr/lib/llvm/13/lib" lib/liblldCommon.so.13 /usr/lib/llvm/13/lib/libLLVM-13.so && : /usr/lib/gcc/powerpc-gentoo-linux-musl/11.2.0/../../../../powerpc-gentoo-linux-musl/bin/ld: COFF/CMakeFiles/lldCOFF.dir/DebugTypes.cpp.o: in function `lld::coff::TypeMerger::mergeTypesWithGHash()::{lambda(unsigned int)#3}::operator()(unsigned int) const': DebugTypes.cpp:(.text._ZZN3lld4coff10TypeMerger19mergeTypesWithGHashEvENKUljE1_clEj+0x1b0): undefined reference to `__atomic_load_8' /usr/lib/gcc/powerpc-gentoo-linux-musl/11.2.0/../../../../powerpc-gentoo-linux-musl/bin/ld: DebugTypes.cpp:(.text._ZZN3lld4coff10TypeMerger19mergeTypesWithGHashEvENKUljE1_clEj+0x1e4): undefined reference to `__atomic_compare_exchange_8' /usr/lib/gcc/powerpc-gentoo-linux-musl/11.2.0/../../../../powerpc-gentoo-linux-musl/bin/ld: DebugTypes.cpp:(.text._ZZN3lld4coff10TypeMerger19mergeTypesWithGHashEvENKUljE1_clEj+0x2c4): undefined reference to `__atomic_compare_exchange_8' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. * ERROR: sys-devel/lld-13.0.1::gentoo failed (compile phase):
Created attachment 764310 [details] emerge --info
Created attachment 765201 [details] build.log (ppc, 13.0.1, glibc) Turns out this build failure is not musl specific but happens in glibc builds too. [...] FAILED: lib/liblldCOFF.so.13 : && /usr/bin/powerpc-unknown-linux-gnu-g++ -fPIC -O2 -mcpu=7450 -pipe -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,-z,defs -Wl,-z,nodelete -Wl,-rpath-link,/var/tmp/portage/sys-devel/lld-13.0.1/work/lld-13.0.1_build/./lib -Wl,-O3 -Wl,--gc-sections -shared -Wl,-soname,liblldCOFF.so.13 -o lib/liblldCOFF.so.13 COFF/CMakeFiles/lldCOFF.dir/CallGraphSort.cpp.o COFF/CMakeFiles/lldCOFF.dir/Chunks.cpp.o COFF/CMakeFiles/lldCOFF.dir/DebugTypes.cpp.o COFF/CMakeFiles/lldCOFF.dir/DLL.cpp.o COFF/CMakeFiles/lldCOFF.dir/Driver.cpp.o COFF/CMakeFiles/lldCOFF.dir/DriverUtils.cpp.o COFF/CMakeFiles/lldCOFF.dir/ICF.cpp.o COFF/CMakeFiles/lldCOFF.dir/InputFiles.cpp.o COFF/CMakeFiles/lldCOFF.dir/LLDMapFile.cpp.o COFF/CMakeFiles/lldCOFF.dir/LTO.cpp.o COFF/CMakeFiles/lldCOFF.dir/MapFile.cpp.o COFF/CMakeFiles/lldCOFF.dir/MarkLive.cpp.o COFF/CMakeFiles/lldCOFF.dir/MinGW.cpp.o COFF/CMakeFiles/lldCOFF.dir/PDB.cpp.o COFF/CMakeFiles/lldCOFF.dir/SymbolTable.cpp.o COFF/CMakeFiles/lldCOFF.dir/Symbols.cpp.o COFF/CMakeFiles/lldCOFF.dir/Writer.cpp.o -L/usr/lib/llvm/13/lib -Wl,-rpath,"\$ORIGIN/../lib:/usr/lib/llvm/13/lib" lib/liblldCommon.so.13 -lpthread /usr/lib/llvm/13/lib/libLLVM-13.so && : /usr/lib/gcc/powerpc-unknown-linux-gnu/11.2.0/../../../../powerpc-unknown-linux-gnu/bin/ld: COFF/CMakeFiles/lldCOFF.dir/DebugTypes.cpp.o: in function `lld::coff::TypeMerger::mergeTypesWithGHash()::{lambda(unsigned int)#3}::operator()(unsigned int) const': DebugTypes.cpp:(.text._ZZN3lld4coff10TypeMerger19mergeTypesWithGHashEvENKUljE1_clEj+0x1b0): undefined reference to `__atomic_load_8' /usr/lib/gcc/powerpc-unknown-linux-gnu/11.2.0/../../../../powerpc-unknown-linux-gnu/bin/ld: DebugTypes.cpp:(.text._ZZN3lld4coff10TypeMerger19mergeTypesWithGHashEvENKUljE1_clEj+0x1e4): undefined reference to `__atomic_compare_exchange_8' /usr/lib/gcc/powerpc-unknown-linux-gnu/11.2.0/../../../../powerpc-unknown-linux-gnu/bin/ld: DebugTypes.cpp:(.text._ZZN3lld4coff10TypeMerger19mergeTypesWithGHashEvENKUljE1_clEj+0x2c4): undefined reference to `__atomic_compare_exchange_8' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.
Created attachment 820792 [details] build.log (ppc, 15.0.1)
Created attachment 820807 [details, diff] llvm-15.0.2-cmake_mold_linker_detection.patch
Created attachment 820810 [details, diff] llvm-15.0.2-cmake_libatomic_variable.patch
Created attachment 820813 [details, diff] lld-15.0.2-linking.patch
Created attachment 820825 [details] build.log (ppc, 15.0.2 + llvm-patches applied to llvm + lld patch) Builds fine now. Thanks!
Created attachment 822934 [details, diff] llvm-15.0.2-cmake_mold_linker_detection.patch
Created attachment 822940 [details, diff] llvm-15.0.2-cmake_libatomic.patch
Created attachment 822946 [details, diff] lld-15.0.2-linking.patch
Fixed in 15.0.5.