Skip to content

Commit d69c252

Browse files
committed
Add compiler flags to prevent GLIBC crash
Prevent GLIBC crash on exit from rust-lang/rust#91979 Test Plan: N/A Pull Request: #459
1 parent 57e29c5 commit d69c252

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

.cargo/config.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[target.'cfg(target_env = "gnu")']
2+
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]
3+
14
[target.x86_64-unknown-linux-gnu]
25
# This turns the presence of undefined symbols in the output binary into a
36
# warning instead of an error when linking.
@@ -15,7 +18,7 @@
1518
# unit-testing, however if this crate depends on a crate B that also defines
1619
# `napi` bindings, the linker will fail because B will have been compiled
1720
# without the testing mode noop removal.
18-
rustflags = ["-C", "link-args=-Wl,--warn-unresolved-symbols"]
21+
rustflags = ["-C", "link-args=-Wl,-z,nodelete,--warn-unresolved-symbols"]
1922

2023
[target.x86_64-apple-darwin]
2124
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]
@@ -25,12 +28,15 @@ rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]
2528

2629
[target.arm-unknown-linux-gnueabihf]
2730
linker = "arm-linux-gnueabihf-gcc"
31+
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]
2832

2933
[target.armv7-unknown-linux-gnueabihf]
3034
linker = "arm-linux-gnueabihf-gcc"
35+
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]
3136

3237
[target.aarch64-unknown-linux-gnu]
3338
linker = "aarch64-linux-gnu-gcc"
39+
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]
3440

3541
[target.aarch64-unknown-linux-musl]
3642
linker = "aarch64-linux-musl-gcc"

.changeset/twelve-planets-try.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@atlaspack/rust': patch
3+
---
4+
5+
Fix segmentation faults on exit

crates/lmdb-js-lite/.cargo/config.toml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[target.'cfg(target_env = "gnu")']
2+
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]
3+
14
[target.aarch64-unknown-linux-musl]
25
linker = "aarch64-linux-musl-gcc"
36
rustflags = ["-C", "target-feature=-crt-static"]
+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
[target.'cfg(target_env = "gnu")']
2+
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]
3+
14
[target.wasm32-unknown-unknown]
25
rustflags = ["-C", "link-arg=--export-table"]
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
[target.'cfg(target_env = "gnu")']
2+
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]
3+
14
[target.wasm32-unknown-unknown]
25
rustflags = ["-C", "link-arg=--export-table"]

0 commit comments

Comments
 (0)