Skip to contentSkip to conversation

Unable to compile uboot v2012.10 on Buildroot 2016.05

Buildroot Carlos Santos 4 participants 12 messages Jul 1, 2016 – Jul 5, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

My company is developing a board based on a vendor reference design which depends on a custom U-Boot, based on v2012.10. We were able to build the custom U-Boot using Buildroot before this commit:

commit 0dca644e443c8f28bfe5aa1c98201dc3b49e1165

Author: Julien Boibessot <[email protected]>
Date:   Fri May 20 06:57:24 2016 +0200

boot/uboot: fix missing host-openssl for i.MX28 target

Building an U-Boot image for the i.MX23 or i.MX28 target requires to run the bootloaders 'mxsimage' tool on the host. As mxsimage needs unconditionally OpenSSL, building U-Boot for those targets fails if it is not available on the host:

tools/mxsimage.c:18:25: fatal error: openssl/evp.h: No such file or directory
#include <openssl/evp.h>

Add the required dependency 'host-openssl' to all the different U-Boot image types used to build a bootloader image for an i.MX23/i.MX28 target.

Also pass HOST_CFLAGS and HOST_LDFLAGS to the U-Boot build process so the right -I/-L options will be used to find OpenSSL.

Ported from the Armadeus project:
https://sourceforge.net/p/armadeus/mailman/message/33595402/

[J?rg: port to recent Buildroot version]

The problem is easily reproducible using the following defconfig, based on "beaglebone", in which BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE was set to "2012.10":

BR2_arm=y
BR2_cortex_a8=y
BR2_DL_DIR="/store/Mirror/CT-NG-Buildroot" BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_12=y BR2_TARGET_GENERIC_HOSTNAME="beaglebone" BR2_TARGET_GENERIC_GETTY_PORT="ttyO0"
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_POST_IMAGE_SCRIPT="board/beaglebone/post-image.sh" BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="7f280334068b7c875ade51f8f3921ab311f0c824" BR2_LINUX_KERNEL_PATCH="board/beaglebone/patches/linux" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/beaglebone/linux-3.12.config" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-bone am335x-boneblack" BR2_PACKAGE_AM33X_CM3=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="am335x_evm"
BR2_TARGET_UBOOT_CUSTOM_VERSION=y BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2012.10" BR2_TARGET_UBOOT_FORMAT_IMG=y
BR2_TARGET_UBOOT_SPL=y
BR2_TARGET_UBOOT_SPL_NAME="MLO"
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y

$ make uboot BR2_JLEVEL=1
umask 0022 && make -C /work/Buildroot O=/work/bcm95615x/. uboot
Quoted 1 line
Quoted 1 line
Quoted 1 line

uboot 2012.10 Building

