Hi, I am trying to compile a c++ program on AIX 7.2 using g++ -fsanitize=address ...
option but this errors out with
cc1plus: warning: '-fsanitize=address' not supported for this target
collect2: fatal error: library libasan not found
compilation terminated.
So I thought maybe we need libasan
to use the fsanitize option, and proceeded to build llvm
from source. But running into the same issue with that. I’m using the following commands to configure:
> export CC=gcc; export CXX=g++;
> cmake -DLLVM_ENABLE_PROJECTS=clang -DLLVM_ENABLE_RUNTIMES=compiler-rt -DCMAKE_INSTALL_PREFIX=/cdm-409975/build_asan/llvm_install -DLLVM_USE_SANITIZER=Address -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="PowerPC" -G "Unix Makefiles" /llvm-project/llvm
But then cmake --build .
fails with:
Consolidate compiler generated dependencies of target LLVMDemangle
[ 0%] Building CXX object lib/Demangle/CMakeFiles/LLVMDemangle.dir/Demangle.cpp.o
cc1plus: error: '-fsanitize=address' not supported for this target [-Werror]
cc1plus: all warnings being treated as errors
Can anyone help on how to compile a cpp program on AIX with asan?
My environment:
gcc version 10.3.0
cmake version 3.20.0
AIX 7.2