Skip to content

Commit e7e9f98

Browse files
bors[bot]sburton84
andauthored
Merge #165
165: Unset _FORTIFY_SOURCE before setting it to fix error about redefinition r=jethrogb a=sburton84 When building for the `x86_64-fortanix-unknown-sgx` target in release mode I receive the following errors: ``` <command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror] <built-in>: note: this is the location of the previous definition <command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror] <built-in>: note: this is the location of the previous definition cc1: all warnings being treated as errors ``` I think these would only be warnings but `MBEDTLS_FATAL_WARNINGS` defaults to `ON` which makes them into errors. This patch fixes this by explicitly unsetting `_FORTIFY_SOURCE` before setting it to a new value. Co-authored-by: Sean Burton <[email protected]>
2 parents 1d27299 + 4af1565 commit e7e9f98

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mbedtls-sys/build/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ impl BuildConfig {
9999
let mut cflags = vec![];
100100
if FEATURES.have_platform_component("c_compiler", "freestanding") {
101101
cflags.push("-fno-builtin".into());
102+
cflags.push("-U_FORTIFY_SOURCE".into());
102103
cflags.push("-D_FORTIFY_SOURCE=0".into());
103104
cflags.push("-fno-stack-protector".into());
104105
}

0 commit comments

Comments
 (0)