Skip to contentSkip to conversation

gcc 4.9.1 and stdint.h

DISCUSSION Holger Hans Peter Freyther 2 participants 9 messages Nov 2, 2014 – Nov 12, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

I have a small piece of initial bootloader and it fails to compile using master (f19b4e995ea47f9243f152b39337330307453c9f). The code does include "stdint.h" which ends up with a failure like this:

tmp/sysroots/i686-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory

|  # include_next <stdint.h>
|                           ^
| compilation terminated.

So somehow gcc doesn't know how to find the glibc version of stdint.h. With edison and dora the #include_next will move to the sysroot.

Is this a regression of gcc-4.9? is this a wanted change?

kind regards
holger

#1 lore raw
Quoted 12 lines · Holger Hans Peter Freyther

Hi,

I have a small piece of initial bootloader and it fails to compile using master (f19b4e995ea47f9243f152b39337330307453c9f). The code does include "stdint.h" which ends up with a failure like this:

tmp/sysroots/i686-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.1/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory

|  # include_next <stdint.h>
|                           ^
| compilation terminated.
Quoted 5 lines

So somehow gcc doesn't know how to find the glibc version of stdint.h. With edison and dora the #include_next will move to the sysroot.

Is this a regression of gcc-4.9? is this a wanted change?

What was the compiler commandline you used and did you specify the sysroot? Was this was master or dizzy?

Cheers,

Richard

#2 lore raw

On Sun, Nov 02, 2014 at 10:03:35PM +0000, Richard Purdie wrote:

Good Morning,

Quoted 2 lines

What was the compiler commandline you used and did you specify the sysroot? Was this was master or dizzy?

that was with master. The command line for the compilation is:

arm-poky-linux-gnueabi-gcc -c -Os -Wall -mabi=aapcs-linux -DDM644x -DFLASH_TYPE_NAND -Dboard_sysmobts_v2 -DENABLE_BOOT_INTERRUPT -c -o davinci.o davinci.c

Okay the Makefile didn't honor the CC variable from the environment. How did that work before? Did gcc have a default sysroot?

holger

#3 lore raw
Quoted 7 lines · Holger Hans Peter Freyther

On Sun, Nov 02, 2014 at 10:03:35PM +0000, Richard Purdie wrote:

Good Morning,

Quoted 2 lines

What was the compiler commandline you used and did you specify the sysroot? Was this was master or dizzy?

Quoted 6 lines

that was with master. The command line for the compilation is:

arm-poky-linux-gnueabi-gcc -c -Os -Wall -mabi=aapcs-linux -DDM644x -DFLASH_TYPE_NAND -Dboard_sysmobts_v2 -DENABLE_BOOT_INTERRUPT -c -o davinci.o davinci.c

Okay the Makefile didn't honor the CC variable from the environment. How did that work before? Did gcc have a default sysroot?

Yes.

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=678e8798ebe0f4fd1bd347db136f1499b8fe00c9

Cheers,

Richard

#4 lore raw

On Mon, Nov 03, 2014 at 08:04:59AM +0000, Richard Purdie wrote:

Dear Richard,

Quoted 1 line

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=678e8798ebe0f4fd1bd347db136f1499b8fe00c9

thanks a lot for explaining. I see how using the default sysroot with external toolchains is going to cause issues. What is the reasoning to have it for the canadian cross (hence meta-toolchain)?

E.g. when compiling U-Boot linking will fail when just passing make CROSS_COMPILE=/opt/poky/1.7/.../arm-..- (not going through the sourcing of the environment file) the linking wil fail due a missing -lgcc but maybe I am doing something wrong as well.

/opt/poky/1.7/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld.bfd -g -Ttext 0xc100000 -o examples/standalone/hello_world -e hello_world examples/standalone/hello_world.o examples/standalone/libstubs.o -L . -lgcc
/opt/poky/1.7/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld.bfd: cannot find -lgcc gpl-uboot/examples/standalone/Makefile:67: recipe for target 'examples/standalone/hello_world' failed make[2]: *** [examples/standalone/hello_world] Error 1

holger

#5 lore raw
Quoted 9 lines · Holger Hans Peter Freyther

On Mon, Nov 03, 2014 at 08:04:59AM +0000, Richard Purdie wrote:

Dear Richard,

Quoted 1 line

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=678e8798ebe0f4fd1bd347db136f1499b8fe00c9

thanks a lot for explaining. I see how using the default sysroot with external toolchains is going to cause issues. What is the reasoning to have it for the canadian cross (hence meta-toolchain)?

The reasoning is that we have one canadian-cross compiler targeting multiple sysroots (one arm compiler targets all arm machines). The compiled in sysroot may not be the final installation path anyway, depending on where you install meta-toolchain.

We prefer deterministic builds rather than some toolchain installations that work and some that don't.

Cheers,

Richard

#6 lore raw
Quoted 2 lines · Richard Purdie

We prefer deterministic builds rather than some toolchain installations that work and some that don't.

Do you intend to create a script like the current environment that could work with "bare" apps (like u-boot, linux kernel, initial bootloaders, etc.)?

holger

#7 lore raw
Quoted 8 lines · Holger Hans Peter Freyther
Quoted 2 lines · Richard Purdie

We prefer deterministic builds rather than some toolchain installations that work and some that don't.

Do you intend to create a script like the current environment that could work with "bare" apps (like u-boot, linux kernel, initial bootloaders, etc.)?

I'd like to understand what differences such an environment script would have but would be happy to consider it...

Cheers,

Richard

#8 lore raw
Quoted 2 lines · Richard Purdie

I'd like to understand what differences such an environment script would have but would be happy to consider it...

I am not sure. My question is how to compile a kernel with the result of meta-toolchain? Until this commit setting CROSS_COMPILE=/opt/..- was enough. But now my users probably need to pass CC and LD as variables as well? The current environment file passes -Wl, to the linker which doesn't work with the kernel compilation. So I wondered if one could create a script with enough variables to easily compile things like UBL, U-Boot, Linux?