Openembedded Core Discussions
 help / color / mirror / Atom feed
* [RFC][PATCH] u-boot-mkimage: allow building target version of the tool
@ 2014-11-07 22:24 Denys Dmytriyenko
  2014-11-08 19:12 ` Otavio Salvador
  0 siblings, 1 reply; 4+ messages in thread
From: Denys Dmytriyenko @ 2014-11-07 22:24 UTC (permalink / raw)
  To: openembedded-core; +Cc: Denys Dmytriyenko

From: Denys Dmytriyenko <denys@ti.com>

u-boot doesn't really support building its tools for the target, as they are
built with HOSTCC compiler, which is also used to compile fixdep utility
that gets executed during the build. Since it might be beneficial to have a
target version of mkimage, let's hack it to build fixdep in a separate step.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
 meta/recipes-bsp/u-boot/u-boot-mkimage_2014.07.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-bsp/u-boot/u-boot-mkimage_2014.07.bb b/meta/recipes-bsp/u-boot/u-boot-mkimage_2014.07.bb
index 7c05215..eabf680 100644
--- a/meta/recipes-bsp/u-boot/u-boot-mkimage_2014.07.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-mkimage_2014.07.bb
@@ -20,6 +20,8 @@ do_compile () {
 	# Make sure the recompile is OK
 	rm -f ${B}/tools/.depend
 
+	make HOSTCC="${BUILD_CC}" HOSTLD="${BUILD_LD}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTSTRIP=true dot-config=0 scripts_basic
+	sed 's/^tools-only: scripts_basic /tools-only: /' -i Makefile
 	oe_runmake tools-only
 }
 
-- 
2.1.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH] u-boot-mkimage: allow building target version of the tool
  2014-11-07 22:24 [RFC][PATCH] u-boot-mkimage: allow building target version of the tool Denys Dmytriyenko
@ 2014-11-08 19:12 ` Otavio Salvador
  2014-11-09  7:51   ` Denys Dmytriyenko
  0 siblings, 1 reply; 4+ messages in thread
From: Otavio Salvador @ 2014-11-08 19:12 UTC (permalink / raw)
  To: Denys Dmytriyenko
  Cc: Denys Dmytriyenko,
	Patches and discussions about the oe-core layer

On Fri, Nov 7, 2014 at 8:24 PM, Denys Dmytriyenko <denis@denix.org> wrote:
> From: Denys Dmytriyenko <denys@ti.com>
>
> u-boot doesn't really support building its tools for the target, as they are
> built with HOSTCC compiler, which is also used to compile fixdep utility
> that gets executed during the build. Since it might be beneficial to have a
> target version of mkimage, let's hack it to build fixdep in a separate step.
>
> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
...
> +       make HOSTCC="${BUILD_CC}" HOSTLD="${BUILD_LD}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTSTRIP=true dot-config=0 scripts_basic
...

We do it in meta-fsl-arm as below:

ESCRIPTION = "U-boot bootloader mxsboot tool"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=c7383a594871c03da76b3707929d2919"
SECTION = "bootloader"
DEPENDS = "openssl"
PROVIDES = "u-boot-mxsboot"

PV = "v2014.10+git${SRCPV}"

SRCREV = "75ce95e627609c9b9e537e935e69c4ecef26c8f7"
SRCBRANCH = "patches-2014.10"
SRC_URI = "git://github.com/Freescale/u-boot-imx.git;branch=${SRCBRANCH}"

S = "${WORKDIR}/git"

inherit fsl-u-boot-localversion

EXTRA_OEMAKE = 'HOSTCC="${CC} ${CPPFLAGS}" HOSTLDFLAGS="-L${libdir}
-L${base_libdir}" HOSTSTRIP=true CONFIG_MX28=y'

do_configure () {
    oe_runmake sandbox_defconfig
}

do_compile () {
    oe_runmake tools-only
}

do_install () {
    install -d ${D}${bindir}
    install -m 0755 tools/mxsboot ${D}${bindir}/uboot-mxsboot
    ln -sf uboot-mxsboot ${D}${bindir}/mxsboot
}

BBCLASSEXTEND = "native nativesdk"


-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH] u-boot-mkimage: allow building target version of the tool
  2014-11-08 19:12 ` Otavio Salvador
@ 2014-11-09  7:51   ` Denys Dmytriyenko
  2014-11-09 13:11     ` Koen Kooi
  0 siblings, 1 reply; 4+ messages in thread
From: Denys Dmytriyenko @ 2014-11-09  7:51 UTC (permalink / raw)
  To: Otavio Salvador
  Cc: Denys Dmytriyenko,
	Patches and discussions about the oe-core layer

On Sat, Nov 08, 2014 at 05:12:36PM -0200, Otavio Salvador wrote:
> On Fri, Nov 7, 2014 at 8:24 PM, Denys Dmytriyenko <denis@denix.org> wrote:
> > From: Denys Dmytriyenko <denys@ti.com>
> >
> > u-boot doesn't really support building its tools for the target, as they are
> > built with HOSTCC compiler, which is also used to compile fixdep utility
> > that gets executed during the build. Since it might be beneficial to have a
> > target version of mkimage, let's hack it to build fixdep in a separate step.
> >
> > Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> ...
> > +       make HOSTCC="${BUILD_CC}" HOSTLD="${BUILD_LD}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTSTRIP=true dot-config=0 scripts_basic
> ...
> 
> We do it in meta-fsl-arm as below:

That still doesn't work when building tools for the target:
/bin/sh: scripts/basic/fixdep: cannot execute binary file: Exec format error

