summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2021-07-21 23:14:35 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-02-22 15:26:23 +0000
commit6ffb50080a2978cbffe952bee4b6c6b7877c4224 (patch)
tree9718294e4b882cbd6b5da6677622544e8473b7fc
parent440149804123c4c99041f100f0ae103103de71d1 (diff)
downloadcoreboot-6ffb50080a2978cbffe952bee4b6c6b7877c4224.tar.gz
coreboot-6ffb50080a2978cbffe952bee4b6c6b7877c4224.tar.bz2
coreboot-6ffb50080a2978cbffe952bee4b6c6b7877c4224.zip
Makefile.inc: Replace linker flag -nostartfiles with --nmagic
While the gcc(1) driver has the `-nostartfiles` option, ld(1), the program the coreboot toolchain uses to link the object files, doesn't have it. In binutils before 2.36, this option is interpreted as `-n -o startfiles`, in which the `-o` option is overridden by a later `-o` option, so only the `-n` option has effect, which is the `--nmagic` long option of ld(1). So the correct linker option in this place is `--nmagic`. It is tested that without `--nmagic`, ld can generate a much bigger x86_64 romstage, so this option is still needed. This error is found when trying to update binutils to 2.36 and later versions, where ld(1) is unable to disambiguate options and reports an error. Change-Id: I27dc2209abdc6fec866716a252736c5cf236a347 Signed-off-by: Iru Cai <mytbk920423@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/56490 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com> Signed-off-by: Uwe Poeche <uwe.poeche@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61958 Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
-rw-r--r--Makefile.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile.inc b/Makefile.inc
index 0b09472d3958..be198d65802b 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -478,7 +478,7 @@ ADAFLAGS_common += -gnatwa.eeD.HHTU.U.W.Y
# Disable style checks for now
ADAFLAGS_common += -gnatyN
-LDFLAGS_common := --gc-sections -nostdlib -nostartfiles -static --emit-relocs
+LDFLAGS_common := --gc-sections -nostdlib --nmagic -static --emit-relocs
ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y)
CFLAGS_common += -Werror