[PATCH] Makefile: Disable PLATFORM_LIBGCC for LLVM toolchain

Tom Rini trini at konsulko.com
Tue Sep 27 17:57:30 CEST 2022


On Mon, Sep 26, 2022 at 08:47:47PM +0000, Alistair Delva wrote:

> The LLVM toolchain does not have or need libgcc, so do not require
> it to exist on the library path. Even if "-print-libgcc-file-name"
> returned the empty string, -lgcc would be specified.
> 
> This leaves CONFIG_USE_PRIVATE_LIBGCC alone because I did not have
> a target/toolchain combination available for testing.
> 
> Signed-off-by: Alistair Delva <adelva at google.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at konsulko.com>
> Cc: Nick Desaulniers <ndesaulniers at google.com>
> ---
>  Makefile | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 8af67ebd63..af06b7aa19 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -874,8 +874,10 @@ u-boot-main := $(libs-y)
>  ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y)
>  PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a
>  else
> +ifneq ($(cc-name),clang)
>  PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
>  endif
> +endif
>  PLATFORM_LIBS += $(PLATFORM_LIBGCC)
>  
>  ifdef CONFIG_CC_COVERAGE

So this one isn't quite right, and will result in some platforms /
architectures just failing to build as the handful of functions we get
provided by CONFIG_USE_PRIVATE_LIBGCC end up being missing.

It's also the case that this is a badly named option, and something we
really should figure out how to remove and then always provide the
required functions for. What configuration did you end up having this
problem on exactly?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220927/b99ed698/attachment.sig>


More information about the U-Boot mailing list