I guess you are missing the point of this patch, as sandbox_defconfig will 
only eliminate dot-config=0 parameter, but not the need to build fixdep 
separately with a different host compiler...

On the other hand - is it a real requirement to build mkimage for the target?


> ESCRIPTION = "U-boot bootloader mxsboot tool"
> LICENSE = "GPLv2+"
> LIC_FILES_CHKSUM = "file://Licenses/README;md5=c7383a594871c03da76b3707929d2919"
> SECTION = "bootloader"
> DEPENDS = "openssl"
> PROVIDES = "u-boot-mxsboot"
> 
> PV = "v2014.10+git${SRCPV}"
> 
> SRCREV = "75ce95e627609c9b9e537e935e69c4ecef26c8f7"
> SRCBRANCH = "patches-2014.10"
> SRC_URI = "git://github.com/Freescale/u-boot-imx.git;branch=${SRCBRANCH}"
> 
> S = "${WORKDIR}/git"
> 
> inherit fsl-u-boot-localversion
> 
> EXTRA_OEMAKE = 'HOSTCC="${CC} ${CPPFLAGS}" HOSTLDFLAGS="-L${libdir}
> -L${base_libdir}" HOSTSTRIP=true CONFIG_MX28=y'
> 
> do_configure () {
>     oe_runmake sandbox_defconfig
> }
> 
> do_compile () {
>     oe_runmake tools-only
> }
> 
> do_install () {
>     install -d ${D}${bindir}
>     install -m 0755 tools/mxsboot ${D}${bindir}/uboot-mxsboot
>     ln -sf uboot-mxsboot ${D}${bindir}/mxsboot
> }
> 
> BBCLASSEXTEND = "native nativesdk"
> 
> 
> -- 
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH] u-boot-mkimage: allow building target version of the tool
  2014-11-09  7:51   ` Denys Dmytriyenko
@ 2014-11-09 13:11     ` Koen Kooi
  0 siblings, 0 replies; 4+ messages in thread
From: Koen Kooi @ 2014-11-09 13:11 UTC (permalink / raw)
  To: Denys Dmytriyenko
  Cc: Patches and discussions about the oe-core layer, Otavio Salvador,
	Denys Dmytriyenko


> Op 9 nov. 2014, om 08:51 heeft Denys Dmytriyenko <denis@denix.org> het volgende geschreven:
> 
> On Sat, Nov 08, 2014 at 05:12:36PM -0200, Otavio Salvador wrote:
>> On Fri, Nov 7, 2014 at 8:24 PM, Denys Dmytriyenko <denis@denix.org> wrote:
>>> From: Denys Dmytriyenko <denys@ti.com>
>>> 
>>> u-boot doesn't really support building its tools for the target, as they are
>>> built with HOSTCC compiler, which is also used to compile fixdep utility
>>> that gets executed during the build. Since it might be beneficial to have a
>>> target version of mkimage, let's hack it to build fixdep in a separate step.
>>> 
>>> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
>> ...
>>> +       make HOSTCC="${BUILD_CC}" HOSTLD="${BUILD_LD}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTSTRIP=true dot-config=0 scripts_basic
>> ...
>> 
>> We do it in meta-fsl-arm as below:
> 
> That still doesn't work when building tools for the target:
> /bin/sh: scripts/basic/fixdep: cannot execute binary file: Exec format error
> 
> I guess you are missing the point of this patch, as sandbox_defconfig will 
> only eliminate dot-config=0 parameter, but not the need to build fixdep 
> separately with a different host compiler...
> 
> On the other hand - is it a real requirement to build mkimage for the target?

I use it a lot when regenerating initramfses on the target.

regards,

Koen

> 
> 
>> ESCRIPTION = "U-boot bootloader mxsboot tool"
>> LICENSE = "GPLv2+"
>> LIC_FILES_CHKSUM = "file://Licenses/README;md5=c7383a594871c03da76b3707929d2919"
>> SECTION = "bootloader"
>> DEPENDS = "openssl"
>> PROVIDES = "u-boot-mxsboot"
>> 
>> PV = "v2014.10+git${SRCPV}"
>> 
>> SRCREV = "75ce95e627609c9b9e537e935e69c4ecef26c8f7"
>> SRCBRANCH = "patches-2014.10"
>> SRC_URI = "git://github.com/Freescale/u-boot-imx.git;branch=${SRCBRANCH}"
>> 
>> S = "${WORKDIR}/git"
>> 
>> inherit fsl-u-boot-localversion
>> 
>> EXTRA_OEMAKE = 'HOSTCC="${CC} ${CPPFLAGS}" HOSTLDFLAGS="-L${libdir}
>> -L${base_libdir}" HOSTSTRIP=true CONFIG_MX28=y'
>> 
>> do_configure () {
>>    oe_runmake sandbox_defconfig
>> }
>> 
>> do_compile () {
>>    oe_runmake tools-only
>> }
>> 
>> do_install () {
>>    install -d ${D}${bindir}
>>    install -m 0755 tools/mxsboot ${D}${bindir}/uboot-mxsboot
>>    ln -sf uboot-mxsboot ${D}${bindir}/mxsboot
>> }
>> 
>> BBCLASSEXTEND = "native nativesdk"
>> 
>> 
>> -- 
>> Otavio Salvador                             O.S. Systems
>> http://www.ossystems.com.br        http://code.ossystems.com.br
>> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
>> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-09 13:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07 22:24 [RFC][PATCH] u-boot-mkimage: allow building target version of the tool Denys Dmytriyenko
2014-11-08 19:12 ` Otavio Salvador
2014-11-09  7:51   ` Denys Dmytriyenko
2014-11-09 13:11     ` Koen Kooi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox