GCC
gcc(man gcc
)では、チェックは
-fstack-protector
Emit extra code to check for buffer overflows, such as stack smashing attacks. >This is done by adding a guard variable to functions with
vulnerable objects. This includes functions that call alloca, and functions with >buffers larger than 8 bytes. The guards are initialized when
a function is entered and then checked when the function exits. If a guard check >fails, an error message is printed and the program exits.
-fstack-protector-all
Like -fstack-protector except that all functions are protected.
no-
オプション名の前に追加することで両方を無効にできます
-fno-stack-protector -fno-stack-protector-all
LLVM / Clang
LLVM / Clang(http://clang.llvm.org/docs/UsersManual.html#commandline)で、AdressSanitizerを有効/無効にします。
-f [no-] address-sanitizer:メモリエラー検出器であるAddressSanitizerをオンにします。
およびSAFECode(http://safecode.cs.illinois.edu/docs/UsersGuide.html)
-f [no-] memsafety