Skip to contentSkip to conversation

Fix numerous defconfig build failures

PATCH New Thomas Petazzoni 4 participants 29 messages Mar 4, 2018 – Mar 30, 2018 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

cover Fix numerous defconfig build failures

Hello,

This commit fixes a significant number of defconfig build failures:

- Some defconfigs have a Linux kernel that needs openssl on the host. This requires adding a mechanism to add host-openssl as a dependency of the linux package. This is done by introducing BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL in patch 1.

Then, numerous defconfigs are fixed to use BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL: patches 6 to 13.

The qemu_x86_defconfig and qemu_x86_64_defconfig are however changed in a different way: by removing wireless support, which is the reason why host-openssl becomes necessary in recent kernel versions. Since Qemu doesn't emulate a wireless interface, it didn't make much sense to have this additional dependency. See patch 4 and 5.

For all other defconfigs, we erred on the safe side, and kept the configuration as-is, and simply added BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL.

- Some defconfigs have a Linux kernel that needs libelf on the host. Like host-openssl, we added a new option BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF. See patch 2.

In practice, only qemu_x86_64_defconfig needed libelf and the host, and instead of bringing this dependency, we have disabled the ORC Unwinder from the kernel defconfig. See patch 4.

Therefore, there are no in-tree defconfig that uses BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF.

- In order to make the host openssl and host libelf usable by the Linux kernel build system, we had to ensure that HOST_CFLAGS and HOST_LDFLAGS were properly taken into account. This is done in patch 3.

- Some defconfigs have a U-Boot that needs dtc on the host. For these, the fix is simple: add BR2_TARGET_UBOOT_NEEDS_DTC=y in the defconfig. Patches 14 to 22.

- Finally, one defconfig, ts4900_defconfig, had a separate issue: it wasn't explicitly specifying a kernel version, causing a mismatch with the selected kernel headers version.

Best regards,

Thomas

Thomas Petazzoni (23):
linux: add BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL
linux: add BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF
linux: fix passing of host CFLAGS and LDFLAGS configs/qemu_x86_64_defconfig: remove kernel options that need
openssl/libelf
configs/qemu_x86_defconfig: remove kernel options that need openssl configs/orangepi_zero: needs host-openssl for the Linux kernel build configs/orangepi_pc_plus: needs host-openssl for the Linux kernel
build
configs/snps_archs38_axs103: needs host-openssl for the Linux kernel
build
configs/snps_archs38_vdk: needs host-openssl for the Linux kernel
build
configs/mx53loco: needs host-openssl for the Linux kernel build configs/imx6-sabresd: needs host-openssl for the Linux kernel build configs/snps_arc700_axs101: needs host-openssl for the Linux kernel
build
configs/solidrun_macchiatobin_mainline: needs host-openssl for the
Linux kernel build
configs/freescale_imx6qsabreauto: U-Boot needs host-dtc configs/solidrun_macchiatobin_marvell: U-Boot needs host-dtc configs/freescale_imx6sololiteevk: U-Boot needs host-dtc configs/freescale_imx6dlsabresd: U-Boot needs host-dtc configs/freescale_imx6dlsabreauto: U-Boot needs host-dtc configs/freescale_imx7dsabresd: U-Boot needs host-dtc configs/imx6ulevk: U-Boot needs host-dtc configs/freescale_imx6qsabresd: U-Boot needs host-dtc configs/freescale_imx6sxsabresd: U-Boot needs host-dtc configs/ts4900: explicitly specify Linux kernel version

 board/qemu/x86/linux-4.15.config                 |  2 ++
 board/qemu/x86_64/linux-4.15.config              |  3 +++
 configs/freescale_imx6dlsabreauto_defconfig      |  1 +
 configs/freescale_imx6dlsabresd_defconfig        |  1 +
 configs/freescale_imx6qsabreauto_defconfig       |  1 +
 configs/freescale_imx6qsabresd_defconfig         |  1 +
 configs/freescale_imx6sololiteevk_defconfig      |  1 +
 configs/freescale_imx6sxsabresd_defconfig        |  1 +
 configs/freescale_imx7dsabresd_defconfig         |  1 +
 configs/imx6-sabresd_defconfig                   |  1 +
 configs/imx6ulevk_defconfig                      |  1 +
 configs/mx53loco_defconfig                       |  1 +
 configs/orangepi_pc_plus_defconfig               |  1 +
 configs/orangepi_zero_defconfig                  |  1 +
 configs/snps_arc700_axs101_defconfig             |  1 +
 configs/snps_archs38_axs103_defconfig            |  1 +
 configs/snps_archs38_vdk_defconfig               |  1 +
 configs/solidrun_macchiatobin_mainline_defconfig |  1 +
 configs/solidrun_macchiatobin_marvell_defconfig  |  1 +
 configs/ts4900_defconfig                         |  2 ++
 linux/Config.in                                  | 26 ++++++++++++++++++++++++
 linux/linux.mk                                   | 11 ++++++++--
 22 files changed, 59 insertions(+), 2 deletions(-)
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/23 linux: add BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL

