Skip to contentSkip to conversation

u-boot: mkimage: Fix build of u-boot-mkimage

PATCH In review Marek Vasut 5 participants 13 messages Nov 7, 2016 – Nov 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 u-boot: mkimage: Fix build of u-boot-mkimage

The build failed on qemux86-64 because it couldn't execute tools/bin2header on a host due to it being compiled with target toolchain. Drop the incorrect EXTRA_OEMAKE, U-Boot Kbuild/Kconfig respects the flags from OE. Moreover, since U-Boot buildsystem already strips the tools, add INSANE_SKIP = "already-stripped" .

---
 meta/recipes-bsp/u-boot/u-boot-mkimage_2016.09.01.bb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
meta/recipes-bsp/u-boot/u-boot-mkimage_2016.09.01.bb +10 -1
index 5025961..8adc1e6 100644
@@ -3,10 +3,19 @@ require u-boot-common_${PV}.inc
 SUMMARY = "U-Boot bootloader image creation tool"
 DEPENDS = "openssl"
 
-EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
+EXTRA_OEMAKE_append_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE_append_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE_append_class-nativesdk = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
 
 do_compile () {
 	oe_runmake sandbox_defconfig
+
+	# Disable CONFIG_CMD_LICENSE, license.h is not used by tools and
+	# generating it requires bin2header tool, which for target build
+	# is built with target tools and thus cannot be executed on host.
+	sed -i "s/CONFIG_CMD_LICENSE.*/# CONFIG_CMD_LICENSE is not set/" .config
+
 	oe_runmake cross_tools NO_SDL=1
 }
 
Signature · 1 line
2.9.3
#1 lore raw
Quoted 6 lines · Marek Vasut
meta/recipes-bsp/u-boot/u-boot-mkimage_2016.09.01.bb +4 -0
+       # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and
+       # generating it requires bin2header tool, which for target build
+       # is built with target tools and thus cannot be executed on host.
+       sed -i "s/CONFIG_CMD_LICENSE.*/# CONFIG_CMD_LICENSE is not set/"

.config

Looking at the makefile this isn't the case - it's part of hostprogs so if anyone of the host-built tools work, they all should.

Ross

#2 lore raw
Quoted 3 lines · Ross

Looking at the makefile this isn't the case - it's part of hostprogs so if anyone of the host-built tools work, they all should.

Just verified that the HOSTCC changes in this patch make it work for me even after removing the sed. Can you send a revision?

Also the u-boot series went through a number of revisions, can you verify that the patches in poky-contrib:ross/mut match what you expect to see?

Thanks,
Ross

#3 lore raw
Quoted 10 lines · Ross

On 7 November 2016 at 20:15, Burton, Ross <[email protected] <mailto:[email protected]>> wrote:

Looking at the makefile this isn't the case - it's part of hostprogs so if anyone of the host-built tools work, they all should.

Just verified that the HOSTCC changes in this patch make it work for me even after removing the sed. Can you send a revision?

It cannot work without the sed, try building for target. Then the bin2header is built for target.

Quoted 3 lines

Also the u-boot series went through a number of revisions, can you verify that the patches in poky-contrib:ross/mut match what you expect to see?

Do you have a link for me ?

Signature · 2 lines
Best regards,
Marek Vasut
#5 lore raw
Quoted 8 lines · Ross
Quoted 3 lines · On 12 November 2016 at 18:31, Marek Vasut <[email protected]…

Also the u-boot series went through a number of revisions, can you verify that the patches in poky-contrib:ross/mut match what you expect to see?

Quoted 6 lines

Do you have a link for me ?

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=ross/mut-broken&id=4f6dbc99950da645dc4d0e23e0065ff8245a0e74

As the cleanups didn't really make sense standalone, I squashed the lot.

I prefer to keep the history, but OK. It looks like what I'd expect there.

Signature · 2 lines
Best regards,
Marek Vasut
#6 lore raw
In reply to Marek Vasut
Quoted 6 lines · Marek Vasut

The build failed on qemux86-64 because it couldn't execute tools/bin2header on a host due to it being compiled with target toolchain. Drop the incorrect EXTRA_OEMAKE, U-Boot Kbuild/Kconfig respects the flags from OE. Moreover, since U-Boot buildsystem already strips the tools, add INSANE_SKIP = "already-stripped" .

The INSANE_SKIP mentioned here is no longer included in the patch.

Quoted 45 lines
Cc Ross Burton <[email protected]>
---
 meta/recipes-bsp/u-boot/u-boot-mkimage_2016.09.01.bb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
meta/recipes-bsp/u-boot/u-boot-mkimage_2016.09.01.bb +0 -1
index 5025961..8adc1e6 100644
@@ -3,10 +3,19 @@ require u-boot-common_${PV}.inc
 SUMMARY = "U-Boot bootloader image creation tool"
 DEPENDS = "openssl"
 
-EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS}

${LDFLAGS}" STRIP=true V=1'

meta/recipes-bsp/u-boot/u-boot-mkimage_2016.09.01.bb +2 -0
+EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
+EXTRA_OEMAKE_append_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}"

CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1' +EXTRA_OEMAKE_append_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' +EXTRA_OEMAKE_append_class-nativesdk = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'

