mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Compiling barebox for newest Yocto/meta-freescale
@ 2015-06-22 15:18 György Kövesdi
  2015-06-23  8:12 ` Jan Lübbe
  0 siblings, 1 reply; 13+ messages in thread
From: György Kövesdi @ 2015-06-22 15:18 UTC (permalink / raw)
  To: barebox

Hi,

I have a i.MX6 based board and want to compile barebox using Yocto.
It was successful so far, but something is changed in the gcc behaviour.
The first thing is that some arch-specific parameters must be passed, or 
else the compilation fails. I could fix it, but there is another problem.
The option "-mfloat-abi=soft" is used in barebox compilation, which 
seems not supported by gcc. Adding "-mfloat-abi=hard" is not enough, the 
original "-mfloat-abi=soft" should be removed. Unfortunately, i could 
not find where this option is added and how to remove it.
Can anybody help me to fix it?

Thanx in advance
Gyorgy Kovesdi


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-22 15:18 Compiling barebox for newest Yocto/meta-freescale György Kövesdi
@ 2015-06-23  8:12 ` Jan Lübbe
  2015-06-23 11:29   ` György Kövesdi
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Lübbe @ 2015-06-23  8:12 UTC (permalink / raw)
  To: barebox

Hi,

On Mo, 2015-06-22 at 17:18 +0200, György Kövesdi wrote:
> I have a i.MX6 based board and want to compile barebox using Yocto.
> It was successful so far, but something is changed in the gcc behaviour.
> The first thing is that some arch-specific parameters must be passed, or 
> else the compilation fails. I could fix it, but there is another problem.

I had to change
-       oe_runmake
+       oe_runmake CC="$CC"
for recent yocto versions. What was your fix?

> The option "-mfloat-abi=soft" is used in barebox compilation, which 
> seems not supported by gcc. Adding "-mfloat-abi=hard" is not enough, the 
> original "-mfloat-abi=soft" should be removed. Unfortunately, i could 
> not find where this option is added and how to remove it.
> Can anybody help me to fix it?

Which yocto and gcc version are you using? Could you show us the actual
error messages and yocto recipe?

Regards,
Jan
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-23  8:12 ` Jan Lübbe
@ 2015-06-23 11:29   ` György Kövesdi
  2015-06-23 12:22     ` Holger Schurig
  0 siblings, 1 reply; 13+ messages in thread
From: György Kövesdi @ 2015-06-23 11:29 UTC (permalink / raw)
  To: barebox

Hi Jan,

> I had to change
> -       oe_runmake
> +       oe_runmake CC="$CC"
> for recent yocto versions. What was your fix?
My fix was more complicated, by exporting ${TOOLCHAIN_OPTIONS} and 
${HOST_CC_ARCH}. Thanks for this simpler solution.
>> The option "-mfloat-abi=soft" is used in barebox compilation, which
>> seems not supported by gcc. Adding "-mfloat-abi=hard" is not enough, the
>> original "-mfloat-abi=soft" should be removed. Unfortunately, i could
>> not find where this option is added and how to remove it.
>> Can anybody help me to fix it?
> Which yocto and gcc version are you using? Could you show us the actual
> error messages and yocto recipe?
The current fido and master branches use gcc 4.9.2 and the problem is 
that soft float abi support seems missing and the option 
-mfloat-abi=soft is always added by the make rules of barebox.
If i use the above mentioned fix, the result is:

arm-poky-linux-gnueabi-gcc: error: -mfloat-abi=soft and -mfloat-abi=hard 
may not be used together

because -mfloat-abi=hard is passed in ${CC} variable.

If i remove the option -mfloat-abi=hard, then got this error:

... stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory

that's why i think the soft abi support is missing.
IMHO the float abi should not be set by the make rules because it is 
hardware specific, and therefore should be set by the build system.

Regards
György Kövesdi


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-23 11:29   ` György Kövesdi
@ 2015-06-23 12:22     ` Holger Schurig
  2015-06-23 13:40       ` György Kövesdi
  0 siblings, 1 reply; 13+ messages in thread
From: Holger Schurig @ 2015-06-23 12:22 UTC (permalink / raw)
  To: György Kövesdi; +Cc: barebox

You better ask in some Yocto-specific mailing list, this isn't really
the problem of Barebox anymore. :-)   The soft-float option might come
from one of your inherited configuration files.

Soft-Float is definitely not optimal for the i.MX6, because this one
has FPU commands.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-23 12:22     ` Holger Schurig
@ 2015-06-23 13:40       ` György Kövesdi
  2015-06-23 14:07         ` Holger Schurig
  0 siblings, 1 reply; 13+ messages in thread
