Simon McVittie <s...@debian.org> 于2021年10月6日周三 下午11:09写道:
>
> Source: llvm-toolchain-13
> Version: 1:13.0.0-2
> Severity: important
> X-Debbugs-Cc: m...@packages.debian.org, debian-m...@lists.debian.org, 
> debian-...@lists.debian.org
>
> llvm-toolchain-13 has always failed to build on armel, mipsel, mips64el.
> This makes mesa BD-Uninstallable on those release architectures since
> its move to llvm-toolchain-13.
>
> On armel:
> > FAILED: bin/llvm-profdata
> > : && /<<PKGBUILDDIR>>/build-llvm/./bin/clang++ -fPIC 
> > -Wno-unused-command-line-argument -Wno-unknown-warning-option -fPIC 
> > -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time 
> > -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter 
> > -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic 
> > -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough 
> > -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type 
> > -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override 
> > -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color 
> > -ffunction-sections -fdata-sections -O2 -DNDEBUG -g1 -marm -Wl,-z,relro    
> > -Wl,-rpath-link,/<<PKGBUILDDIR>>/build-llvm/tools/clang/stage2-bins/./lib  
> > -Wl,-O3 -Wl,--gc-sections 
> > tools/llvm-profdata/CMakeFiles/llvm-profdata.dir/llvm-profdata.cpp.o -o 
> > bin/llvm-profdata  -Wl,-rpath,"\$ORIGIN/../lib"  lib/libLLVM-13.so.1  
> > -lpthread && :
> > /usr/bin/arm-linux-gnueabi-ld: 
> > tools/llvm-profdata/CMakeFiles/llvm-profdata.dir/llvm-profdata.cpp.o: 
> > undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'
> > /usr/bin/arm-linux-gnueabi-ld: /usr/lib/arm-linux-gnueabi/libatomic.so.1: 
> > error adding symbols: DSO missing from command line
>
> On mips*el, the failure is in a different place, but might have the same
> root cause (or not, clone this bug if necessary):
> > FAILED: lib/clang/13.0.0/lib/linux/libclang_rt.scudo_standalone-mipsel.so
> > : && /usr/bin/g++-10 -fPIC -fPIC -Wno-unused-command-line-argument 
> > -Wno-unknown-warning-option -fPIC -fno-semantic-interposition 
> > -fno-shrink-wrap -fvisibility-inlines-hidden -Werror=date-time -Wall 
> > -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual 
> > -Wno-missing-field-initializers -pedantic -Wno-long-long 
> > -Wimplicit-fallthrough -Wno-maybe-uninitialized -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 -Wall -std=c++14 -Wno-unused-parameter -O2 -DNDEBUG -g1  
> > -fPIC -Wno-unused-command-line-argument -Wno-unknown-warning-option 
> > -Wl,--build-id -Wl,-z,defs -Wl,-z,nodelete   -mips32r2 -mabi=32 
> > -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-z,defs,-z,now,-z,relro 
> > -ffunction-sections -fdata-sections -Wl,--gc-sections -pthread 
> > -Wl,-rpath-link,/<<PKGBUILDDIR>>/build-llvm/./lib -shared 
> > -Wl,-soname,libclang_rt.scudo_standalone-mipsel.so -o 
> > lib/clang/13.0.0/lib/linux/libclang_rt.scudo_standalone-mipsel.so 
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/checksum.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/common.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/crc32_hw.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/flags_parser.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/flags.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/fuchsia.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/linux.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/release.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/report.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/string_utils.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/wrappers_c.cpp.o
> >  
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/wrappers_cpp.cpp.o
> >   -Wl,-rpath,"\$ORIGIN/../lib" && :
> > /usr/bin/ld: 
> > projects/compiler-rt/lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-mipsel.dir/wrappers_c.cpp.o:
> >  in function `scudo::atomic_u64::Type 
> > scudo::atomic_load<scudo::atomic_u64>(scudo::atomic_u64 const volatile*, 
> > scudo::memory_order)':
> > /<<PKGBUILDDIR>>/compiler-rt/lib/scudo/standalone/atomic_helpers.h:66: 
> > undefined reference to `__atomic_load_8'
> > /usr/bin/ld: 
> > /<<PKGBUILDDIR>>/compiler-rt/lib/scudo/standalone/atomic_helpers.h:66: 
> > undefined reference to `__atomic_load_8'
>

With this patch, I can this error has been gone:

Index: llvm-toolchain-13-13.0.0/compiler-rt/lib/scudo/standalone/CMakeLists.txt
===================================================================
--- 
llvm-toolchain-13-13.0.0.orig/compiler-rt/lib/scudo/standalone/CMakeLists.txt
+++ llvm-toolchain-13-13.0.0/compiler-rt/lib/scudo/standalone/CMakeLists.txt
@@ -137,6 +137,13 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREA

 append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS)

+if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips" OR
+   CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64" OR
+   CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mipsel" OR
+   CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64el")
+  list(APPEND SCUDO_LINK_LIBS atomic)
+endif()
+
 if(COMPILER_RT_HAS_SCUDO_STANDALONE)
   add_compiler_rt_object_libraries(RTScudoStandalone
     ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}


But I meet a new problem:
/build/llvm-toolchain-13-13.0.0/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp:96:
undefined reference to
`lldb_private::process_linux::NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(lldb_private::ArchSpec
const&, lldb_private::process_linux::NativeThreadLinux&)'
/usr/bin/mips64el-linux-gnuabi64-ld:
/build/llvm-toolchain-13-13.0.0/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp:96:
undefined reference to
`lldb_private::process_linux::NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(lldb_private::ArchSpec
const&, lldb_private::process_linux::NativeThreadLinux&)'

I am digging it.

>     smcv
>


-- 
YunQiang Su

Reply via email to