Some Linux kernel configuration options (such as CONFIG_SYSTEM_TRUSTED_KEYRING) require building a host program called extract-cert, which itself needs OpenSSL.

Users having OpenSSL installed on their system won't see a problem, but users who don't have OpenSSL installed will get a build failure. This commit adds a new option that allows users to indicate that their Linux configuration requires building host-openssl.

---
 linux/Config.in | 13 +++++++++++++
 linux/linux.mk  |  4 ++++
 2 files changed, 17 insertions(+)
linux/Config.in +13 -0
index 5afd620d98..663a4063e2 100644
@@ -412,6 +412,19 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
 	  /boot if DTBs have been generated by the kernel build
 	  process.
 
+config BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL
+	bool "Needs host OpenSSL"
+	help
+	  Some Linux kernel configuration options (such as
+	  CONFIG_SYSTEM_TRUSTED_KEYRING) require building a host
+	  program called extract-cert, which itself needs
+	  OpenSSL. Enabling this option will ensure host-openssl gets
+	  built before the Linux kernel.
+
+	  Enable this option if you get a Linux kernel build failure
+	  such as "scripts/extract-cert.c:21:25: fatal error:
+	  openssl/bio.h: No such file or directory".
+
 # Linux extensions
 source "linux/Config.ext.in"
 
linux/linux.mk +4 -0
index 5300b9cfc5..83c57b60ad 100644
@@ -80,6 +80,10 @@ LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZMA) += CONFIG_KERNEL_LZMA
 LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZO) += CONFIG_KERNEL_LZO
 LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_XZ) += CONFIG_KERNEL_XZ
 
+ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL),y)
+LINUX_DEPENDENCIES += host-openssl
+endif
+
 # If host-uboot-tools is selected by the user, assume it is needed to
 # create a custom image
 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS),y)
Signature · 1 line
2.14.3
#2 lore raw

PATCH 2/23 linux: add BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF

In reply to Thomas Petazzoni

Some Linux kernel configuration options (such as CONFIG_UNWINDER_ORC) require building a host program that needs libelf.

Users who have libelf installed on their system won't see a problem, but users who don't have libelf installed will get a build failure. Therefore, this commit adds an option that allows a user to indicate that his Linux kernel configuration requires libelf. When this option is enabled, we add host-elfutils to the dependencies of the linux package (host-elfutils provides the libelf library).

---
 linux/Config.in | 13 +++++++++++++
 linux/linux.mk  |  4 ++++
 2 files changed, 17 insertions(+)
linux/Config.in +13 -0
index 663a4063e2..d1d99b2810 100644
@@ -425,6 +425,19 @@ config BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL
 	  such as "scripts/extract-cert.c:21:25: fatal error:
 	  openssl/bio.h: No such file or directory".
 
+config BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF
+	bool "Needs host libelf"
+	help
+	  Some Linux kernel configuration options (such as
+	  CONFIG_UNWINDER_ORC) require building a host program that
+	  needs libelf. Enabling this option will ensure host-elfutils
+	  (which provides libelf) gets built before the Linux kernel.
+
+	  Enable this option if you get a Linux kernel build failure
+	  such as "Cannot generate ORC metadata for
+	  CONFIG_UNWINDER_ORC=y, please install libelf-dev,
+	  libelf-devel or elfutils-libelf-devel".
+
 # Linux extensions
 source "linux/Config.ext.in"
 
linux/linux.mk +4 -0
index 83c57b60ad..76bf2c2ea7 100644
@@ -84,6 +84,10 @@ ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL),y)
 LINUX_DEPENDENCIES += host-openssl
 endif
 
+ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF),y)
+LINUX_DEPENDENCIES += host-elfutils
+endif
+
 # If host-uboot-tools is selected by the user, assume it is needed to
 # create a custom image
 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS),y)
