Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,16 @@ mod c {
// 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);
// Avoid implicitly creating references to undefined functions
cfg.flag("-Werror=implicit-function-declaration");

if let "aarch64" | "arm64ec" = target.arch.as_str() {
// FIXME(llvm20): Older GCCs on A64 fail to build with
// -Werror=implicit-function-declaration due to a compiler-rt bug.
// With a newer LLVM we should be able to enable the flag everywhere.
// https://github.com/llvm/llvm-project/commit/8aa9d6206ce55bdaaf422839c351fbd63f033b89
} else {
// Avoid implicitly creating references to undefined functions
cfg.flag("-Werror=implicit-function-declaration");
}
}

// int_util.c tries to include stdlib.h if `_WIN32` is defined,
Expand Down
Loading