PATH="/work/bcm95615x/host/bin:/work/bcm95615x/host/sbin:/work/bcm95615x/host/usr/bin:/work/bcm95615x/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin" AR="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-ar" AS="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-as" LD="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-ld" NM="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-nm" CC="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-gcc" GCC="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-gcc" CPP="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-cpp" CXX="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-g++" FC="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-gfortran" RANLIB="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-ranlib" READELF="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-readelf" STRIP="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-strip" OBJCOPY="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-objcopy" OBJDUMP="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="/usr/bin/gcc" GCC_FOR_BUILD="/usr/bin/gcc" CXX_FOR_BUILD="/usr/bin/g++" LD_FOR_BUILD="/usr/bin/ld" CPPFLAGS_FOR_BUILD="-I/work/bcm95615x/host/usr/include" CFLAGS_FOR_BUILD="-O2 -I/work/bcm95615x/host/usr/include" CXXFLAGS_FOR_BUILD="-O2 -I/work/bcm95615x/host/usr/include" LDFLAGS_FOR_BUILD="-L/work/bcm95615x/host/lib -L/work/bcm95615x/host/usr/lib -Wl,-rpath,/work/bcm95615x/host/usr/lib" FCFLAGS_FOR_BUILD="" DEFAULT_ASSEMBLER="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-as" DEFAULT_LINKER="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-ld" CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os " CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os " LDFLAGS="" FCFLAGS="" PKG_CONFIG="/work/bcm95615x/host/usr/bin/pkg-config" STAGING_DIR="/work/bcm95615x/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot" INTLTOOL_PERL=/usr/bin/perl CXX=false /usr/bin/make -j1 -C /work/bcm95615x/build/uboot-2012.10 CROSS_COMPILE="/work/bcm95615x/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-" ARCH=arm HOSTCFLAGS="-O2 -I/work/bcm95615x/host/usr/include" HOSTLDFLAGS="-L/work/bcm95615x/host/lib -L/work/bcm95615x/host/usr/lib -Wl,-rpath,/work/bcm95615x/host/usr/lib" for dir in tools examples/standalone examples/api arch/arm/cpu/armv7 ; do \
/usr/bin/make -C $dir _depend ; done
make[3]: Nothing to be done for '_depend'.
make[3]: Nothing to be done for '_depend'.
make[3]: Nothing to be done for '_depend'.
make[3]: Nothing to be done for '_depend'.
/usr/bin/make -C tools all
gcc -O2 -I/work/bcm95615x/host/usr/include -o img2srec.o img2srec.c -c
In file included from img2srec.c:55:0:
os_support.h:22:22: fatal error: compiler.h: No such file or directory
compilation terminated.
/work/bcm95615x/build/uboot-2012.10/rules.mk:64: recipe for target 'img2srec.o' failed
make[3]: *** [img2srec.o] Error 1
Makefile:544: recipe for target 'tools' failed
make[2]: *** [tools] Error 2
package/pkg-generic.mk:201: recipe for target '/work/bcm95615x/build/uboot-2012.10/.stamp_built' failed
make[1]: *** [/work/bcm95615x/build/uboot-2012.10/.stamp_built] Error 2
Makefile:16: recipe for target '_all' failed
make: *** [_all] Error 2

The build succeeds if I apply the following patch, which partially reverts the aforementioned commit:

boot/uboot/uboot.mk +1 -3
index a2274ee..5d171dd 100644
@@ -92,9 +92,7 @@ endif
 
 UBOOT_MAKE_OPTS += \
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	ARCH=$(UBOOT_ARCH) \
-	HOSTCFLAGS="$(HOST_CFLAGS)" \
-	HOSTLDFLAGS="$(HOST_LDFLAGS)"
+	ARCH=$(UBOOT_ARCH)
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
 UBOOT_DEPENDENCIES += host-dtc

But this breaks the build fir the i.MX2[38] targets (freescale_imx28evk). A better workaround would be something like this:

boot/uboot/uboot.mk +7 -1
index a2274ee..5b7663d 100644
@@ -92,9 +92,15 @@ endif
 
 UBOOT_MAKE_OPTS += \
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	ARCH=$(UBOOT_ARCH) \
+	ARCH=$(UBOOT_ARCH)
+
+ifeq ($(or $(BR2_TARGET_UBOOT_FORMAT_SB),$(BR2_TARGET_UBOOT_FORMAT_SD),$(BR2_TARGET_UBOOT_FORMAT_NAND)),y)
+# Pass HOST_CFLAGS and HOST_LDFLAGS to the U-Boot build process so the right
+# -I/-L options will be used to find OpenSSL.
+UBOOT_MAKE_OPTS += \
 	HOSTCFLAGS="$(HOST_CFLAGS)" \
 	HOSTLDFLAGS="$(HOST_LDFLAGS)"
+endif
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
 UBOOT_DEPENDENCIES += host-dtc

Do you agree?

Carlos Santos (Casantos) - DATACOM, P&D
Rua Am?rica, 1000 - Eldorado do Sul, RS, Brasil - 92990-000
casantos at datacom.ind.br +55 51 3933.3000 ext. 3627
http://www.datacom.ind.br

#1 lore raw

Hello,

Quoted 4 lines · Carlos Santos

/usr/bin/make -C tools all
gcc -O2 -I/work/bcm95615x/host/usr/include -o img2srec.o img2srec.c -c
In file included from img2srec.c:55:0:
os_support.h:22:22: fatal error: compiler.h: No such file or directory

What is your host gcc version ? This failure smells like building an old U-Boot, with gcc 5.x as the host gcc version.

boot/uboot/uboot.mk endif · line 97

Quoted 11 lines
boot/uboot/uboot.mk +0 -3
index a2274ee..5d171dd 100644
@@ -92,9 +92,7 @@ endif
 
 UBOOT_MAKE_OPTS += \
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	ARCH=$(UBOOT_ARCH) \
-	HOSTCFLAGS="$(HOST_CFLAGS)" \
-	HOSTLDFLAGS="$(HOST_LDFLAGS)"

I'm not sure to see why this would fix the problem you're reporting.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw
Quoted 10 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: "buildroot" <[email protected]>, "Julien Boibessot" <[email protected]>
Sent: Friday, July 1, 2016 10:18:04 AM
Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05

Hello,

On Fri, 1 Jul 2016 10:10:48 -0300 (BRT), Carlos Santos wrote:

Quoted 7 lines
Quoted 4 lines

/usr/bin/make -C tools all
gcc -O2 -I/work/bcm95615x/host/usr/include -o img2srec.o img2srec.c -c
In file included from img2srec.c:55:0:
os_support.h:22:22: fatal error: compiler.h: No such file or directory

What is your host gcc version ? This failure smells like building an old U-Boot, with gcc 5.x as the host gcc version.

The problem happens on CentOS 7 (GCC 4.8.3) and Ubuntu 16.04 (GCC 5.3.1).

Quoted 6 lines
Quoted 6 lines
boot/uboot/uboot.mk +0 -0
index a2274ee..5d171dd 100644
@@ -92,9 +92,7 @@ endif
 
Quoted 7 lines

boot/uboot/uboot.mk endif · line 97

Quoted 5 lines
boot/uboot/uboot.mk +0 -3
 UBOOT_MAKE_OPTS += \
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	ARCH=$(UBOOT_ARCH) \
-	HOSTCFLAGS="$(HOST_CFLAGS)" \
-	HOSTLDFLAGS="$(HOST_LDFLAGS)"

I'm not sure to see why this would fix the problem you're reporting.

It prevents overriding HOSTCFLAGS and HOSTLDFLAGS on targets that don't need OpenSSL, so older versions of U-Boot will compile successfully.

Carlos Santos (Casantos)
DATACOM, P&D

#3 lore raw

Hello,

Quoted 4 lines · Carlos Santos
Quoted 2 lines

What is your host gcc version ? This failure smells like building an old U-Boot, with gcc 5.x as the host gcc version.

The problem happens on CentOS 7 (GCC 4.8.3) and Ubuntu 16.04 (GCC 5.3.1).

I think the failure with GCC 5.3.x is normal, but I don't understand why it would fail with gcc 4.8.

Quoted 9 lines
Quoted 7 lines

boot/uboot/uboot.mk endif · line 97

Quoted 5 lines

UBOOT_MAKE_OPTS += \

boot/uboot/uboot.mk +0 -3
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	ARCH=$(UBOOT_ARCH) \
-	HOSTCFLAGS="$(HOST_CFLAGS)" \
-	HOSTLDFLAGS="$(HOST_LDFLAGS)"  

I'm not sure to see why this would fix the problem you're reporting.

It prevents overriding HOSTCFLAGS and HOSTLDFLAGS on targets that don't need OpenSSL, so older versions of U-Boot will compile successfully.