Signature · 1 line
2.14.3
#3 lore raw

PATCH 3/23 linux: fix passing of host CFLAGS and LDFLAGS

In reply to Thomas Petazzoni

We were passing HOSTCFLAGS="$(HOSTCFLAGS)" to Linux. However:

- HOSTCFLAGS in Buildroot doesn't exist, and is empty, so this assignment never did anything. The name of the variable in Buildroot in HOST_CFLAGS.

- HOSTCFLAGS in Linux isn't used everywhere, and passing it overrides the default HOSTCFLAGS value defined in the main Linux kernel Makefile.

In addition, there is no way to pass additional host LDFLAGS in the Linux kernel build system.

Therefore, we simply shoehorn our HOST_CFLAGS and HOST_LDFLAGS while passing HOSTCC to the Linux kernel build system. This has been tested to work fine with host OpenSSL and host libelf only available in $(HOST_DIR).

---
 linux/linux.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
linux/linux.mk +1 -2
index 76bf2c2ea7..bedc89cad8 100644
@@ -103,8 +103,7 @@ LINUX_EXTRA_DOWNLOADS += $(ARCH_XTENSA_OVERLAY_URL)
 endif
 
 LINUX_MAKE_FLAGS = \
-	HOSTCC="$(HOSTCC)" \
-	HOSTCFLAGS="$(HOSTCFLAGS)" \
+	HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)" \
 	ARCH=$(KERNEL_ARCH) \
 	INSTALL_MOD_PATH=$(TARGET_DIR) \
 	CROSS_COMPILE="$(TARGET_CROSS)" \
Signature · 1 line
2.14.3
#4 lore raw

PATCH 3/23 linux: fix passing of host CFLAGS and LDFLAGS

Quoted 13 lines · Thomas Petazzoni

We were passing HOSTCFLAGS="$(HOSTCFLAGS)" to Linux. However:

- HOSTCFLAGS in Buildroot doesn't exist, and is empty, so this assignment never did anything. The name of the variable in Buildroot in HOST_CFLAGS.

- HOSTCFLAGS in Linux isn't used everywhere, and passing it overrides the default HOSTCFLAGS value defined in the main Linux kernel Makefile.

In addition, there is no way to pass additional host LDFLAGS in the Linux kernel build system.

Quoted 6 lines

Therefore, we simply shoehorn our HOST_CFLAGS and HOST_LDFLAGS while passing HOSTCC to the Linux kernel build system. This has been tested to work fine with host OpenSSL and host libelf only available in $(HOST_DIR).

I ran into the ORC/libelf issue when upgrading to 2018.02 on a custom x86_64 defconfig, and this patch plus the previous one fixed the issue for me.

Thanks,
Frank

Quoted 25 lines
---
 linux/linux.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
linux/linux.mk +1 -3
index 76bf2c2ea7..bedc89cad8 100644
@@ -103,8 +103,7 @@ LINUX_EXTRA_DOWNLOADS += $(ARCH_XTENSA_OVERLAY_URL)
 endif
 
 LINUX_MAKE_FLAGS = \
-       HOSTCC="$(HOSTCC)" \
-       HOSTCFLAGS="$(HOSTCFLAGS)" \
+       HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)" \
        ARCH=$(KERNEL_ARCH) \
        INSTALL_MOD_PATH=$(TARGET_DIR) \
        CROSS_COMPILE="$(TARGET_CROSS)" \
--

2.14.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#5 lore raw

PATCH 4/23 configs/qemu_x86_64_defconfig: remove kernel options that need openssl/libelf

In reply to Thomas Petazzoni

The ORC unwinder requires libelf to be available on the host, so use the frame pointer unwinder instead. Using the frame pointer unwinder is probably good enough in our default Qemu configurations.

Wireless support ends up enabling CONFIG_SYSTEM_TRUSTED_KEYRING, which requires openssl to be available on the host, so disable wireless support, which isn't needed in Qemu.

---
 board/qemu/x86_64/linux-4.15.config | 3 +++
 1 file changed, 3 insertions(+)
board/qemu/x86_64/linux-4.15.config +3 -0
index 0e59b87bd6..5fa33d4424 100644
@@ -9,6 +9,7 @@ CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
+# CONFIG_WIRELESS is not set
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_VIRTIO_BLK=y
@@ -20,6 +21,7 @@ CONFIG_NETDEVICES=y
 CONFIG_VIRTIO_NET=y
 CONFIG_NE2K_PCI=y
 CONFIG_8139CP=y
