mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 04:35:41 +03:00
Toolchain: Enable building all code with -fPIC
Ordinarily this would force the compiler to not inline certain symbols and call them via the PLT instead. To counteract this I've also added -fno-semantic-interposition which disables ELF symbol interposition. Our dynamic loader doesn't support this anyway and we might even consider not implementing this at all. Even though this is a toolchain change this doesn't require rebuilding the toolchain unless you're planning to build for the x86_64 arch.
This commit is contained in:
parent
a050b43290
commit
d685db6eb6
Notes:
sideshowbarker
2024-07-18 18:45:25 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/d685db6eb66 Pull-request: https://github.com/SerenityOS/serenity/pull/6803 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/awesomekling
@ -129,7 +129,7 @@ diff -Naur gcc-11.1.0-RC-20210420/gcc/config/serenity.h gcc-11.1.0-RC-20210420.s
|
|||||||
+#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!static: %{rdynamic:-export-dynamic} %{!fbuilding-libgcc:-lgcc_s -dynamic-linker /usr/lib/Loader.so}}"
|
+#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!static: %{rdynamic:-export-dynamic} %{!fbuilding-libgcc:-lgcc_s -dynamic-linker /usr/lib/Loader.so}}"
|
||||||
+
|
+
|
||||||
+#undef CC1_SPEC
|
+#undef CC1_SPEC
|
||||||
+#define CC1_SPEC "-fno-exceptions -ftls-model=initial-exec"
|
+#define CC1_SPEC "-fno-exceptions -ftls-model=initial-exec %{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}} -fno-semantic-interposition"
|
||||||
+
|
+
|
||||||
+#undef CC1PLUS_SPEC
|
+#undef CC1PLUS_SPEC
|
||||||
+#define CC1PLUS_SPEC "-fno-exceptions -ftls-model=initial-exec"
|
+#define CC1PLUS_SPEC "-fno-exceptions -ftls-model=initial-exec"
|
||||||
|
Loading…
Reference in New Issue
Block a user