do_compile () {
oe_runmake sandbox_defconfig

meta/recipes-bsp/u-boot/u-boot-mkimage_2016.09.01.bb +5 -0
+
+       # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and
+       # generating it requires bin2header tool, which for target build
+       # is built with target tools and thus cannot be executed on host.
+       sed -i "s/CONFIG_CMD_LICENSE.*/# CONFIG_CMD_LICENSE is not set/"

.config
+
oe_runmake cross_tools NO_SDL=1
}

--
2.9.3

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#7 lore raw
Quoted 11 lines · Jussi Kukkonen

On 7 November 2016 at 20:20, Marek Vasut <[email protected] <mailto:[email protected]>> wrote:

The build failed on qemux86-64 because it couldn't execute tools/bin2header on a host due to it being compiled with target toolchain. Drop the incorrect EXTRA_OEMAKE, U-Boot Kbuild/Kconfig respects the flags from OE. Moreover, since U-Boot buildsystem already strips the tools, add INSANE_SKIP = "already-stripped" .

The INSANE_SKIP mentioned here is no longer included in the patch.

I just noticed that too that I forgot to update the commit message altogether.

Signature · 2 lines
Best regards,
Marek Vasut
#8 lore raw
In reply to Marek Vasut
Quoted 10 lines · Marek Vasut

-EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'

(quoted diff) +2 -0
+EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
+EXTRA_OEMAKE_append_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}"

CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1' +EXTRA_OEMAKE_append_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' +EXTRA_OEMAKE_append_class-nativesdk = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'

You're going to start hating u-boot...

Fails on the autobuilder if you're building for a 32-bit x86 target on a 64-bit x86 host:

ERROR: QA Issue: Architecture did not match (x86-64, expected x86) on /work/i586-poky-linux-musl/u-boot-mkimage/1_2016.09.01-r0/packages-split/u-boot-mkimage/usr/bin/uboot-mkimage [arch]

I'm guessing that it is using the host compiler instead of the cross compiler.

Ross

#9 lore raw
Quoted 17 lines · Ross

On 7 November 2016 at 18:20, Marek Vasut <[email protected] <mailto:[email protected]>> wrote:

    -EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS}
    ${LDFLAGS}" STRIP=true V=1'
    +EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
    +EXTRA_OEMAKE_append_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}"
    CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
    +EXTRA_OEMAKE_append_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS}
    ${BUILD_LDFLAGS}" STRIP=true V=1'
    +EXTRA_OEMAKE_append_class-nativesdk = 'CC="${BUILD_CC} ${BUILD_CFLAGS}
    ${BUILD_LDFLAGS}" STRIP=true V=1'

You're going to start hating u-boot...

Quoted 8 lines

Fails on the autobuilder if you're building for a 32-bit x86 target on a 64-bit x86 host:

ERROR: QA Issue: Architecture did not match (x86-64, expected x86) on /work/i586-poky-linux-musl/u-boot-mkimage/1_2016.09.01-r0/packages-split/u-boot-mkimage/usr/bin/uboot-mkimage [arch]

I'm guessing that it is using the host compiler instead of the cross compiler.

isnt mkimage a host tool ? why are we building it for target ?

Quoted 4 lines

Ross

#10 lore raw
Quoted 5 lines · Khem Raj
Quoted 1 line

I'm guessing that it is using the host compiler instead of the cross

compiler.

isnt mkimage a host tool ? why are we building it for target ?

If there's no chance that it will be ran on the target for in a SDK then patches welcome to force the recipe to native only.

The recipe is using _append without adding whitespace, but fixing that doesn't fix the build.

Ross

#11 lore raw
Quoted 11 lines · Ross
Quoted 1 line · On 9 November 2016 at 00:43, Khem Raj <[email protected]…

I'm guessing that it is using the host compiler instead of the cross compiler.

isnt mkimage a host tool ? why are we building it for target ?

If there's no chance that it will be ran on the target for in a SDK then patches welcome to force the recipe to native only.

The recipe is using _append without adding whitespace, but fixing that doesn't fix the build.

I routinely build and use it on my targets, so no, it's not host only.

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#12 lore raw
In reply to Burton, Ross
Quoted 21 lines · Ross

On 7 November 2016 at 18:20, Marek Vasut <[email protected] <mailto:[email protected]>> wrote:

    -EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC}
    ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
    +EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
    +EXTRA_OEMAKE_append_class-target =
    'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}"
    STRIP=true V=1'
    +EXTRA_OEMAKE_append_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS}
    ${BUILD_LDFLAGS}" STRIP=true V=1'
    +EXTRA_OEMAKE_append_class-nativesdk = 'CC="${BUILD_CC}
    ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'

You're going to start hating u-boot...

Fails on the autobuilder if you're building for a 32-bit x86 target on a 64-bit x86 host:

Quoted 6 lines

ERROR: QA Issue: Architecture did not match (x86-64, expected x86) on /work/i586-poky-linux-musl/u-boot-mkimage/1_2016.09.01-r0/packages-split/u-boot-mkimage/usr/bin/uboot-mkimage [arch]

I'm guessing that it is using the host compiler instead of the cross compiler.

I should have a fix for it all I hope.

Signature · 2 lines
Best regards,
Marek Vasut