Skip to content

Commit 55e57a3

Browse files
committed
Avoid warning spew
...when the compiler doesn't support '-fomit-frame-pointer' on the target architecture.
1 parent 02b3734 commit 55e57a3

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
@@ -4453,8 +4453,16 @@ mod c {
44534453
// compiler-rt's build system already
44544454
cfg.flag("-fno-builtin");
44554455
cfg.flag("-fvisibility=hidden");
4456-
cfg.flag("-fomit-frame-pointer");
44574456
cfg.flag("-ffreestanding");
4457+
// Avoid the following warning appearing once **per file**:
4458+
// clang: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7' [-Wignored-optimization-argument]
4459+
//
4460+
// Note that compiler-rt's build system also checks
4461+
//
4462+
// `check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG)`
4463+
//
4464+
// in https://github.com/rust-lang/compiler-rt/blob/c8fbcb3/cmake/config-ix.cmake#L19.
4465+
cfg.flag_if_supported("-fomit-frame-pointer");
44584466
cfg.define("VISIBILITY_HIDDEN", None);
44594467
}
44604468

0 commit comments

Comments
 (0)