diff options
author | Richard Braun <rbraun@sceen.net> | 2018-07-08 16:46:01 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-07-08 16:49:11 +0200 |
commit | 2daf0c73f09804588642d53d111495048a9c5886 (patch) | |
tree | 62dfd1ad1f8dcc9ecf5ea1724b5f6b9d04d680ba | |
parent | 99a5fdb17604c0816420ef3d126beab81fc41365 (diff) |
Make linking against libgcc a global requirement
Linking against libgcc was made a per-architecture option for convenience
reasons, an in particular because the kernel didn't have support for the
red zone required by the AMD64 ABI. But lacking the compiler companion
library proved to be problematic early after, so red zone support was
implemented, and libgcc is now unconditionnally linked again.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | arch/x86/Makefile | 11 |
2 files changed, 1 insertions, 12 deletions
@@ -282,7 +282,7 @@ XBUILD_CFLAGS += -Wno-unneeded-internal-declaration XBUILD_CFLAGS += $(call xbuild_check_cc_option,-fno-PIE) XBUILD_CFLAGS += $(call xbuild_check_cc_option,-Qunused-arguments) -XBUILD_LDFLAGS += -static -nostdlib +XBUILD_LDFLAGS += -static -nostdlib -lgcc # Disable the build ID feature of the linker XBUILD_LDFLAGS += -Wl,--build-id=none diff --git a/arch/x86/Makefile b/arch/x86/Makefile index daf862d8..4ae88532 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -20,21 +20,10 @@ XBUILD_LDFLAGS += -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 ifeq ($(CONFIG_X86_32),y) biarch := $(call cc-option,-m32) - XBUILD_CPPFLAGS += -m32 - - XBUILD_LDFLAGS += -lgcc else biarch := -m64 - XBUILD_CPPFLAGS += -m64 - - # XXX The kernel isn't linked with libgcc on amd64, because libgcc - # uses red zones. But since there are actually very few functions - # provided by libgcc on amd64, it was decided to just not link with - # it. If it turns out that libgcc is really needed some day, the - # kernel can somewhat easily be changed to support red zones. - XBUILD_CFLAGS += -mno-red-zone XBUILD_CFLAGS += -mcmodel=kernel endif |