+# CONFIG_WLAN is not set
 CONFIG_INPUT_EVDEV=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
@@ -47,3 +49,4 @@ CONFIG_EXT4_FS=y
 CONFIG_AUTOFS4_FS=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_UNWINDER_FRAME_POINTER=y
Signature · 1 line
2.14.3
#6 lore raw

PATCH 5/23 configs/qemu_x86_defconfig: remove kernel options that need openssl

In reply to Thomas Petazzoni

Wireless support ends up enabling CONFIG_SYSTEM_TRUSTED_KEYRING, which requires openssl to be available on the host, so disable wireless support, which isn't needed in Qemu.

---
 board/qemu/x86/linux-4.15.config | 2 ++
 1 file changed, 2 insertions(+)
board/qemu/x86/linux-4.15.config +2 -0
index 0e59b87bd6..79f7537d80 100644
@@ -9,6 +9,7 @@ CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
+# CONFIG_WIRELESS is not set
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_VIRTIO_BLK=y
@@ -20,6 +21,7 @@ CONFIG_NETDEVICES=y
 CONFIG_VIRTIO_NET=y
 CONFIG_NE2K_PCI=y
 CONFIG_8139CP=y
+# CONFIG_WLAN is not set
 CONFIG_INPUT_EVDEV=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
Signature · 1 line
2.14.3
#7 lore raw

PATCH 6/23 configs/orangepi_zero: needs host-openssl for the Linux kernel build

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306889

---
 configs/orangepi_zero_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/orangepi_zero_defconfig +1 -0
index 2efccc0ced..fcf9b325cd 100644
@@ -14,6 +14,7 @@ BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h2-plus-orangepi-zero"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero/linux-extras.config"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
Signature · 1 line
2.14.3
#8 lore raw

PATCH 7/23 configs/orangepi_pc_plus: needs host-openssl for the Linux kernel build

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306885

---
 configs/orangepi_pc_plus_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/orangepi_pc_plus_defconfig +1 -0
index 053c3bffbd..edc3909ae7 100644
@@ -13,6 +13,7 @@ BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h3-orangepi-pc-plus"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-pc-plus/linux-extras.config"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
Signature · 1 line
2.14.3
#9 lore raw

PATCH 8/23 configs/snps_archs38_axs103: needs host-openssl for the Linux kernel build

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306944

---
 configs/snps_archs38_axs103_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/snps_archs38_axs103_defconfig +1 -0
index 42a4feaba8..39ceeae433 100644
@@ -17,6 +17,7 @@ BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15"
 BR2_LINUX_KERNEL_DEFCONFIG="axs103_smp"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
 
 # Bootloader
 BR2_TARGET_UBOOT=y
Signature · 1 line
2.14.3
#10 lore raw

PATCH 9/23 configs/snps_archs38_vdk: needs host-openssl for the Linux kernel build

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306946

---
 configs/snps_archs38_vdk_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/snps_archs38_vdk_defconfig +1 -0
index 434ed37a9e..46b539beec 100644
@@ -17,3 +17,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15"
 BR2_LINUX_KERNEL_DEFCONFIG="vdk_hs38_smp"
 BR2_LINUX_KERNEL_VMLINUX=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
Signature · 1 line
2.14.3
#11 lore raw

PATCH 10/23 configs/mx53loco: needs host-openssl for the Linux kernel build

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306856

---
 configs/mx53loco_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/mx53loco_defconfig +1 -0
index aaba4767ed..8bb4014178 100644
@@ -32,3 +32,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15.1"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx53-qsb imx53-qsrb"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
Signature · 1 line
2.14.3
#12 lore raw

PATCH 11/23 configs/imx6-sabresd: needs host-openssl for the Linux kernel build

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306836

---
 configs/imx6-sabresd_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/imx6-sabresd_defconfig +1 -0
index edb4d7ed10..9999513914 100644
@@ -36,3 +36,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd imx6dl-sabresd imx6qp-sabresd"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
Signature · 1 line
2.14.3
reviewer
#13 lore raw

PATCH 11/23 configs/imx6-sabresd: needs host-openssl for the Linux kernel build

Hi Thomas,

Quoted 14 lines · Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306836

---
 configs/imx6-sabresd_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/imx6-sabresd_defconfig +0 -0
index edb4d7ed10..9999513914 100644

configs/imx6-sabresd_defconfig BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15" · line 39

Quoted 4 lines
configs/imx6-sabresd_defconfig +1 -0
@@ -36,3 +36,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd imx6dl-sabresd imx6qp-sabresd"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y

It seems that all kernels >= 4.15 need to have BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL selected, right?

Can we have this selection made on a common place?

Thanks

#14 lore raw

PATCH 11/23 configs/imx6-sabresd: needs host-openssl for the Linux kernel build

Hello,

Quoted 2 lines · Fabio Estevam

It seems that all kernels >= 4.15 need to have BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL selected, right?

No, as explained in PATCH 1 of the series, it depends on your kernel configuration. If you have wireless enabled, a chain of dependency results in the need for host-openssl. If you don't have wireless enabled, you don't necessarily need host-openssl.

Patch 4 in the series shows for example how the host-openssl dependency can be avoided for a Linux 4.15 configuration, by simply disabling wireless support (which isn't terribly useful for a Qemu emulation).

Quoted 1 line

Can we have this selection made on a common place?

I'm afraid we can't, without enforcing this dependency for a number of users who don't need it.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
#15 lore raw

PATCH 12/23 configs/snps_arc700_axs101: needs host-openssl for the Linux kernel build

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306943

---
 configs/snps_arc700_axs101_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/snps_arc700_axs101_defconfig +1 -0
index daa8ebb8f0..0fefaf4aa8 100644
@@ -16,6 +16,7 @@ BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15"
 BR2_LINUX_KERNEL_DEFCONFIG="axs101"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
 
 # Bootloader
 BR2_TARGET_UBOOT=y
Signature · 1 line
2.14.3
#16 lore raw

PATCH 13/23 configs/solidrun_macchiatobin_mainline: needs host-openssl for the Linux kernel build

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306948

---
 configs/solidrun_macchiatobin_mainline_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/solidrun_macchiatobin_mainline_defconfig +1 -0
index 526c021fe7..dd797d709c 100644
@@ -31,6 +31,7 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="marvell/armada-8040-mcbin"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/solidrun/macchiatobin/linux-extras.config"
 BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
 
 # rootfs
 BR2_TARGET_ROOTFS_TAR=y
Signature · 1 line
2.14.3
#17 lore raw

PATCH 14/23 configs/freescale_imx6qsabreauto: U-Boot needs host-dtc

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306820

---
 configs/freescale_imx6qsabreauto_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/freescale_imx6qsabreauto_defconfig +1 -0
index f03b7101fb..bc333e1a37 100644
@@ -40,3 +40,4 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_4.9.x_1.0.0_ga"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
Signature · 1 line
2.14.3
#18 lore raw

PATCH 15/23 configs/solidrun_macchiatobin_marvell: U-Boot needs host-dtc

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306949

---
 configs/solidrun_macchiatobin_marvell_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/solidrun_macchiatobin_marvell_defconfig +1 -0
index 1e747c344a..5489136e1c 100644
@@ -22,6 +22,7 @@ BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/MarvellEmbeddedProcessors/u-boot-marvell"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="u-boot-2017.03-armada-17.10"
 BR2_TARGET_UBOOT_BOARDNAME="mvebu_mcbin-88f8040"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
 
 # Kernel
 BR2_LINUX_KERNEL=y
Signature · 1 line
2.14.3
#19 lore raw

PATCH 16/23 configs/freescale_imx6sololiteevk: U-Boot needs host-dtc

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306822

---
 configs/freescale_imx6sololiteevk_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/freescale_imx6sololiteevk_defconfig +1 -0
index 1b3546255a..b840f2f185 100644
@@ -36,3 +36,4 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_4.9.x_1.0.0_ga"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
Signature · 1 line
2.14.3
#20 lore raw

PATCH 17/23 configs/freescale_imx6dlsabresd: U-Boot needs host-dtc

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306819

---
 configs/freescale_imx6dlsabresd_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/freescale_imx6dlsabresd_defconfig +1 -0
index a5c0aa6090..dc9b498aa4 100644
@@ -39,3 +39,4 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_4.9.x_1.0.0_ga"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
Signature · 1 line
2.14.3
#21 lore raw

PATCH 18/23 configs/freescale_imx6dlsabreauto: U-Boot needs host-dtc

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306818

---
 configs/freescale_imx6dlsabreauto_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/freescale_imx6dlsabreauto_defconfig +1 -0
index 19c1cc286a..55db461f44 100644
@@ -40,3 +40,4 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_4.9.x_1.0.0_ga"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
Signature · 1 line
2.14.3
#22 lore raw

PATCH 19/23 configs/freescale_imx7dsabresd: U-Boot needs host-dtc

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306825

---
 configs/freescale_imx7dsabresd_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/freescale_imx7dsabresd_defconfig +1 -0
index 844b547670..3563d1e1b2 100644
@@ -28,6 +28,7 @@ BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_4.9.x_1.0.0_ga"
 BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_TARGET_UBOOT_NEEDS_DTC=y
 
 # required tools to create the microSD image
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
Signature · 1 line
2.14.3
#23 lore raw

PATCH 20/23 configs/imx6ulevk: U-Boot needs host-dtc

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306824

---
 configs/imx6ulevk_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/imx6ulevk_defconfig +1 -0
index 0ae6b5308e..069f8cfc5e 100644
@@ -25,6 +25,7 @@ BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.11"
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="SPL"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
 
 # required tools to create the SD card image
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
Signature · 1 line
2.14.3
#24 lore raw

PATCH 21/23 configs/freescale_imx6qsabresd: U-Boot needs host-dtc

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306821

---
 configs/freescale_imx6qsabresd_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/freescale_imx6qsabresd_defconfig +1 -0
index 613b48a913..e0ef20c578 100644
@@ -40,3 +40,4 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_4.9.x_1.0.0_ga"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
Signature · 1 line
2.14.3
#25 lore raw

PATCH 22/23 configs/freescale_imx6sxsabresd: U-Boot needs host-dtc

In reply to Thomas Petazzoni

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306823

---
 configs/freescale_imx6sxsabresd_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/freescale_imx6sxsabresd_defconfig +1 -0
index 01e13143b2..eb11fb8ae1 100644
@@ -39,3 +39,4 @@ BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_4.9.x_1.0.0_ga"
 BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_TARGET_UBOOT_NEEDS_DTC=y
Signature · 1 line
2.14.3
#26 lore raw

PATCH 23/23 configs/ts4900: explicitly specify Linux kernel version

In reply to Thomas Petazzoni

The ts4900 defconfig currently fails to build because it selects kernel headers 4.12, but doesn't specify a kernel version, and therefore 4.15 is built causing the following error:

Incorrect selection of kernel headers: expected 4.12.x, got 4.15.x

In commit 7c3a7d808e751d4b608a4c50a0ae4d13dedebab7 ("configs/ts4900:
bump kernel version to 4.12"), when this defconfig was switched from using a vendor provided kernel to the mainline kernel, the kernel version was no longer explicitly specified.

Since this commit indicated 4.12, and the kernel headers version selected is also 4.12, we also use that as the fixed kernel version.

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/55306955

---
 configs/ts4900_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/ts4900_defconfig +2 -0
index 082234fcad..e7950cea4b 100644
@@ -3,6 +3,8 @@ BR2_cortex_a9=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_12=y
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/technologic/ts4900/post-image.sh"
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.12"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
 BR2_LINUX_KERNEL_UIMAGE=y
 BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x10008000"
Signature · 1 line
2.14.3
#27 lore raw

cover Fix numerous defconfig build failures

In reply to Thomas Petazzoni
Quoted 48 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,
This commit fixes a significant number of defconfig build failures:

- Some defconfigs have a Linux kernel that needs openssl on the host. This requires adding a mechanism to add host-openssl as a dependency of the linux package. This is done by introducing BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL in patch 1.

Then, numerous defconfigs are fixed to use BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL: patches 6 to 13.

The qemu_x86_defconfig and qemu_x86_64_defconfig are however changed in a different way: by removing wireless support, which is the reason why host-openssl becomes necessary in recent kernel versions. Since Qemu doesn't emulate a wireless interface, it didn't make much sense to have this additional dependency. See patch 4 and 5.

For all other defconfigs, we erred on the safe side, and kept the configuration as-is, and simply added BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL.

- Some defconfigs have a Linux kernel that needs libelf on the host. Like host-openssl, we added a new option BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF. See patch 2.

In practice, only qemu_x86_64_defconfig needed libelf and the host, and instead of bringing this dependency, we have disabled the ORC Unwinder from the kernel defconfig. See patch 4.

Therefore, there are no in-tree defconfig that uses BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF.

- In order to make the host openssl and host libelf usable by the Linux kernel build system, we had to ensure that HOST_CFLAGS and HOST_LDFLAGS were properly taken into account. This is done in patch 3.

- Some defconfigs have a U-Boot that needs dtc on the host. For these, the fix is simple: add BR2_TARGET_UBOOT_NEEDS_DTC=y in the defconfig. Patches 14 to 22.

- Finally, one defconfig, ts4900_defconfig, had a separate issue: it wasn't explicitly specifying a kernel version, causing a mismatch with the selected kernel headers version.

Quoted 8 lines

Best regards,

Thomas

Thomas Petazzoni (23):
linux: add BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL
linux: add BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF
linux: fix passing of host CFLAGS and LDFLAGS

I've put this patch in front of the rest and committed the entire series, thanks!

I'll also backport to 2018.02.x once we've verified that it doesn't break anything.

Signature · 1 line
Bye, Peter Korsgaard
#28 lore raw

cover Fix numerous defconfig build failures

In reply to Thomas Petazzoni
Quoted 74 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,
This commit fixes a significant number of defconfig build failures:

- Some defconfigs have a Linux kernel that needs openssl on the host. This requires adding a mechanism to add host-openssl as a dependency of the linux package. This is done by introducing BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL in patch 1.

Then, numerous defconfigs are fixed to use BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL: patches 6 to 13.

The qemu_x86_defconfig and qemu_x86_64_defconfig are however changed in a different way: by removing wireless support, which is the reason why host-openssl becomes necessary in recent kernel versions. Since Qemu doesn't emulate a wireless interface, it didn't make much sense to have this additional dependency. See patch 4 and 5.

For all other defconfigs, we erred on the safe side, and kept the configuration as-is, and simply added BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL.

- Some defconfigs have a Linux kernel that needs libelf on the host. Like host-openssl, we added a new option BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF. See patch 2.

In practice, only qemu_x86_64_defconfig needed libelf and the host, and instead of bringing this dependency, we have disabled the ORC Unwinder from the kernel defconfig. See patch 4.

Therefore, there are no in-tree defconfig that uses BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF.

- In order to make the host openssl and host libelf usable by the Linux kernel build system, we had to ensure that HOST_CFLAGS and HOST_LDFLAGS were properly taken into account. This is done in patch 3.

- Some defconfigs have a U-Boot that needs dtc on the host. For these, the fix is simple: add BR2_TARGET_UBOOT_NEEDS_DTC=y in the defconfig. Patches 14 to 22.

- Finally, one defconfig, ts4900_defconfig, had a separate issue: it wasn't explicitly specifying a kernel version, causing a mismatch with the selected kernel headers version.

Best regards,

Thomas

Thomas Petazzoni (23):
linux: add BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL
linux: add BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF
linux: fix passing of host CFLAGS and LDFLAGS configs/qemu_x86_64_defconfig: remove kernel options that need
openssl/libelf
configs/qemu_x86_defconfig: remove kernel options that need openssl configs/orangepi_zero: needs host-openssl for the Linux kernel build configs/orangepi_pc_plus: needs host-openssl for the Linux kernel
build
configs/snps_archs38_axs103: needs host-openssl for the Linux kernel
build
configs/snps_archs38_vdk: needs host-openssl for the Linux kernel
build
configs/mx53loco: needs host-openssl for the Linux kernel build configs/imx6-sabresd: needs host-openssl for the Linux kernel build configs/snps_arc700_axs101: needs host-openssl for the Linux kernel
build
configs/solidrun_macchiatobin_mainline: needs host-openssl for the
Linux kernel build
configs/freescale_imx6qsabreauto: U-Boot needs host-dtc configs/solidrun_macchiatobin_marvell: U-Boot needs host-dtc

Quoted 8 lines

configs/freescale_imx6sololiteevk: U-Boot needs host-dtc configs/freescale_imx6dlsabresd: U-Boot needs host-dtc configs/freescale_imx6dlsabreauto: U-Boot needs host-dtc configs/freescale_imx7dsabresd: U-Boot needs host-dtc configs/imx6ulevk: U-Boot needs host-dtc configs/freescale_imx6qsabresd: U-Boot needs host-dtc configs/freescale_imx6sxsabresd: U-Boot needs host-dtc configs/ts4900: explicitly specify Linux kernel version

Committed all of these to 2018.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard