From a29c18f96998be3fd3c39f65c765c0a6bfff3e04 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 8 Aug 2021 04:13:05 +0200 Subject: [PATCH] Toolchain+Ports: Let -nostdlib make us not link against libgcc_s For now this is not a mandatory toolchain rebuild. --- Ports/gcc/patches/gcc.patch | 2 +- Toolchain/Patches/gcc.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Ports/gcc/patches/gcc.patch b/Ports/gcc/patches/gcc.patch index 93a0e85de7c..0ba8f449a7b 100644 --- a/Ports/gcc/patches/gcc.patch +++ b/Ports/gcc/patches/gcc.patch @@ -152,7 +152,7 @@ diff -Naur gcc-11.2.0/gcc/config/serenity.h gcc-11.2.0.serenity/gcc/config/seren +#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}}" ++#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!static: %{rdynamic:-export-dynamic} %{!fbuilding-libgcc:%{!nostdlib:%{!nodefaultlibs:-lgcc_s}} -dynamic-linker /usr/lib/Loader.so}}" + +#undef CC1_SPEC +#define CC1_SPEC "-ftls-model=initial-exec %{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}} -fno-semantic-interposition" diff --git a/Toolchain/Patches/gcc.patch b/Toolchain/Patches/gcc.patch index 93a0e85de7c..0ba8f449a7b 100644 --- a/Toolchain/Patches/gcc.patch +++ b/Toolchain/Patches/gcc.patch @@ -152,7 +152,7 @@ diff -Naur gcc-11.2.0/gcc/config/serenity.h gcc-11.2.0.serenity/gcc/config/seren +#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}}" ++#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!static: %{rdynamic:-export-dynamic} %{!fbuilding-libgcc:%{!nostdlib:%{!nodefaultlibs:-lgcc_s}} -dynamic-linker /usr/lib/Loader.so}}" + +#undef CC1_SPEC +#define CC1_SPEC "-ftls-model=initial-exec %{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}} -fno-semantic-interposition"