We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03d5720 commit 4af8e15Copy full SHA for 4af8e15
build/musl-pie-linker.sh
@@ -1,13 +1,15 @@
1
#!/bin/bash
2
# Linker wrapper for musl builds that need dynamic GTK.
3
-# Replaces -static-pie with -pie to allow dynamic library loading
4
-# while keeping musl libc statically linked.
+# Injects -Bdynamic before -l flags so system libs link dynamically
+# while Rust libs (.rlib) stay static.
5
args=()
6
+found_first_l=false
7
for arg in "$@"; do
- if [ "$arg" = "-static-pie" ]; then
8
- args+=("-pie")
9
- else
10
- args+=("$arg")
+ # Insert -Bdynamic right before the first -l flag
+ if [[ "$arg" == -l* ]] && [ "$found_first_l" = false ]; then
+ args+=("-Wl,-Bdynamic")
11
+ found_first_l=true
12
fi
13
+ args+=("$arg")
14
done
15
exec cc "${args[@]}"
0 commit comments