OpenBSD-specific behavior of LLVM/clang
, the LLVM/clang compiler exhibits the
clang comes with stack protection enabled by
default, equivalent to the
-fstack-protector-strong option on other systems.
The system will report any violation of the stack protector cookie along
with the function name via
clang will generate PIE code by default, allowing
the system to load the resulting binary at a random location. This
behavior can be turned off by passing
the compiler and
-nopie to the linker.
-fstrict-aliasing option is turned off by
-Ofast has been selected.
clang does not store its version string in
objects. There is no option to control this.
-pg flag is an alias of
clang does not warn for passing pointer arguments
or assignment with different signedness outside of
-pedantic. This can be re-enabled with the
- The warning option
disabled by default.
- Color diagnostic messages are disabled by default and can be re-enabled
-fwrapv option to treat signed integer
overflows as defined is enabled by default to prevent dangerous
optimizations which could remove security critical overflow checks.
- The malloc(3),
free(3) builtins are disabled
to prevent undesirable optimizations of calls to these functions.