From: Khem Raj Date: Mon, 8 Sep 2025 21:06:56 +0000 (-0700) Subject: grub,grub-efi: Always use BFD linker with clang X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1194c1a42fc7877a0c99c77e5291216a11ea5dc;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git grub,grub-efi: Always use BFD linker with clang 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, 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index b512cbeb45..14edda334a 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc @@ -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 \