I was trying to compile my application (with both clang 3.3 and gcc 4.8) with address sanitizer but whatever I tried I end up with a lot of link errors like the one below:
and here is linker command line:
arm-linux-androideabi-g++ -Wl,-soname,libpsd.so -shared --sysroot=C:/ndk/platforms/android-14/arch-arm \
(... obj files ...) -lgcc -no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--no-undefined \
-Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -fsanitize=address \
-LC:/cygwin/ndk/platforms/android-14/arch-arm/usr/lib -llog -lz -lc -lm -o ./obj/local/armeabi-v7a/libpsd.so
I've setup sanitizer on application level with:
APP_LDFLAGS += -fsanitize=address
APP_CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls
(I've tried on per module basis as well but with no luck).
Anyone managed to compile with sanitizers enabled?
--