From: György Kövesdi @ 2015-06-23 13:40 UTC (permalink / raw)
  To: barebox

Hi,

> You better ask in some Yocto-specific mailing list, this isn't really
> the problem of Barebox anymore. :-)   The soft-float option might come
> from one of your inherited configuration files.
I am completely confused now, because Yocto guys said that the problem 
is in Barebox... :-)
At least i can compile thousands of recipes on Yocto, currently Barebox 
is the only one having this issue. I spent a lot of time debugging this 
problem in the recent days and i see the float abi is set to hard in the 
bitbake environment, and the soft float is not even supported by gcc 
(that is the problem). Currently i blame the kernel build system used by 
Barebox about setting soft float abi.

> Soft-Float is definitely not optimal for the i.MX6, because this one
> has FPU commands.
I agree.

Regards
Gyorgy Kovesdi


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-23 13:40       ` György Kövesdi
@ 2015-06-23 14:07         ` Holger Schurig
  2015-06-23 14:52           ` György Kövesdi
  0 siblings, 1 reply; 13+ messages in thread
From: Holger Schurig @ 2015-06-23 14:07 UTC (permalink / raw)
  To: György Kövesdi; +Cc: barebox

Look at barebox/arch/arm/Makefile. Around line 47 you see
"-msoft-float" specified to both CPPFLAGS and AFLAGS. So specifying
"CC=-msoft-hard" would bites with this.

Does compiling Barebox outside of Yocto work?  E.g. something like:

make ARCH=arm CROSS_COMPILE=/home/schurig/d/mkarm/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux/bin/arm-linux-gnueabihf-

(I'm using http://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz,
but you'd of corse specify your own prefix). Also note that my
compiler is gnueabiarmhf (hf is "hard-float"), but has not trouble
compiling in something with -msoft-float. Maybe your cross-compiler
cannot do that?



PS: despite I was once heavily involved into the early bitbake (during
OpenEmbedded time), I stopped using it. I now run Debian on my i.MX6
and don't fuzz with bitbake/OE/Poky/Yocto anymore :-)

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-23 14:07         ` Holger Schurig
@ 2015-06-23 14:52           ` György Kövesdi
  2015-06-23 15:01             ` Holger Schurig
  0 siblings, 1 reply; 13+ messages in thread
From: György Kövesdi @ 2015-06-23 14:52 UTC (permalink / raw)
  To: barebox

Hi all,

On 2015-06-23 16:07, Holger Schurig wrote:
> Look at barebox/arch/arm/Makefile. Around line 47 you see
> "-msoft-float" specified to both CPPFLAGS and AFLAGS. So specifying
> "CC=-msoft-hard" would bites with this.
Many thanx, this was the problem!
I am removed the "-msoft-float" and everything works now.

I just suggest to remove it at all because such settings are belong to 
the build environment. If someone needs such, it can be set by parameters.
Is it acceptable in general?
Shall i send a patch, or someone does it?

Regards
Gyorgy Kovesdi


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-23 14:52           ` György Kövesdi
@ 2015-06-23 15:01             ` Holger Schurig
  2015-06-23 17:57               ` Gyorgy Kovesdi
  0 siblings, 1 reply; 13+ messages in thread
From: Holger Schurig @ 2015-06-23 15:01 UTC (permalink / raw)
  To: György Kövesdi; +Cc: barebox

Better make a Yocto patch. Not everyone compiles Barebox with a "build
environment".

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-23 15:01             ` Holger Schurig
@ 2015-06-23 17:57               ` Gyorgy Kovesdi
  2015-06-23 19:30                 ` Lucas Stach
  0 siblings, 1 reply; 13+ messages in thread
From: Gyorgy Kovesdi @ 2015-06-23 17:57 UTC (permalink / raw)
  To: Holger Schurig

Hi all,
> Better make a Yocto patch. Not everyone compiles Barebox with a "build
> environment".
Ok, i will do that.
However, IMHO it is a wrong idea to hard-wire such a setting, because
everybody will run into this problem having hard-float-only environment.
At least it should be configurable.
BTW everybody must have a (cross) gcc which takes care about that.

Regards
Gyorgy Kovesdi

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-23 17:57               ` Gyorgy Kovesdi
@ 2015-06-23 19:30                 ` Lucas Stach
  2015-06-24 14:33                   ` Jan Lübbe
  0 siblings, 1 reply; 13+ messages in thread
From: Lucas Stach @ 2015-06-23 19:30 UTC (permalink / raw)
  To: Gyorgy Kovesdi; +Cc: barebox

Am Dienstag, den 23.06.2015, 19:57 +0200 schrieb Gyorgy Kovesdi:
> Hi all,
> > Better make a Yocto patch. Not everyone compiles Barebox with a "build
> > environment".
> Ok, i will do that.
> However, IMHO it is a wrong idea to hard-wire such a setting, because
> everybody will run into this problem having hard-float-only environment.
> At least it should be configurable.
> BTW everybody must have a (cross) gcc which takes care about that.
> 
It's a completely reasonable decision to explicitly build with the
soft-float ABI for a bare metal component like Barebox, in order to
prevent the toolchain from using any part of the ARM VFP state, which
may not be initialized at that point.

This has nothing to do with the decision to build your userspace with
hard-float enabled. Building barebox with the hard-float ABI may
actively yield broken binaries. So no, this is not a thing that should
be configurable.

Also you don't have a hard-float only environment, your toolchain is
perfectly able to build with the soft-float ABI, it's just that Yocto
apparently passes the mfloat-abi=hard flag everywhere instead of setting
a reasonable toolchain default.

Regards,
Lucas


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-23 19:30                 ` Lucas Stach
@ 2015-06-24 14:33                   ` Jan Lübbe
  2015-06-24 19:59                     ` Fabio Estevam
  2015-06-29 10:24                     ` Gyorgy Kovesdi
  0 siblings, 2 replies; 13+ messages in thread
From: Jan Lübbe @ 2015-06-24 14:33 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox, Gyorgy Kovesdi, Holger Hans Peter Freyther

On Di, 2015-06-23 at 21:30 +0200, Lucas Stach wrote:
> Also you don't have a hard-float only environment, your toolchain is
> perfectly able to build with the soft-float ABI, it's just that Yocto
> apparently passes the mfloat-abi=hard flag everywhere instead of
> setting a reasonable toolchain default.

I have the same problem now, as well (triggered by setting
DEFAULTTUNE="cortexa8hf-neon").

The kernel uses the same -msoft-float in arch/arm/Makefile as we do in
barebox. As Lucas said, this is actually important for correct behavior.

Yocto handles this by building the kernel with CC="${KERNEL_CC}"
LD="${KERNEL_LD}" instead (see kernel.bbclass and kernel-arch.bbclass).
For barebox I now have:
do_compile () {
        unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
        oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}"
}

These settings make it impossible to build the barebox target userspace
tools from scripts/, though. This is because the --sysroot parameter is
passed by Yocto only in ${CC} and not in ${KERNEL_CC}, so the target
userspace tools will fail to find their standard headers. So I have as a
temporary workaround:
do_configure_prepend() {
        cp ${WORKDIR}/defconfig ${S}/.config
        # do not compile tools when using KERNEL_CC/KERNEL_LD
        echo CONFIG_BAREBOXENV_TARGET=n >> ${S}/.config
        echo CONFIG_BAREBOXCRC32_TARGET=n >> ${S}/.config
        echo CONFIG_KERNEL_INSTALL_TARGET=n >> ${S}/.config
        echo CONFIG_IMD_TARGET=n >> ${S}/.config
        oe_runmake oldconfig
}

To compile the target userspace tools, we'll need to use ${CC} instead,
which is currently not supported by our (or the kernel's) kbuild. It
seems that we currently build these tools with -msoft-float as well,
which causes no problems because we don't use float math, but it's not
correct either.

Gyorgy, could you point us to the Yocto side of the discussion, if it
was on some list?

Regards,
Jan
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-24 14:33                   ` Jan Lübbe
@ 2015-06-24 19:59                     ` Fabio Estevam
  2015-06-29 10:24                     ` Gyorgy Kovesdi
  1 sibling, 0 replies; 13+ messages in thread
