Jeffrey Walton
2013-11-21 14:26:11 UTC
I'm trying to evaluate a third party library based on autotools. The
evaluation includes some basic dynamic analysis using Clang 3.3 (the
analysis is provided by the sanitzers).
`make check` is failing due to missing symbols:
libjpeg.a(jmemmgr.o): In function `do_sarray_io':
/home/jwalton/Desktop/jpeg-6b/jmemmgr.c:695: undefined reference to
`__ubsan_handle_type_mismatch'
/home/jwalton/Desktop/jpeg-6b/jmemmgr.c:695: undefined reference to
`__ubsan_handle_type_mismatch'
/home/jwalton/Desktop/jpeg-6b/jmemmgr.c:696: undefined reference to
`__ubsan_handle_type_mismatch'
...
However, I'm including the required clang library through LDLIBS:
export LDLIBS="/usr/local/lib/clang/lib/linux/3.3/libclang_rt.full-x86_64.a
/usr/local/lib/clang/lib/linux/3.3/libclang_rt.ubsan-x86_64.a"
export CC=/usr/local/bin/clang
export CXX=/usr/local/bin/clang++
export CFLAGS="-g3 -fsanitize=address -fsanitize=undefined"
export CXXFLAGS="-g3 -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr"
The missing functions are part of the libs specified in LDLIBS:
$ nm --defined libclang_rt.ubsan-x86_64.a | grep -i __ubsan_handle_type_mismatch
0000000000000000 T __ubsan_handle_type_mismatch
0000000000000740 T __ubsan_handle_type_mismatch_abort
...
How does one force the incusion of a library when using autotools?
Thanks in advance.
evaluation includes some basic dynamic analysis using Clang 3.3 (the
analysis is provided by the sanitzers).
`make check` is failing due to missing symbols:
libjpeg.a(jmemmgr.o): In function `do_sarray_io':
/home/jwalton/Desktop/jpeg-6b/jmemmgr.c:695: undefined reference to
`__ubsan_handle_type_mismatch'
/home/jwalton/Desktop/jpeg-6b/jmemmgr.c:695: undefined reference to
`__ubsan_handle_type_mismatch'
/home/jwalton/Desktop/jpeg-6b/jmemmgr.c:696: undefined reference to
`__ubsan_handle_type_mismatch'
...
However, I'm including the required clang library through LDLIBS:
export LDLIBS="/usr/local/lib/clang/lib/linux/3.3/libclang_rt.full-x86_64.a
/usr/local/lib/clang/lib/linux/3.3/libclang_rt.ubsan-x86_64.a"
export CC=/usr/local/bin/clang
export CXX=/usr/local/bin/clang++
export CFLAGS="-g3 -fsanitize=address -fsanitize=undefined"
export CXXFLAGS="-g3 -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr"
The missing functions are part of the libs specified in LDLIBS:
$ nm --defined libclang_rt.ubsan-x86_64.a | grep -i __ubsan_handle_type_mismatch
0000000000000000 T __ubsan_handle_type_mismatch
0000000000000740 T __ubsan_handle_type_mismatch_abort
...
How does one force the incusion of a library when using autotools?
Thanks in advance.