Bug#723908: clang-3.2: -fsanitize=undefined not working

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Sat Sep 21 06:18:58 UTC 2013


Package: clang-3.2
Version: 1:3.2repack-11
Severity: normal

Dear Maintainer,

I seems some file is missing to enable the functionality required by the
"-fsanitize=undefined" option. Maybe it should be included in some
suggested or recomended package?

A simple shell session showing the problem follows:

$ cat test.c
int main (int argc, char **argv) { }
$ clang test.c
$ clang -fsanitize=undefined test.c
/usr/bin/ld: impossibile trovare
/usr/bin/../lib/clang/3.2/lib/linux/libclang_rt.ubsan-x86_64.a: File o
directory non esistente
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
$ LANG=C clang -v -fsanitize=undefined test.c
Debian clang version 3.2-11 (tags/RELEASE_32/final) (based on LLVM 3.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
 "/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all
-disable-free -disable-llvm-verifier -main-file-name test.c
-mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 2.23.52.20130727 -momit-leaf-frame-pointer -v
-resource-dir /usr/bin/../lib/clang/3.2 -fmodule-cache-path
/var/tmp/clang-module-cache -internal-isystem /usr/local/include
-internal-isystem /usr/bin/../lib/clang/3.2/include -internal-isystem
/usr/include/clang/3.2/include/ -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /usr/include
-fdebug-compilation-dir /home/bodrato/gmp-5.1.90-20130921 -ferror-limit
19 -fmessage-length 167
-fsanitize=signed-integer-overflow,divide-by-zero,shift,unreachable,return,vla-bound,alignment,null,vptr,object-size,float-cast-overflow
-mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/test-CA6Tlx.o -x c test.c
clang -cc1 version 3.2 based upon LLVM 3.2svn default target
x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/bin/../lib/clang/3.2/include"
ignoring duplicate directory "/usr/include/x86_64-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/include/clang/3.2/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
 "/usr/bin/ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -o a.out
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu
-L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../.. -L/lib -L/usr/lib
/tmp/test-CA6Tlx.o
/usr/bin/../lib/clang/3.2/lib/linux/libclang_rt.ubsan-x86_64.a -lpthread
-lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/crtend.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
/usr/bin/ld: cannot find
/usr/bin/../lib/clang/3.2/lib/linux/libclang_rt.ubsan-x86_64.a: No such
file or directory
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
$

Best regards,
Marco


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages clang-3.2 depends on:
ii  libc6                2.17-92+b1
ii  libclang-common-dev  1:3.2repack-11
ii  libffi6              3.0.13-4
ii  libgcc-4.8-dev       4.8.1-10
ii  libgcc1              1:4.8.1-10
ii  libllvm3.2           1:3.2repack-11
ii  libobjc-4.8-dev      4.8.1-10
ii  libstdc++-4.8-dev    4.8.1-10
ii  libstdc++6           4.8.1-10

Versions of packages clang-3.2 recommends:
ii  llvm-3.2-dev  1:3.2repack-11
ii  python        2.7.5-4

clang-3.2 suggests no packages.

-- no debconf information


-- 
http://bodrato.it/



More information about the Pkg-llvm-team mailing list