I am trying to compile a simple hello-world executable using clang-3.7 (also tried 3.8 (dev)) with the -fsanitize = safe-stack flag. As explained here ( http://clang.llvm.org/docs/SafeStack.html ), I need to pass this flag to the compiler and linker.
"To enable SafeStack, simply pass the -fsanitize = safe-stack flag for both compiling and linking commands."
I tried the following command to compile the executable:
clang-3.7 -fsanitize=safe-stack -o a.out -Wl,-fsanitize=safe-stack test.c
But the linker tells me that I need to compile it as a shared library (-shared) if I pass the -f flag to the linker.
/usr/bin/ld: -f may not be used without -shared
How to compile executable using the -fsanitize = safe-stack flag?
source
share