]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
grub,grub-efi: Always use BFD linker with clang
authorKhem Raj <raj.khem@gmail.com>
Mon, 8 Sep 2025 21:06:56 +0000 (14:06 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Sep 2025 09:45:09 +0000 (10:45 +0100)
LLD 21+ is erroring on text address being lower than the default
segment address for binaries. Erroring during configure e.g.

cannot link at address 0x2000

With LLD 21, -Ttext,<addr> only moves the .text section
it does not change the image base and LLD 21 errors out
if any section VMA is below the image base and the segment (image)
base still defaults to 0x400000 when using LLD, hence the error

LLD support in Grub needs to be done properly, it will need
to adjust how linker options are constructed in configure. We
default to use BFD linker always when using clang for now.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-bsp/grub/grub2.inc

index b512cbeb4581f569afc47b6453e14119eba86acd..14edda334acd29deef174eacece15c2600b304fb 100644 (file)
@@ -73,6 +73,7 @@ CFLAGS:remove = "-O2"
 # CFLAGS += -mno-mmx -mno-sse
 # So also remove -mfpmath=sse from TUNE_CCARGS
 TUNE_CCARGS:remove = "-mfpmath=sse"
+TUNE_CCARGS:append:toolchain-clang = " -fuse-ld=bfd -Wno-error=unused-command-line-argument"
 
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
                 --disable-grub-mkfont \