mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
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.
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user