1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:27:46 +00:00

Toolchain: Fix usage of libgcc_s & build PIE executables by default

We can now build the porst with the shared libraries toolchain.
This commit is contained in:
Itamar 2020-12-11 15:44:08 +02:00 committed by Andreas Kling
parent 69b0fdd84a
commit 758fc8c063
4 changed files with 5 additions and 4 deletions

View file

@ -224,6 +224,7 @@ pushd "$DIR/Build/"
--with-newlib \
--enable-shared \
--enable-languages=c,c++ \
--enable-default-pie \
${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1
echo "XXX build gcc and libgcc"

View file

@ -128,7 +128,7 @@ index 000000000..2692b8e57
+#define ENDFILE_SPEC "%{shared|pie:crtendS.o%s; :crtend.o%s} crtn.o%s"
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!shared: %{!static: %{rdynamic:-export-dynamic} -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}}"
+
+/* Additional predefined macros. */
+#undef TARGET_OS_CPP_BUILTINS