[build] add convenience script for ASan builds

Sometimes when ASan support is wanted for fwknop, the following compile
error can be generated. This script provides a means to solve this.

fwknop-spa_comm.o: In function `send_spa_packet_http':
/home/mbr/git/fwknop.git/client/spa_comm.c:516: undefined reference to `rpl_malloc'
../lib/.libs/libfko.so: undefined reference to `rpl_realloc'
This commit is contained in:
Michael Rash 2015-08-18 20:37:56 -04:00
parent 5e0a668a7f
commit 47ff151dea
2 changed files with 22 additions and 0 deletions

View File

@ -74,6 +74,7 @@ EXTRA_DIST = \
extras/ramdisk/ramdisk-create.sh \
extras/ramdisk/ramdisk-create-osx.sh \
extras/console-qr/console-qr.sh \
extras/sanitizer/asan-build.sh \
fwknop.spec \
iphone/main.m \
iphone/Fwknop.xcodeproj \

21
extras/sanitizer/asan-build.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh -x
#
# In some cases when enabling Google's Address Sanitizer, errors like the
# following can be generated. This script provides a workaround.
#
# fwknop-spa_comm.o: In function `send_spa_packet_http':
# /home/mbr/git/fwknop.git/client/spa_comm.c:516: undefined reference to `rpl_malloc'
# ../lib/.libs/libfko.so: undefined reference to `rpl_realloc'
#
if [ -x ./configure ]; then
export ac_cv_func_malloc_0_nonnull=yes
export ac_cv_func_realloc_0_nonnull=yes
./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/run --enable-asan-support $@
make clean
make
else
echo "[*] Execute from the fwknop top level sources directory"
fi