Skip to content

Commit e6e4513

Browse files
authored
Merge pull request #706 from XrXr/limit-fix
Allow implicit function decl on A64
2 parents dff1601 + 749c12f commit e6e4513

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

build.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,16 @@ mod c {
327327
// in https://github.com/rust-lang/compiler-rt/blob/c8fbcb3/cmake/config-ix.cmake#L19.
328328
cfg.flag_if_supported("-fomit-frame-pointer");
329329
cfg.define("VISIBILITY_HIDDEN", None);
330-
// Avoid implicitly creating references to undefined functions
331-
cfg.flag("-Werror=implicit-function-declaration");
330+
331+
if let "aarch64" | "arm64ec" = target.arch.as_str() {
332+
// FIXME(llvm20): Older GCCs on A64 fail to build with
333+
// -Werror=implicit-function-declaration due to a compiler-rt bug.
334+
// With a newer LLVM we should be able to enable the flag everywhere.
335+
// https://github.com/llvm/llvm-project/commit/8aa9d6206ce55bdaaf422839c351fbd63f033b89
336+
} else {
337+
// Avoid implicitly creating references to undefined functions
338+
cfg.flag("-Werror=implicit-function-declaration");
339+
}
332340
}
333341

334342
// int_util.c tries to include stdlib.h if `_WIN32` is defined,

0 commit comments

Comments
 (0)