Skip to content

Commit d7c96ef

Browse files
committed
Time for crime
1 parent 25e6bc4 commit d7c96ef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

build/ui.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,13 @@ export async function buildUi(target?: string, debug = false) {
9797
Object.assign(env, getSysrootEnv(target));
9898
}
9999

100-
// On musl (Alpine), GTK must be dynamically linked even with static musl libc
100+
// On musl (Alpine), we need to disable static-pie to allow dynamic GTK linking.
101+
// The binary will still be mostly static but can link GTK dynamically.
101102
if (platform === "desktop" && await isMusl()) {
102-
env.PKG_CONFIG_ALL_DYNAMIC = "1";
103+
const existingFlags = env.RUSTFLAGS || "";
104+
// Remove -static-pie and force -Bdynamic before system libs
105+
env.RUSTFLAGS =
106+
`${existingFlags} -C link-arg=-Wl,-Bdynamic -C relocation-model=pic`.trim();
103107
}
104108

105109
await exec(buildArgs, env);

0 commit comments

Comments
 (0)