Skip to content

Commit

Permalink
Auto merge of #212 - tamird:fomit-frame-pointer-not-supported-arm, r=…
Browse files Browse the repository at this point in the history
…alexcrichton

Avoid warning spew

...when the compiler doesn't support '-fomit-frame-pointer' on the
target architecture.
  • Loading branch information
bors committed Nov 28, 2017
2 parents 18feacc + 55e57a3 commit 200c94e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4935,8 +4935,16 @@ mod c {
// compiler-rt's build system already
cfg.flag("-fno-builtin");
cfg.flag("-fvisibility=hidden");
cfg.flag("-fomit-frame-pointer");
cfg.flag("-ffreestanding");
// Avoid the following warning appearing once **per file**:
// clang: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7' [-Wignored-optimization-argument]
//
// Note that compiler-rt's build system also checks
//
// `check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG)`
//
// in https://github.com/rust-lang/compiler-rt/blob/c8fbcb3/cmake/config-ix.cmake#L19.
cfg.flag_if_supported("-fomit-frame-pointer");
cfg.define("VISIBILITY_HIDDEN", None);
}

Expand Down

0 comments on commit 200c94e

Please sign in to comment.