0

I'm trying to build a package with instrumentation. I want to run its test suite with Clang's sanitizers.

I configured as follows:

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}/usr/local/lib/clang/3.4.2/lib/linux
export CC="/usr/local/bin/clang -fsanitize=address -fsanitize=undefined"
export CXX="/usr/local/bin/clang++ -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr"

./configure
make

However, when make enters one of its sub-directories, it clear CC and CFLAGS, which results in a compile/link failure:

$ make
CC="cc" CXX="" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" makeopts
make[1]: Entering directory `/home/jeffrey/asterisk-11.11.0/menuselect'
make[1]: `makeopts' is up to date.
make[1]: Leaving directory `/home/jeffrey/asterisk-11.11.0/menuselect'
CC="cc" CXX="" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" menuselect
make[1]: Entering directory `/home/jeffrey/asterisk-11.11.0/menuselect'
/usr/local/bin/clang  -g -D_GNU_SOURCE -Wall  -o menuselect menuselect.o strcompat.o menuselect_stub.o mxml/libmxml.a 
mxml/libmxml.a(mxml-attr.o): In function `mxmlElementGetAttr':
/home/jeffrey/asterisk-11.11.0/menuselect/mxml/mxml-attr.c:66: undefined reference to `__ubsan_handle_type_mismatch'
/home/jeffrey/asterisk-11.11.0/menuselect/mxml/mxml-attr.c:66: undefined reference to `__ubsan_handle_type_mismatch'
...

How do I tell the autotools to stop messing with my CC and CFLAGS?

4

0 回答 0