[cfe-users] /usr/bin/ld: cannot find libclang_rt.ubsan_standalone-arm.a: No such file or directory

Jeffrey Walton via cfe-users cfe-users at lists.llvm.org
Fri Aug 5 20:15:34 PDT 2016


I'm working on Raspberry Pi 3. Its an ARMv8 device with CRC but
without Crypto extensions. It also uses a 32-bit OS and hard float
configuration.

I'm trying to track down a crash that happens under both GCC and Clang
on this platform. Other ARM platforms are OK, and i686 and x86_64 are
OK.

I compiled the program with the following CXXFLAGS.

    -march=armv8-a -mtune=cortex-a53 -mfpu=neon-fp-armv8
-mfloat-abi=hard -fsanitize=undefined

The compiler driver invokes the linker, and it includes the CXXFLAGS.
The link results in:

$ make
clang++  -pthread -march=armv8-a -mtune=cortex-a53 -mfpu=neon-fp-armv8
-mfloat-abi=hard -fsanitize=undefined -Wl,-rpath=\$ORIGIN
build/obj/cli/x509.o build/obj/cli/compress.o build/obj/cli/pubkey.o
build/obj/cli/tls_proxy.o build/obj/cli/utils.o build/obj/cli/cc_enc.o
build/obj/cli/asn1.o build/obj/cli/math.o build/obj/cli/speed.o
build/obj/cli/tls_server.o build/obj/cli/main.o
build/obj/cli/tls_client.o -L. -lbotan-1.11 -lrt -o ./botan
/usr/bin/ld: cannot find
/usr/lib/llvm-3.7/bin/../lib/clang/3.7.0/lib/linux/libclang_rt.ubsan_standalone-arm.a:
No such file or directory
/usr/bin/ld: cannot find
/usr/lib/llvm-3.7/bin/../lib/clang/3.7.0/lib/linux/libclang_rt.ubsan_standalone_cxx-arm.a:
No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:1521: recipe for target 'botan' failed

Grepping is not finding the missing library:

$ sudo find / -name '*ubsan*'
/usr/lib/arm-linux-gnueabihf/libubsan.so.0.0.0
/usr/lib/arm-linux-gnueabihf/libubsan.so.0
/usr/lib/gcc/arm-linux-gnueabihf/4.9/libubsan.so
/usr/lib/gcc/arm-linux-gnueabihf/4.9/libubsan.a
/usr/share/doc/libubsan0
/var/lib/dpkg/info/libubsan0:armhf.postrm
/var/lib/dpkg/info/libubsan0:armhf.md5sums
/var/lib/dpkg/info/libubsan0:armhf.postinst
/var/lib/dpkg/info/libubsan0:armhf.symbols
/var/lib/dpkg/info/libubsan0:armhf.list
/var/lib/dpkg/info/libubsan0:armhf.shlibs

And:

$ sudo dpkg -S libclang_rt.ubsan_standalone_cxx-arm.a
dpkg-query: no path found matching pattern
*libclang_rt.ubsan_standalone_cxx-arm.a*

It appears at least some of the saniziters are available on some of
the compilers.

My questions are:

  * Does Clang support UBsan on ARM?
  * If so, what package normally supplies it?

Thanks in advance.



More information about the cfe-users mailing list