On Mon, Nov 7, 2016 at 12:06 AM, steven shi <[email protected]> wrote:
> Hi Vyukov,
> Do you mean directly add "-mllvm -debug" flags in clang build option? It
> doesn't work for me. E.g. I build below global buffer overflow example with
> "-mllvm -debug" flags, the clang build fail with "Unknown command". Please
> advise.
>
> https://github.com/google/sanitizers/wiki/AddressSanitizerExampleGlobalOutOfBounds
>
> $ clang AddressSanitizerExampleGlobalOutOfBounds.c -O0 -g -fno-common
> -fsanitize=address -mllvm -asan-stack=1 -mllvm -asan-globals=1 -mllvm
> -asan-instrumentation-with-call-threshold=0 -mllvm -debug
> clang (LLVM option parsing): Unknown command line argument '-debug'.  Try:
> 'clang (LLVM option parsing) -help'
> clang (LLVM option parsing): Did you mean '-help'?
>
> $ clang --version
> clang version 4.0.0 (trunk 281885)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> InstalledDir: /usr/local/bin


I suspect that if you configure llvm with cmake with
CMAKE_BUILD_TYPE=Debug and LLVM_ENABLE_ASSERTIONS=ON, this flag will
appear. See  
https://github.com/google/sanitizers/wiki/AddressSanitizerHowToBuild
on how to pass these configs.

-- 
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to