-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathglibc.patch
21 lines (20 loc) · 902 Bytes
/
glibc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/cli/build.rs b/cli/build.rs
index 9be441bcc..b89e5a713 100644
--- a/cli/build.rs
+++ b/cli/build.rs
@@ -432,11 +432,13 @@ fn main() {
#[cfg(target_os = "linux")]
{
- let ver = glibc_version::get_version().unwrap();
-
// If a custom compiler is set, the glibc version is not reliable.
// Here, we assume that if a custom compiler is used, that it will be modern enough to support a dynamic symbol list.
- if env::var("CC").is_err() && ver.major <= 2 && ver.minor < 35 {
+ if env::var("CC").is_err()
+ && glibc_version::get_version()
+ .map(|ver| ver.major <= 2 && ver.minor < 35)
+ .unwrap_or(false)
+ {
println!("cargo:warning=Compiling with all symbols exported, this will result in a larger binary. Please use glibc 2.35 or later for an optimised build.");
println!("cargo:rustc-link-arg-bin=deno=-rdynamic");
} else {