From 5df8c274bb32235cd5adaa0cbb6ffddfb1d041e0 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 28 Jul 2021 20:46:52 +0200 Subject: [PATCH] Toolchain+Ports: Fix building ports on x86_64 Fixes #8377. --- Ports/gcc/patches/gcc.patch | 4 ++-- Toolchain/Patches/gcc.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Ports/gcc/patches/gcc.patch b/Ports/gcc/patches/gcc.patch index 65a148bd021..93a0e85de7c 100644 --- a/Ports/gcc/patches/gcc.patch +++ b/Ports/gcc/patches/gcc.patch @@ -145,11 +145,11 @@ diff -Naur gcc-11.2.0/gcc/config/serenity.h gcc-11.2.0.serenity/gcc/config/seren +/* Files that are linked before user code. + The %s tells GCC to look for these files in the library directory. */ +#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "%{!shared:crt0.o%s} crti.o%s %{shared: %{!fbuilding-libgcc:crt0_shared.o%s}} %{shared|pie:crtbeginS.o%s; :crtbegin.o%s}" ++#define STARTFILE_SPEC "%{!shared:crt0.o%s} crti.o%s %{shared: %{!fbuilding-libgcc:crt0_shared.o%s}} %{shared|static-pie|!no-pie:crtbeginS.o%s; :crtbegin.o%s}" + +/* Files that are linked after user code. */ +#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "%{shared|pie:crtendS.o%s; :crtend.o%s} crtn.o%s" ++#define ENDFILE_SPEC "%{shared|static-pie|!no-pie:crtendS.o%s; :crtend.o%s} crtn.o%s" + +#undef LINK_SPEC +#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!static: %{rdynamic:-export-dynamic} %{!fbuilding-libgcc:%{!nodefaultlibs:-lgcc_s} -dynamic-linker /usr/lib/Loader.so}}" diff --git a/Toolchain/Patches/gcc.patch b/Toolchain/Patches/gcc.patch index 65a148bd021..93a0e85de7c 100644 --- a/Toolchain/Patches/gcc.patch +++ b/Toolchain/Patches/gcc.patch @@ -145,11 +145,11 @@ diff -Naur gcc-11.2.0/gcc/config/serenity.h gcc-11.2.0.serenity/gcc/config/seren +/* Files that are linked before user code. + The %s tells GCC to look for these files in the library directory. */ +#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "%{!shared:crt0.o%s} crti.o%s %{shared: %{!fbuilding-libgcc:crt0_shared.o%s}} %{shared|pie:crtbeginS.o%s; :crtbegin.o%s}" ++#define STARTFILE_SPEC "%{!shared:crt0.o%s} crti.o%s %{shared: %{!fbuilding-libgcc:crt0_shared.o%s}} %{shared|static-pie|!no-pie:crtbeginS.o%s; :crtbegin.o%s}" + +/* Files that are linked after user code. */ +#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "%{shared|pie:crtendS.o%s; :crtend.o%s} crtn.o%s" ++#define ENDFILE_SPEC "%{shared|static-pie|!no-pie:crtendS.o%s; :crtend.o%s} crtn.o%s" + +#undef LINK_SPEC +#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!static: %{rdynamic:-export-dynamic} %{!fbuilding-libgcc:%{!nodefaultlibs:-lgcc_s} -dynamic-linker /usr/lib/Loader.so}}"