build: enable PIC for static libghostty-vt

The static library was built without position-independent code,
which caused linker errors when consumers tried to link it into
PIE executables (the default on most Linux distributions). The
linker would fail with "relocation R_X86_64_32 against symbol
cannot be used when making a PIE object."

Enable PIC on the static library root module so it can be linked
into both PIE and non-PIE executables.
pull/11732/head
Mitchell Hashimoto 2026-03-21 15:15:11 -07:00
parent 555bf7e922
commit 5fd36ea69e
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,10 @@ fn initLib(
// we'll cross that bridge when we get to it.
lib.bundle_compiler_rt = true;
lib.bundle_ubsan_rt = true;
// Enable PIC so the static library can be linked into PIE
// executables, which is the default on most Linux distributions.
lib.root_module.pic = true;
}
if (lib.rootModuleTarget().abi.isAndroid()) {