Skip to content

Commit 9b96570

Browse files
committed
Fix for _FORTIFY_SOURCE
1 parent 4b35869 commit 9b96570

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

aws-lc-sys/builder/cc_builder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ impl CcBuilder {
375375

376376
let compiler = if let Some(original_cflags) = optional_env_target("CFLAGS") {
377377
let mut new_cflags = original_cflags.clone();
378-
new_cflags.push_str(" -O0");
378+
// The `_FORTIFY_SOURCE` macro often requires optimizations to also be enabled, so unset it.
379+
new_cflags.push_str(" -O0 -Wp,-U_FORTIFY_SOURCE");
379380
set_env_for_target("CFLAGS", &new_cflags);
380381
// cc-rs currently prioritizes flags provided by CFLAGS over the flags provided by the build script.
381382
// The environment variables used by the compiler are set when `get_compiler` is called.

0 commit comments

Comments
 (0)