Bug 241261 - sysutils/u-boot-rpi, sysutils/u-boot-rpi2: Fails to build on 11.3-STABLE: Error: You must add new CONFIG options using Kconfig
Summary: sysutils/u-boot-rpi, sysutils/u-boot-rpi2: Fails to build on 11.3-STABLE: Err...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-uboot (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2019-10-15 12:53 UTC by jau
Modified: 2020-07-03 20:03 UTC (History)
5 users (show)

See Also:
koobs: maintainer-feedback? (uboot)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jau 2019-10-15 12:53:42 UTC
The make job to build sysutils/u-boot-rpi2 fails persistently on 11.3-stable.

The error messages are shown below...

  arm-none-eabi-ld.bfd   -pie  --gc-sections -Bstatic  --no-dynamic-linker -Ttext 0x00008000 -o u-boot -T u-boot.lds arch/arm/cpu/armv7/start.o --start-group  api/built-in.o  arch/arm/cpu/built-in.o  arch/arm/cpu/armv7/built-in.o  arch/arm/lib/built-in.o  arch/arm/mach-bcm283x/built-in.o  board/raspberrypi/rpi/built-in.o  cmd/built-in.o  common/built-in.o  disk/built-in.o  drivers/built-in.o  drivers/dma/built-in.o  drivers/gpio/built-in.o  drivers/i2c/built-in.o  drivers/mtd/built-in.o  drivers/mtd/onenand/built-in.o  drivers/mtd/spi/built-in.o  drivers/net/built-in.o  drivers/net/phy/built-in.o  drivers/power/built-in.o  drivers/power/battery/built-in.o  drivers/power/domain/built-in.o  drivers/power/fuel_gauge/built-in.o  drivers/power/mfd/built-in.o  drivers/power/pmic/built-in.o  drivers/power/regulator/built-in.o  drivers/serial/built-in.o  drivers/spi/built-in.o  drivers/usb/common/built-in.o  drivers/usb/dwc3/built-in.o  drivers/usb/emul/built-in.o  drivers/usb/eth/built-in.o  drivers/usb/host/built-in.o  drivers/usb/musb-new/built-in.o  drivers/usb/musb/built-in.o  drivers/usb/phy/built-in.o  drivers/usb/ulpi/built-in.o  env/built-in.o  fs/built-in.o  lib/built-in.o  net/built-in.o --end-group arch/arm/lib/eabi_compat.o  arch/arm/lib/lib.a -Map u-boot.map;  true
  arm-none-eabi-objcopy --gap-fill=0xff  -j .text -j .secure_text -j .secure_data -j .rodata -j .hash -j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn -j .binman_sym_table -j .text_rest -j .dtb.init.rodata -j .efi_runtime -j .efi_runtime_rel -O srec u-boot u-boot.srec
  arm-none-eabi-objcopy --gap-fill=0xff  -j .text -j .secure_text -j .secure_data -j .rodata -j .hash -j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn -j .binman_sym_table -j .text_rest -j .dtb.init.rodata -j .efi_runtime -j .efi_runtime_rel -O binary   u-boot u-boot-nodtb.bin
  arm-none-eabi-objdump -t u-boot > u-boot.sym
  cp u-boot-nodtb.bin u-boot.bin
  ./scripts/check-config.sh u-boot.cfg ./scripts/config_whitelist.txt .
Error: You must add new CONFIG options using Kconfig
The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_MALLOC_CLEAR_ON_INIT
CONFIG_SYS_USB_EVENT_POLL

Please add these via Kconfig instead. Find a suitable Kconfig
file and add a 'config' or 'menuconfig' option.
gmake[1]: *** [Makefile:1055: all] Error 1
gmake[1]: Leaving directory '/usr/ports/sysutils/u-boot-rpi2/work/u-boot-2019.10'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2019-10-15 12:53:42 UTC
Maintainer informed via mail
Comment 2 jau 2019-10-15 12:54:39 UTC
The same problem bothers also sysutils/u-boot-rpi.
Comment 3 Thomas Skibo 2020-07-03 16:51:17 UTC
I have seen this before.  It seems BSD sed handles tabs differently than Linux sed and so scripts/check-config.sh misses some options in Kconfig files.  The target still gets built, though.

This patch to u-boot works for me:

diff --git a/scripts/check-config.sh b/scripts/check-config.sh
index 583f7d0963..e899e5679a 100755
--- a/scripts/check-config.sh
+++ b/scripts/check-config.sh
@@ -45,8 +45,8 @@ cat ${path} |sed -n 's/^#define \(CONFIG_[A-Za-z0-9_]*\).*/\1/p' |sort |uniq \
 comm -23 ${configs} ${whitelist} > ${suspects}
 
 cat `find ${srctree} -name "Kconfig*"` |sed -n \
-       -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
-       -e 's/^\s*menuconfig \([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
+       -e 's/^[\s\t]*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
+       -e 's/^[\s\t]*menuconfig \([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
        |sort |uniq > ${ok}
 comm -23 ${suspects} ${ok} >${new_adhoc}
 if [ -s ${new_adhoc} ]; then
Comment 4 Kyle Evans freebsd_committer freebsd_triage 2020-07-03 16:55:14 UTC
(In reply to Thomas Skibo from comment #3)

We should BINARY_ALIAS sed to textproc/gsed in this case. sed won't handle \t until 12.2 and \s until 13.0.
Comment 5 Emmanuel Vadot freebsd_committer freebsd_triage 2020-07-03 16:58:36 UTC
(In reply to Kyle Evans from comment #4)
We do.
I'll have a look at this bug but this is the first time that I've heard that it doesn't work.
Also we have packages built so ...
Comment 6 Thomas Skibo 2020-07-03 20:03:01 UTC
(In reply to Emmanuel Vadot from comment #5)
I guess I should clarify that I often build u-boot outside of ports and would run into this problem only on certain target platforms.