Yes, but I don't understand why not setting HOSTCFLAGS/HOSTLDFLAGS fixes the build issue you mentioned.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw
Quoted 26 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: "buildroot" <[email protected]>, "Julien Boibessot" <[email protected]>
Sent: Friday, July 1, 2016 11:15:56 AM
Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05

Hello,

Quoted 4 lines · Carlos Santos
Quoted 2 lines

What is your host gcc version ? This failure smells like building an old U-Boot, with gcc 5.x as the host gcc version.

The problem happens on CentOS 7 (GCC 4.8.3) and Ubuntu 16.04 (GCC 5.3.1).

I think the failure with GCC 5.3.x is normal, but I don't understand why it would fail with gcc 4.8.

Quoted 8 lines
Quoted 7 lines

boot/uboot/uboot.mk endif · line 97

Quoted 5 lines

UBOOT_MAKE_OPTS += \

boot/uboot/uboot.mk +0 -3
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	ARCH=$(UBOOT_ARCH) \
-	HOSTCFLAGS="$(HOST_CFLAGS)" \
-	HOSTLDFLAGS="$(HOST_LDFLAGS)"

I'm not sure to see why this would fix the problem you're reporting.

Quoted 6 lines
Quoted 2 lines

It prevents overriding HOSTCFLAGS and HOSTLDFLAGS on targets that don't need OpenSSL, so older versions of U-Boot will compile successfully.

Yes, but I don't understand why not setting HOSTCFLAGS/HOSTLDFLAGS fixes the build issue you mentioned.

Without setting HOSTCFLAGS/HOSTLDFLAGS the command line is this

gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /work/bcm95615x/build/uboot-2012.10/include -idirafter /work/bcm95615x/build/uboot-2012.10/include2 -idirafter /work/bcm95615x/build/uboot-2012.10/include -I /work/bcm95615x/build/uboot-2012.10/lib/libfdt -I /work/bcm95615x/build/uboot-2012.10/tools -DCONFIG_SYS_TEXT_BASE=0x80800000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic -o img2srec.o img2srec.c -c

Setting HOSTCFLAGS/HOSTLDFLAGS the command line becomes

gcc -O2 -I/work/bcm95615x/host/usr/include -o img2srec.o img2srec.c -c

Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten.

Carlos Santos (Casantos)
DATACOM, P&D

#5 lore raw
In reply to Carlos Santos
Quoted 35 lines · Carlos Santos
Quoted 26 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: "buildroot" <[email protected]>, "Julien Boibessot" <[email protected]>
Sent: Friday, July 1, 2016 11:15:56 AM
Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05

Hello,

Quoted 4 lines · Carlos Santos
Quoted 2 lines

What is your host gcc version ? This failure smells like building an old U-Boot, with gcc 5.x as the host gcc version.

The problem happens on CentOS 7 (GCC 4.8.3) and Ubuntu 16.04 (GCC 5.3.1).

I think the failure with GCC 5.3.x is normal, but I don't understand why it would fail with gcc 4.8.

Quoted 8 lines
Quoted 7 lines

boot/uboot/uboot.mk endif · line 97

Quoted 5 lines

UBOOT_MAKE_OPTS += \

boot/uboot/uboot.mk +0 -3
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	ARCH=$(UBOOT_ARCH) \
-	HOSTCFLAGS="$(HOST_CFLAGS)" \
-	HOSTLDFLAGS="$(HOST_LDFLAGS)"

I'm not sure to see why this would fix the problem you're reporting.

Quoted 6 lines
Quoted 2 lines

It prevents overriding HOSTCFLAGS and HOSTLDFLAGS on targets that don't need OpenSSL, so older versions of U-Boot will compile successfully.

Yes, but I don't understand why not setting HOSTCFLAGS/HOSTLDFLAGS fixes the build issue you mentioned.

Without setting HOSTCFLAGS/HOSTLDFLAGS the command line is this

Quoted 7 lines

gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /work/bcm95615x/build/uboot-2012.10/include -idirafter /work/bcm95615x/build/uboot-2012.10/include2 -idirafter /work/bcm95615x/build/uboot-2012.10/include -I /work/bcm95615x/build/uboot-2012.10/lib/libfdt -I /work/bcm95615x/build/uboot-2012.10/tools -DCONFIG_SYS_TEXT_BASE=0x80800000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic -o img2srec.o img2srec.c -c

Setting HOSTCFLAGS/HOSTLDFLAGS the command line becomes

gcc -O2 -I/work/bcm95615x/host/usr/include -o img2srec.o img2srec.c -c

Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten.

How about leaving HOSTCFLAGS alone, and instead setting
HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#6 lore raw

Hello,

Quoted 4 lines · Arnout Vandecappelle
Quoted 1 line

Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten.

How about leaving HOSTCFLAGS alone, and instead setting
HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden.

Good point, that's possibly an alternate solution. I sent a patch implementing a different solution, but Carlos, if you can try Arnout's suggestion, it would be good.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw
Quoted 11 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Arnout Vandecappelle" <[email protected]>
Cc: "Carlos Santos" <[email protected]>, "Julien Boibessot" <[email protected]>, "buildroot" <[email protected]>
Sent: Saturday, July 2, 2016 7:56:25 AM
Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05

Hello,

On Sat, 2 Jul 2016 12:47:14 +0200, Arnout Vandecappelle wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten.

How about leaving HOSTCFLAGS alone, and instead setting
HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden.

Good point, that's possibly an alternate solution. I sent a patch implementing a different solution, but Carlos, if you can try Arnout's suggestion, it would be good.

Yes, it works, but this reminds me that HOSTCC is not passed when building buildroot, so the command line for version 2015.01 becomes

cc -Wp,-MD,tools/.img2srec.d -O2 -I/work/freescale_imx28evk/host/usr/include -include ./include/libfdt_env.h -idirafterinclude -idirafter./arch/arm/include -I./lib/libfdt -I./tools -DCONFIG_SYS_TEXT_BASE=0x40002000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE -pedantic -o tools/img2srec tools/img2srec.c

This may not be a problem now but I believe that HOSTCC should always be provided.

Carlos Santos (Casantos)
DATACOM, P&D

#8 lore raw

Hi Carlos,

Quoted 20 lines · Carlos Santos
Quoted 11 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Arnout Vandecappelle" <[email protected]>
Cc: "Carlos Santos" <[email protected]>, "Julien Boibessot" <[email protected]>, "buildroot" <[email protected]>
Sent: Saturday, July 2, 2016 7:56:25 AM
Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05

Hello,

On Sat, 2 Jul 2016 12:47:14 +0200, Arnout Vandecappelle wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten.

How about leaving HOSTCFLAGS alone, and instead setting
HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden.

Good point, that's possibly an alternate solution. I sent a patch implementing a different solution, but Carlos, if you can try Arnout's suggestion, it would be good.

Quoted 5 lines

Yes, it works, but this reminds me that HOSTCC is not passed when building buildroot, so the command line for version 2015.01 becomes

cc -Wp,-MD,tools/.img2srec.d -O2 -I/work/freescale_imx28evk/host/usr/include -include ./include/libfdt_env.h -idirafterinclude -idirafter./arch/arm/include -I./lib/libfdt -I./tools -DCONFIG_SYS_TEXT_BASE=0x40002000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE -pedantic -o tools/img2srec tools/img2srec.c

This may not be a problem now but I believe that HOSTCC should always be provided.

Care to prepare a patch then that replaces HOSTCFLAGS by HOSTCC?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#9 lore raw
Quoted 39 lines

From: "Arnout Vandecappelle" <[email protected]>
To: "Carlos Santos" <[email protected]>, "Thomas Petazzoni" <[email protected]>
Cc: "Julien Boibessot" <[email protected]>, "buildroot" <[email protected]>
Sent: Monday, July 4, 2016 6:26:09 AM
Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05

Hi Carlos,