From: Fabio Estevam @ 2015-06-24 19:59 UTC (permalink / raw)
  To: jlu; +Cc: Gyorgy Kovesdi, barebox, Holger Hans Peter Freyther

On Wed, Jun 24, 2015 at 11:33 AM, Jan Lübbe <jlu@pengutronix.de> wrote:

> Gyorgy, could you point us to the Yocto side of the discussion, if it
> was on some list?

https://www.mail-archive.com/meta-freescale@yoctoproject.org/msg14197.html

Regards,

Fabio Estevam

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Compiling barebox for newest Yocto/meta-freescale
  2015-06-24 14:33                   ` Jan Lübbe
  2015-06-24 19:59                     ` Fabio Estevam
@ 2015-06-29 10:24                     ` Gyorgy Kovesdi
  1 sibling, 0 replies; 13+ messages in thread
From: Gyorgy Kovesdi @ 2015-06-29 10:24 UTC (permalink / raw)
  To: barebox

Hi everybody,

You are right, barebox really cannot be run with hard-float.
I re-enabled soft float in gcc compilation, and now it works perfectly on Yocto build without any modification.

Many thanx
György Kövesdi

On Wed, 24 Jun 2015 16:33:00 +0200
Jan Lübbe <jlu@pengutronix.de> wrote:

> On Di, 2015-06-23 at 21:30 +0200, Lucas Stach wrote:
> > Also you don't have a hard-float only environment, your toolchain is
> > perfectly able to build with the soft-float ABI, it's just that Yocto
> > apparently passes the mfloat-abi=hard flag everywhere instead of
> > setting a reasonable toolchain default.
> 
> I have the same problem now, as well (triggered by setting
> DEFAULTTUNE="cortexa8hf-neon").
> 
> The kernel uses the same -msoft-float in arch/arm/Makefile as we do in
> barebox. As Lucas said, this is actually important for correct behavior.
> 
> Yocto handles this by building the kernel with CC="${KERNEL_CC}"
> LD="${KERNEL_LD}" instead (see kernel.bbclass and kernel-arch.bbclass).
> For barebox I now have:
> do_compile () {
>         unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
>         oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}"
> }
> 
> These settings make it impossible to build the barebox target userspace
> tools from scripts/, though. This is because the --sysroot parameter is
> passed by Yocto only in ${CC} and not in ${KERNEL_CC}, so the target
> userspace tools will fail to find their standard headers. So I have as a
> temporary workaround:
> do_configure_prepend() {
>         cp ${WORKDIR}/defconfig ${S}/.config
>         # do not compile tools when using KERNEL_CC/KERNEL_LD
>         echo CONFIG_BAREBOXENV_TARGET=n >> ${S}/.config
>         echo CONFIG_BAREBOXCRC32_TARGET=n >> ${S}/.config
>         echo CONFIG_KERNEL_INSTALL_TARGET=n >> ${S}/.config
>         echo CONFIG_IMD_TARGET=n >> ${S}/.config
>         oe_runmake oldconfig
> }
> 
> To compile the target userspace tools, we'll need to use ${CC} instead,
> which is currently not supported by our (or the kernel's) kbuild. It
> seems that we currently build these tools with -msoft-float as well,
> which causes no problems because we don't use float math, but it's not
> correct either.
> 
> Gyorgy, could you point us to the Yocto side of the discussion, if it
> was on some list?
> 
> Regards,
> Jan


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2015-06-29 10:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-22 15:18 Compiling barebox for newest Yocto/meta-freescale György Kövesdi
2015-06-23  8:12 ` Jan Lübbe
2015-06-23 11:29   ` György Kövesdi
2015-06-23 12:22     ` Holger Schurig
2015-06-23 13:40       ` György Kövesdi
2015-06-23 14:07         ` Holger Schurig
2015-06-23 14:52           ` György Kövesdi
2015-06-23 15:01             ` Holger Schurig
2015-06-23 17:57               ` Gyorgy Kovesdi
2015-06-23 19:30                 ` Lucas Stach
2015-06-24 14:33                   ` Jan Lübbe
2015-06-24 19:59                     ` Fabio Estevam
2015-06-29 10:24                     ` Gyorgy Kovesdi

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