我正在尝试使用仪器构建一个包。我想用Clang的消毒剂运行它的测试套件。
我配置如下:
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
但是,当make
进入其中一个子目录时,会清除CC
和CFLAGS
,这会导致编译/链接失败:
$ 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'
...
如何告诉自动工具停止弄乱我的CC
和CFLAGS
?