Quoted 30 lines · Carlos Santos
Quoted 12 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Arnout Vandecappelle" <[email protected]>
Cc: "Carlos Santos" <[email protected]>, "Julien Boibessot" <[email protected]>, "buildroot" <[email protected]>
Sent: Saturday, July 2, 2016 7:56:25 AM
Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05

Hello,

On Sat, 2 Jul 2016 12:47:14 +0200, Arnout Vandecappelle wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten.

How about leaving HOSTCFLAGS alone, and instead setting
HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden.

Good point, that's possibly an alternate solution. I sent a patch implementing a different solution, but Carlos, if you can try Arnout's suggestion, it would be good.

Yes, it works, but this reminds me that HOSTCC is not passed when building buildroot, so the command line for version 2015.01 becomes

cc -Wp,-MD,tools/.img2srec.d -O2 -I/work/freescale_imx28evk/host/usr/include

(quoted diff) +0 -4
-include ./include/libfdt_env.h -idirafterinclude
-idirafter./arch/arm/include -I./lib/libfdt -I./tools
-DCONFIG_SYS_TEXT_BASE=0x40002000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES
-D_GNU_SOURCE -pedantic -o tools/img2srec tools/img2srec.c
Quoted 5 lines
Quoted 2 lines

This may not be a problem now but I believe that HOSTCC should always be provided.

Care to prepare a patch then that replaces HOSTCFLAGS by HOSTCC?

Thomas already submitted a patch: http://patchwork.ozlabs.org/patch/643426/

Carlos Santos (Casantos)
DATACOM, P&D

#10 lore raw
Quoted 39 lines · Carlos Santos
Quoted 39 lines

From: "Arnout Vandecappelle" <[email protected]>
To: "Carlos Santos" <[email protected]>, "Thomas Petazzoni" <[email protected]>
Cc: "Julien Boibessot" <[email protected]>, "buildroot" <[email protected]>
Sent: Monday, July 4, 2016 6:26:09 AM
Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05

Hi Carlos,

Quoted 30 lines · Carlos Santos
Quoted 12 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Arnout Vandecappelle" <[email protected]>
Cc: "Carlos Santos" <[email protected]>, "Julien Boibessot" <[email protected]>, "buildroot" <[email protected]>
Sent: Saturday, July 2, 2016 7:56:25 AM
Subject: Re: [Buildroot] Unable to compile uboot v2012.10 on Buildroot 2016.05

Hello,

On Sat, 2 Jul 2016 12:47:14 +0200, Arnout Vandecappelle wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Because the value of HOSTCFLAGS set in U-Boot's config.mk is overwritten.

How about leaving HOSTCFLAGS alone, and instead setting
HOSTCC="$(HOSTCC) $(HOST_CFLAGS)". HOSTLDFLAGS can probably be overridden.

Good point, that's possibly an alternate solution. I sent a patch implementing a different solution, but Carlos, if you can try Arnout's suggestion, it would be good.

Yes, it works, but this reminds me that HOSTCC is not passed when building buildroot, so the command line for version 2015.01 becomes

cc -Wp,-MD,tools/.img2srec.d -O2 -I/work/freescale_imx28evk/host/usr/include

(quoted diff) +0 -4
-include ./include/libfdt_env.h -idirafterinclude
-idirafter./arch/arm/include -I./lib/libfdt -I./tools
-DCONFIG_SYS_TEXT_BASE=0x40002000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES
-D_GNU_SOURCE -pedantic -o tools/img2srec tools/img2srec.c
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

This may not be a problem now but I believe that HOSTCC should always be provided.

Care to prepare a patch then that replaces HOSTCFLAGS by HOSTCC?

Thomas already submitted a patch: http://patchwork.ozlabs.org/patch/643426/

Yes, but Thomas's patch still sets HOSTCFLAGS. My question was: do you care to
submit an alternative (better) patch that sets HOSTCC (unconditionally) rather than changing HOSTCFLAGS?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF