mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(cli): build script panics on musl due to glibc_version check (#19913)
musl supports dynamic list.
This patch comes from
cb58b125ad/dev-lang/deno/files/glibc.patch
.
Resolves #17739
Note: This patch is already used in Alpine Linux’s
[deno](https://pkgs.alpinelinux.org/packages?name=deno) package.
Co-authored-by: 12101111 <w12101111@gmail.com>
This commit is contained in:
parent
15290499b5
commit
9b4a588d41
1 changed files with 5 additions and 3 deletions
|
@ -439,11 +439,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 {
|
||||
|
|
Loading…
Reference in a new issue