Skip to content

Commit 200c94e

Browse files
committed
Auto merge of #212 - tamird:fomit-frame-pointer-not-supported-arm, r=alexcrichton
Avoid warning spew ...when the compiler doesn't support '-fomit-frame-pointer' on the target architecture.
2 parents 18feacc + 55e57a3 commit 200c94e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

build.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4935,8 +4935,16 @@ mod c {
49354935
// compiler-rt's build system already
49364936
cfg.flag("-fno-builtin");
49374937
cfg.flag("-fvisibility=hidden");
4938-
cfg.flag("-fomit-frame-pointer");
49394938
cfg.flag("-ffreestanding");
4939+
// Avoid the following warning appearing once **per file**:
4940+
// clang: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7' [-Wignored-optimization-argument]
4941+
//
4942+
// Note that compiler-rt's build system also checks
4943+
//
4944+
// `check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG)`
4945+
//
4946+
// in https://github.com/rust-lang/compiler-rt/blob/c8fbcb3/cmake/config-ix.cmake#L19.
4947+
cfg.flag_if_supported("-fomit-frame-pointer");
49404948
cfg.define("VISIBILITY_HIDDEN", None);
49414949
}
49424950

0 commit comments

Comments
 (0)