Runtime library not exposing some _Unwind symbols.
| Bugzilla Link | 28681 |
| Version | 3.9 |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @zmodem,@stephenhines,@yuanfang-chen |
Extended Description
Currently, compiler-rt isn't exposing some _Unwind symbols exposed by libgcc_s.so, which makes it unsuitable replacement for libgcc_s.so.
While building clang with another clang that uses compiler-rt as its runtime lib, on Linux x86_64, I get the following error:
../../sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_unwind_linux_libcdep.cc.o: In function __sanitizer::BufferedStackTrace::SlowUnwindStack(unsigned long, unsigned int)': /sources/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:125: undefined reference to _Unwind_Backtrace'
../../sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_unwind_linux_libcdep.cc.o: In function SlowUnwindStack': /sources/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:125: undefined reference to _Unwind_Backtrace'
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
Grepping for _Unwind on libgcc_s.so, I get the following:
strings libgcc_s.so.1 | grep Unwind
_Unwind_GetGR _Unwind_GetCFA _Unwind_SetGR _Unwind_GetIP _Unwind_GetIPInfo _Unwind_SetIP _Unwind_GetLanguageSpecificData _Unwind_GetRegionStart _Unwind_FindEnclosingFunction _Unwind_Find_FDE _Unwind_GetDataRelBase _Unwind_GetTextRelBase _Unwind_RaiseException _Unwind_ForcedUnwind _Unwind_Resume _Unwind_Resume_or_Rethrow _Unwind_DeleteException _Unwind_Backtrace
Doing the same for clang runtime:
strings libclang_rt.builtins-x86_64.a | grep Unwind
_Unwind_GetLanguageSpecificData _Unwind_GetIP _Unwind_GetRegionStart _Unwind_SetGR _Unwind_SetIP
The rest of the functions seems to be exposed by llvm's libunwind. The solution is to either link libunwind statically to the runtime or explicitly specify it at linker command line when adding compiler-rt runtime libs (it seemed to work manually).
LLVM+clang+compiler-rt combination does not have a default unwinder. At least clang does not add one.
When built with LLVM, HandleLLVMOptions.cmake would add -z,defs to linker flags for shared lib targets in compiler-rt, which causes the failure. The standalone build of compiler-rt does not add the flag. The same thing goes with libLLVMRuntimeDyld.so (uses __register_frame/__deregister_frame), which in shared lib build have the same failure here.
I think the correct fix to leave the choice of unwinder to the client of the shared library being built.
I created https://reviews.llvm.org/D53553 https://reviews.llvm.org/D53686
Are there some news regarting this bugreport? it still affects some linkage, specially on amd64 targets.
Using 7.0.0 version
I think I am also getting hit with this bug,
64bit Ubuntu 16.04 system, trunk sources,
my errors look like this:
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_unwind_linux_libcdep.cc.o: In function __sanitizer::Unwind_GetIP(_Unwind_Context*)': /home/mehrlich/Code/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:98: undefined reference to _Unwind_GetIP'
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_unwind_linux_libcdep.cc.o: In function Unwind_GetIP': /home/mehrlich/Code/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:98: undefined reference to _Unwind_GetIP'
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_unwind_linux_libcdep.cc.o: In function __sanitizer::BufferedStackTrace::SlowUnwindStack(unsigned long, unsigned int)': /home/mehrlich/Code/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:125: undefined reference to _Unwind_Backtrace'
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_unwind_linux_libcdep.cc.o: In function SlowUnwindStack': /home/mehrlich/Code/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:125: undefined reference to _Unwind_Backtrace'
I don't think this is a regression, so while it would be nice to get fixed, it's not blocking 3.9.
Happens to me, too.
Using Arch Linux, compiling with clang with -rtlib=compiler-rt and asan+ubsan; get the following errors:
log
I get the similar output with only ubsan, and the same output with only asan.
[remorin@chuwawa:1 simple]$ make CC=clang build/reverse
mkdir: created directory 'build/'
clang -v -rtlib=compiler-rt -D_ISOC11_SOURCE -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_GNU_SOURCE -D_FORTIFY_SOURCE=3 -std=gnu17 -g3 -Og -march=native -Wall -Wextra -Wpedantic -Wdouble-promotion -Wconversion -Wno-sign-conversion -Wno-gnu-case-range -Wno-gnu-designator -fsanitize=undefined -fsanitize=address -Wl,-v -Wl,--gc-sections -fuse-ld=lld reverse.c -o build/reverse
clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.1
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/usr/bin/clang-15" -cc1 -triple x86_64-pc-linux-gnu -emit-obj --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name reverse.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu goldmont -target-feature -avx512pf -target-feature -tsxldtrk -target-feature +cx16 -target-feature +sahf -target-feature -tbm -target-feature -avx512ifma -target-feature +sha -target-feature +crc32 -target-feature -fma4 -target-feature -vpclmulqdq -target-feature +prfchw -target-feature -bmi2 -target-feature -cldemote -target-feature +fsgsbase -target-feature -avx512bf16 -target-feature -amx-tile -target-feature -uintr -target-feature +gfni -target-feature +popcnt -target-feature +ptwrite -target-feature +aes -target-feature -avx512bitalg -target-feature +movdiri -target-feature -widekl -target-feature -xsaves -target-feature -avx512er -target-feature -avxvnni -target-feature -avx512fp16 -target-feature -avx512vnni -target-feature -amx-bf16 -target-feature -avx512vpopcntdq -target-feature -pconfig -target-feature +clwb -target-feature -avx512f -target-feature -xsavec -target-feature -clzero -target-feature -pku -target-feature +mmx -target-feature -lwp -target-feature +rdpid -target-feature -xop -target-feature +rdseed -target-feature +waitpkg -target-feature -kl -target-feature +movdir64b -target-feature -sse4a -target-feature -avx512bw -target-feature +clflushopt -target-feature -xsave -target-feature -avx512vbmi2 -target-feature +64bit -target-feature -avx512vl -target-feature -serialize -target-feature -hreset -target-feature -invpcid -target-feature -avx512cd -target-feature -avx -target-feature -vaes -target-feature -amx-int8 -target-feature +cx8 -target-feature -fma -target-feature -rtm -target-feature -bmi -target-feature -enqcmd -target-feature +rdrnd -target-feature -mwaitx -target-feature +sse4.1 -target-feature +sse4.2 -target-feature -avx2 -target-feature +fxsr -target-feature -wbnoinvd -target-feature +sse -target-feature -lzcnt -target-feature +pclmul -target-feature -rdpru -target-feature -f16c -target-feature +ssse3 -target-feature -sgx -target-feature -prefetchwt1 -target-feature +cmov -target-feature -avx512vbmi -target-feature -shstk -target-feature +movbe -target-feature -avx512vp2intersect -target-feature -xsaveopt -target-feature -avx512dq -target-feature +sse2 -target-feature -adx -target-feature +sse3 -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/remorin/Documents/program_in_C/knking-projects/simple -resource-dir /usr/lib/clang/15.0.7 -D _ISOC11_SOURCE -D _XOPEN_SOURCE=700 -D _DEFAULT_SOURCE -D _GNU_SOURCE -D _FORTIFY_SOURCE=3 -internal-isystem /usr/lib/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../x86_64-pc-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Og -Wall -Wextra -Wpedantic -Wdouble-promotion -Wconversion -Wno-sign-conversion -Wno-gnu-case-range -Wno-gnu-designator -std=gnu17 -fdebug-compilation-dir=/home/remorin/Documents/program_in_C/knking-projects/simple -ferror-limit 19 -fsanitize=address,alignment,array-bounds,bool,builtin,enum,float-cast-overflow,function,integer-divide-by-zero,nonnull-attribute,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound,vptr -fsanitize-recover=alignment,array-bounds,bool,builtin,enum,float-cast-overflow,function,integer-divide-by-zero,nonnull-attribute,null,object-size,pointer-overflow,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,vla-bound,vptr -fsanitize-system-ignorelist=/usr/lib/clang/15.0.7/share/asan_ignorelist.txt -fsanitize-address-use-after-scope -fno-assume-sane-operator-new -stack-protector 2 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/reverse-7ca9ac.o -x c reverse.c
clang -cc1 version 15.0.7 based upon LLVM 15.0.7 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../x86_64-pc-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/clang/15.0.7/include
/usr/local/include
/usr/include
End of search list.
"/usr/bin/ld.lld" -pie --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o build/reverse /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib64/Scrt1.o /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib64/crti.o /usr/lib/clang/15.0.7/lib/linux/clang_rt.crtbegin-x86_64.o -L/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1 -L/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/bin/../lib -L/lib -L/usr/lib --whole-archive /usr/lib/clang/15.0.7/lib/linux/libclang_rt.asan_static-x86_64.a --no-whole-archive --whole-archive /usr/lib/clang/15.0.7/lib/linux/libclang_rt.asan-x86_64.a --no-whole-archive --dynamic-list=/usr/lib/clang/15.0.7/lib/linux/libclang_rt.asan-x86_64.a.syms -v --gc-sections /tmp/reverse-7ca9ac.o --no-as-needed -lpthread -lrt -lm -ldl -lresolv /usr/lib/clang/15.0.7/lib/linux/libclang_rt.builtins-x86_64.a -lc /usr/lib/clang/15.0.7/lib/linux/libclang_rt.builtins-x86_64.a /usr/lib/clang/15.0.7/lib/linux/clang_rt.crtend-x86_64.o /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib64/crtn.o
LLD 15.0.7 (compatible with GNU linkers)
ld.lld: error: undefined symbol: _Unwind_GetIP
>>> referenced by sanitizer_unwind_linux_libcdep.cpp.o:(__sanitizer::(anonymous namespace)::Unwind_Trace(_Unwind_Context*, void*)) in archive /usr/lib/clang/15.0.7/lib/linux/libclang_rt.asan-x86_64.a
ld.lld: error: undefined symbol: _Unwind_Backtrace
>>> referenced by sanitizer_unwind_linux_libcdep.cpp.o:(__sanitizer::BufferedStackTrace::UnwindSlow(unsigned long, unsigned int)) in archive /usr/lib/clang/15.0.7/lib/linux/libclang_rt.asan-x86_64.a
>>> referenced by sanitizer_unwind_linux_libcdep.cpp.o:(__sanitizer::BufferedStackTrace::UnwindSlow(unsigned long, void*, unsigned int)) in archive /usr/lib/clang/15.0.7/lib/linux/libclang_rt.asan-x86_64.a
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:111: build/reverse] Error 1
clang, compiler-rt, llvm, llvm-libs, libunwind and gcc-libs are installed:
pacman info
[remorin@chuwawa:2 ~]$ pacman -Qii clang compiler-rt llvm llvm-libs libunwind gcc-libs
Name : clang
Version : 15.0.7-9
Description : C language family frontend for LLVM
Architecture : x86_64
URL : https://clang.llvm.org/
Licenses : custom:Apache 2.0 with LLVM Exception
Groups : None
Provides : clang-analyzer=15.0.7 clang-tools-extra=15.0.7
Depends On : llvm-libs gcc compiler-rt
Optional Deps : openmp: OpenMP support in clang with -fopenmp
python: for scan-view and git-clang-format [installed]
llvm: referenced by some clang headers [installed]
Required By : lldb
Optional For : None
Conflicts With : clang-analyzer clang-tools-extra
Replaces : clang-analyzer clang-tools-extra
Installed Size : 195.04 MiB
Packager : Evangelos Foutras <[email protected]>
Build Date : Tue 02 May 2023 07:09:14 PM MSK
Install Date : Wed 16 Aug 2023 07:37:00 PM MSK
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
Backup Files :
(none)
Name : compiler-rt
Version : 15.0.7-2
Description : Compiler runtime libraries for clang
Architecture : x86_64
URL : https://compiler-rt.llvm.org/
Licenses : custom:Apache 2.0 with LLVM Exception
Groups : None
Provides : None
Depends On : gcc-libs
Optional Deps : None
Required By : clang
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 39.94 MiB
Packager : Evangelos Foutras <[email protected]>
Build Date : Mon 15 May 2023 07:09:42 PM MSK
Install Date : Wed 16 Aug 2023 07:36:59 PM MSK
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Backup Files :
(none)
Name : llvm
Version : 15.0.7-3
Description : Compiler infrastructure
Architecture : x86_64
URL : https://llvm.org/
Licenses : custom:Apache 2.0 with LLVM Exception
Groups : None
Provides : None
Depends On : llvm-libs perl
Optional Deps : None
Required By : None
Optional For : clang
Conflicts With : None
Replaces : None
Installed Size : 94.85 MiB
Packager : Felix Yan <[email protected]>
Build Date : Sat 08 Apr 2023 08:45:41 AM MSK
Install Date : Thu 17 Aug 2023 06:07:35 PM MSK
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
Backup Files :
(none)
Name : llvm-libs
Version : 15.0.7-3
Description : LLVM runtime libraries
Architecture : x86_64
URL : https://llvm.org/
Licenses : custom:Apache 2.0 with LLVM Exception
Groups : None
Provides : None
Depends On : gcc-libs zlib zstd libffi libedit ncurses libxml2
Optional Deps : None
Required By : clang libva-mesa-driver lld lldb llvm mesa mesa-vdpau vulkan-radeon vulkan-swrast
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 120.48 MiB
Packager : Felix Yan <[email protected]>
Build Date : Sat 08 Apr 2023 08:45:41 AM MSK
Install Date : Sat 05 Aug 2023 05:24:04 PM MSK
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Backup Files :
(none)
Name : libunwind
Version : 1.6.2-2
Description : Portable and efficient C programming interface (API) to determine the call-chain of a program
Architecture : x86_64
URL : https://www.nongnu.org/libunwind/
Licenses : GPL
Groups : None
Provides : None
Depends On : xz zlib
Optional Deps : None
Required By : gimp gperftools gstreamer lib32-libunwind libcamera libplacebo mesa vulkan-swrast
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 254.09 KiB
Packager : Jan Alexander Steffens (heftig) <[email protected]>
Build Date : Thu 17 Nov 2022 08:39:58 PM MSK
Install Date : Tue 02 May 2023 02:42:31 AM MSK
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Backup Files :
(none)
Name : gcc-libs
Version : 13.2.1-3
Description : Runtime libraries shipped by GCC
Architecture : x86_64
URL : https://gcc.gnu.org
Licenses : GPL3 LGPL FDL custom
Groups : None
Provides : gcc-libs-multilib libgo.so=22-64 libgfortran.so=5-64 libgphobos.so=4-64 libubsan.so=1-64
libasan.so=8-64 libtsan.so=2-64 liblsan.so=0-64
Depends On : glibc>=2.27
Optional Deps : None
Required By : abseil-cpp alsa-tools alsa-utils aom base bear blas box2d chromaprint clucene compiler-rt db
db5.3 djvulibre double-conversion easytag exempi exiv2 fastfetch fftw fish flac fluidsynth fmt
gc gcc gegl gettext gimp glslang glu gmp gnustep-base gnutls gperftools gptfdisk graphite
greetd greetd-agreety groff handbrake highway hunspell icu id3lib imath intel-gmmlib
intel-media-driver jsoncpp libb2 libblockdev libbs2b libc++abi libcaca libcamera libcamera-ipa
libcap libcdio libde265 libebml libelf libfilezilla libgit2 libgme libimagequant libinih
libmanette libmfx libmodplug libnl libnumbertext libopenmpt libosinfo libpipewire libplacebo
libplist libreoffice-fresh librevenge libsigc++ libsigc++-3.0 libsmbios libsoxr libunrar
libusbmuxd libvdpau-va-gl libvpx libwpd libwpe libyuv llvm-libs luajit lzip mhwd-db-garuda-git
mjpegtools mold ncurses nmap onetbb openal openmpi p7zip pcre pipewire pipewire-audio
pipewire-pulse pipewire-zeroconf poppler poppler-glib portaudio powertop protobuf qemu-audio-dbus
qemu-block-curl qemu-block-nfs qemu-block-ssh qemu-common qemu-hw-display-qxl qemu-hw-usb-redirect
qemu-hw-usb-smartcard qemu-img qemu-pr-helper qemu-system-x86 qemu-tools qemu-ui-curses qemu-ui-dbus
qemu-ui-opengl qemu-ui-spice-core qemu-vhost-user-gpu rate-mirrors rav1e re2 rubberband shaderc
smplayer snappy soundtouch speex speexdsp spirv-tools srt starship subversion systemd-libs
taglib tealdeer thin-provisioning-tools tree-sitter uchardet udisks2 unarchiver unrar v4l-utils
vdpauinfo vid.stab virtiofsd vmaf webrtc-audio-processing x265 zeromq zimg zstd zxing-cpp
Optional For : None
Conflicts With : None
Replaces : gcc-libs-multilib libgphobos
Installed Size : 143.93 MiB
Packager : Frederik Schwan <[email protected]>
Build Date : Wed 02 Aug 2023 10:06:38 AM MSK
Install Date : Sat 05 Aug 2023 05:23:58 PM MSK
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
Backup Files :
(none)
I don't get the errors when remove -rtlib=compiler-rt, or use no sanitizers.
Btw, adding -lgcc_s fixes it:
log
[remorin@chuwawa:1 simple]$ make CC=clang build/reverse
mkdir: created directory 'build/'
clang -v -rtlib=compiler-rt -D_ISOC11_SOURCE -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_GNU_SOURCE -D_FORTIFY_SOURCE=3 -std=gnu17 -g3 -Og -march=native -Wall -Wextra -Wpedantic -Wdouble-promotion -Wconversion -Wno-sign-conversion -Wno-gnu-case-range -Wno-gnu-designator -fsanitize=undefined -fsanitize=address -Wl,-v -Wl,--gc-sections -fuse-ld=lld -lgcc_s reverse.c -o build/reverse
clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.1
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/usr/bin/clang-15" -cc1 -triple x86_64-pc-linux-gnu -emit-obj --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name reverse.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu goldmont -target-feature -avx512pf -target-feature -tsxldtrk -target-feature +cx16 -target-feature +sahf -target-feature -tbm -target-feature -avx512ifma -target-feature +sha -target-feature +crc32 -target-feature -fma4 -target-feature -vpclmulqdq -target-feature +prfchw -target-feature -bmi2 -target-feature -cldemote -target-feature +fsgsbase -target-feature -avx512bf16 -target-feature -amx-tile -target-feature -uintr -target-feature +gfni -target-feature +popcnt -target-feature +ptwrite -target-feature +aes -target-feature -avx512bitalg -target-feature +movdiri -target-feature -widekl -target-feature -xsaves -target-feature -avx512er -target-feature -avxvnni -target-feature -avx512fp16 -target-feature -avx512vnni -target-feature -amx-bf16 -target-feature -avx512vpopcntdq -target-feature -pconfig -target-feature +clwb -target-feature -avx512f -target-feature -xsavec -target-feature -clzero -target-feature -pku -target-feature +mmx -target-feature -lwp -target-feature +rdpid -target-feature -xop -target-feature +rdseed -target-feature +waitpkg -target-feature -kl -target-feature +movdir64b -target-feature -sse4a -target-feature -avx512bw -target-feature +clflushopt -target-feature -xsave -target-feature -avx512vbmi2 -target-feature +64bit -target-feature -avx512vl -target-feature -serialize -target-feature -hreset -target-feature -invpcid -target-feature -avx512cd -target-feature -avx -target-feature -vaes -target-feature -amx-int8 -target-feature +cx8 -target-feature -fma -target-feature -rtm -target-feature -bmi -target-feature -enqcmd -target-feature +rdrnd -target-feature -mwaitx -target-feature +sse4.1 -target-feature +sse4.2 -target-feature -avx2 -target-feature +fxsr -target-feature -wbnoinvd -target-feature +sse -target-feature -lzcnt -target-feature +pclmul -target-feature -rdpru -target-feature -f16c -target-feature +ssse3 -target-feature -sgx -target-feature -prefetchwt1 -target-feature +cmov -target-feature -avx512vbmi -target-feature -shstk -target-feature +movbe -target-feature -avx512vp2intersect -target-feature -xsaveopt -target-feature -avx512dq -target-feature +sse2 -target-feature -adx -target-feature +sse3 -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/remorin/Documents/program_in_C/knking-projects/simple -resource-dir /usr/lib/clang/15.0.7 -D _ISOC11_SOURCE -D _XOPEN_SOURCE=700 -D _DEFAULT_SOURCE -D _GNU_SOURCE -D _FORTIFY_SOURCE=3 -internal-isystem /usr/lib/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../x86_64-pc-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Og -Wall -Wextra -Wpedantic -Wdouble-promotion -Wconversion -Wno-sign-conversion -Wno-gnu-case-range -Wno-gnu-designator -std=gnu17 -fdebug-compilation-dir=/home/remorin/Documents/program_in_C/knking-projects/simple -ferror-limit 19 -fsanitize=address,alignment,array-bounds,bool,builtin,enum,float-cast-overflow,function,integer-divide-by-zero,nonnull-attribute,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound,vptr -fsanitize-recover=alignment,array-bounds,bool,builtin,enum,float-cast-overflow,function,integer-divide-by-zero,nonnull-attribute,null,object-size,pointer-overflow,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,vla-bound,vptr -fsanitize-system-ignorelist=/usr/lib/clang/15.0.7/share/asan_ignorelist.txt -fsanitize-address-use-after-scope -fno-assume-sane-operator-new -stack-protector 2 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/reverse-2c53f5.o -x c reverse.c
clang -cc1 version 15.0.7 based upon LLVM 15.0.7 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../x86_64-pc-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/clang/15.0.7/include
/usr/local/include
/usr/include
End of search list.
"/usr/bin/ld.lld" -pie --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o build/reverse /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib64/Scrt1.o /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib64/crti.o /usr/lib/clang/15.0.7/lib/linux/clang_rt.crtbegin-x86_64.o -L/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1 -L/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/bin/../lib -L/lib -L/usr/lib --whole-archive /usr/lib/clang/15.0.7/lib/linux/libclang_rt.asan_static-x86_64.a --no-whole-archive --whole-archive /usr/lib/clang/15.0.7/lib/linux/libclang_rt.asan-x86_64.a --no-whole-archive --dynamic-list=/usr/lib/clang/15.0.7/lib/linux/libclang_rt.asan-x86_64.a.syms -v --gc-sections -lgcc_s /tmp/reverse-2c53f5.o --no-as-needed -lpthread -lrt -lm -ldl -lresolv /usr/lib/clang/15.0.7/lib/linux/libclang_rt.builtins-x86_64.a -lc /usr/lib/clang/15.0.7/lib/linux/libclang_rt.builtins-x86_64.a /usr/lib/clang/15.0.7/lib/linux/clang_rt.crtend-x86_64.o /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib64/crtn.o
LLD 15.0.7 (compatible with GNU linkers)
But libgcc_s.so* files are from gcc-libs, so it wouldn't be compiler-rt anymore; maybe compiler-rt+libgcc hybrid at best.
Is there other way to fix it?
@petrhosek @DavidSpickett
Arch Linux
try using llvm-libunwind from the AUR with --unwindlib=none -l:libunwind.so.1.0.