pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH PROPOSED] Re: sysutils/arm-trusted-firmware-sun50i_a64 fails to build



On Wed 01 Dec 2021 at 21:14:37 +0100, Rhialto wrote:
> I thought I'd try building u-boot for my Pinebook (from NetBSD/amd64 9.2,
> pkgsrc-2021Q3), but it failed in
> sysutils/arm-trusted-firmware-sun50i_a64:

So when I looked into it deeper, I found the cause.

Here are the messages again:

> ===> configure-message [arm-trusted-firmware-sun50i_a64-2.3 u-boot-pinebook-2018
> .11rc3nb3] ===> Configuring for arm-trusted-firmware-sun50i_a64-2.3
> => Checking for portability problems in extracted files
> ===> build-message [arm-trusted-firmware-sun50i_a64-2.3 u-boot-pinebook-2018.11r
> c3nb3] ===> Building for arm-trusted-firmware-sun50i_a64-2.3
> ...
>   AR      build/sun50i_a64/release/lib/libfdt.a 
>   AS      lib/libc/aarch64/setjmp.S
>   AR      build/sun50i_a64/release/lib/libc.a
>   LD      build/sun50i_a64/release/bl31/bl31.elf
> /usr/pkg/cross-aarch64-none-elf/bin/aarch64-none-elf-ld: skipping incompatible /usr/pkg/lib/libfdt.so when searching for -lfdt
> /usr/pkg/cross-aarch64-none-elf/bin/aarch64-none-elf-ld: skipping incompatible /usr/pkg/lib/libfdt.a when searching for -lfdt
> /usr/pkg/cross-aarch64-none-elf/bin/aarch64-none-elf-ld: skipping incompatible /usr/lib/libc.so when searching for -lc
> /usr/pkg/cross-aarch64-none-elf/bin/aarch64-none-elf-ld: skipping incompatible /usr/lib/libc.a when searching for -lc
> gmake: *** [Makefile:1071: build/sun50i_a64/release/bl31/bl31.elf] Error 1
> *** Error code 2

It turns out that the top-level Makefile in the sources has a linker
option "--fatal-warnings". And the above messages apparently count as
warnings.

So a simple patch fixes things:

$NetBSD$

--- Makefile.orig	2020-04-20 15:56:43.000000000 +0000
+++ Makefile
@@ -375,7 +375,7 @@ TF_LDFLAGS		+=	$(TF_LDFLAGS_$(ARCH))
 # LD = gcc (used when GCC LTO is enabled)
 else ifneq ($(findstring gcc,$(notdir $(LD))),)
 # Pass ld options with Wl or Xlinker switches
-TF_LDFLAGS		+=	-Wl,--fatal-warnings -O1
+TF_LDFLAGS		+=	-O1
 TF_LDFLAGS		+=	-Wl,--gc-sections
 ifeq ($(ENABLE_LTO),1)
 	ifeq (${ARCH},aarch64)
@@ -392,7 +392,7 @@ TF_LDFLAGS		+=	$(subst --,-Xlinker --,$(
 
 # LD = gcc-ld (ld) or llvm-ld (ld.lld) or other
 else
-TF_LDFLAGS		+=	--fatal-warnings -O1
+TF_LDFLAGS		+=	-O1
 TF_LDFLAGS		+=	--gc-sections
 # ld.lld doesn't recognize the errata flags,
 # therefore don't add those in that case

Does that look like a reasonable thing to commit? (to
sysutils/arm-trusted-firmware/patches/patch-Makefile)

-Olaf.
-- 
___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/  have kids to make his activity cost neutral." -The BOFH    falu.nl@rhialto

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index