Skip to contentSkip to conversation

ARM EABI builds

Buildroot Stuart Wood 5 participants 7 messages Jun 28, 2007 – Jun 29, 2007

lore
Share & tools
lore
#0 lore raw

Just a note on what Tom said about user land application. I've already found that I had to add -march=armv4t to properly build my application, Just because gcc was not using the right load register code for the data size I wanted to read. It would use ldrw instead of ldrh. So, It would help avoid those errors.

Stuart

Quoted 5 lines · Tom

I did think about adding -mcpu=<cpu> to the build CFLAGS, but that is not going to help with the problem that libgcc is not going to be compiled correctly.

Why not? The kernel image, built with the same "incorrect" toolchain, must have used only ARMv4 instructions. If it hadn't, I would have never gotten far enough to even execute vprintf, libc. I would suspect that the kernel does a better job of setting -mcpu, -mtune. Thus these options should work for libc too. What makes you think that it wouldn't work for libc, have you tried? (PS: Even if it did, bug #1406 is probably the better fix, in particular as buildroot users might use its toolchain to build their own code w/o always setting these options)

_______________________________________________
buildroot mailing list
buildroot at uclibc.org http://busybox.net/mailman/listinfo/buildroot

#1 lore raw
Quoted 1 line · Stuart Wood

Just a note on what Tom said about user land application. I've already

Just as a note on what everybody seems to say about configuring GCC:
It is very amusing that you guys seem to be excited about _not_ setting a config option -- CONFIG_BR2_EXTRA_TARGET_GCC_CONFIG_OPTIONS -- which is specifically exported to you, to spell out specific requirements put upon gcc (other toolchain parts of course also provide said means for hand-crafted options, mind you).

Quoted 1 line

found that I had to add -march=armv4t to properly build my application, Just

doh!

Quoted 1 line

because gcc was not using the right load register code for the data

well, if you don't tell it to do and _do not help in improving the generic situation_ how should we guess what you are trying to achieve?

Get real. (yes, i'm in a bad mood and i'm fond of stupid whining about 'Doctor, it hurts when i..'

Q:
Dear X-mas whatever. I want this and that. Now. Immediately. No, i have no idea how to implement 'this' 'now', but it has to be done. What? Nah, no idea what 'this' nor 'that' nor 'now' is supposed to do, i'd have provided a guidance otherwise.
A: alright. At your service.

Quoted 2 lines

size I wanted to read. It would use ldrw instead of ldrh. So, It would help avoid those errors.

Try searching the archives for CPU selection (from memory, so may not be accurate) for further details.

Quoted 2 lines

Stuart

See below.

Quoted 7 lines
Quoted 5 lines · Tom

I did think about adding -mcpu=<cpu> to the build CFLAGS, but that is not going to help with the problem that libgcc is not going to be compiled correctly.

Quoted 7 lines

Why not? The kernel image, built with the same "incorrect" toolchain, must have used only ARMv4 instructions. If it hadn't, I would have never gotten far enough to even execute vprintf, libc. I would suspect that the kernel does a better job of setting -mcpu, -mtune. Thus these options should work for libc too. What makes you think that it wouldn't work for libc, have you tried? (PS: Even if it did, bug #1406 is probably the better fix, in particular as buildroot users might use its

bug #1406 is completely crap. Let me cite:
<quote>
Reporter bjdooks
Summary 0001403: printf and anything using vfprintf() hangs
system
Description Any function using vfprintf, such as printf and snprintf
cause the system to stop. A test program shows that stdout is functional, as fwrite() to stdout will display messages on the console
Additional Information uclibc 0.9.29
gcc 4.1.2 (arm-linux-uclibcgnueabi)
binutils 2.17.50.0.16
configure for ARM920T, EABI
---
(0002514)
bjdooks
06-25-07 17:26

The bug is still present in the development snapshot
---
(0002517)
bjdooks
06-26-07 05:03

Building gcc 4.1.2 for OABI (patches will be sent in seperate report) does not work either.
</quote>

Quoted 1 line

toolchain to build their own code w/o always setting these options)

- No actual error shown.
- no code/arch/toolchain hints to reproduce. This is one of the 'Doctor, it hurts'.. goto above;

#2 lore raw
Quoted 9 lines · Bernhard Fischer
Quoted 1 line · Stuart Wood

Just a note on what Tom said about user land application. I've already

Just as a note on what everybody seems to say about configuring GCC:
It is very amusing that you guys seem to be excited about _not_ setting a config option -- CONFIG_BR2_EXTRA_TARGET_GCC_CONFIG_OPTIONS -- which is specifically exported to you, to spell out specific requirements put upon gcc (other toolchain parts of course also provide said means for hand-crafted options, mind you).

Speaking for myself, I am not excited about any particular option. Also I don't need a doctor for this anymore, as for my part it works. Now.

However, as the combination EABI and ARM9 seems to be popular, I thought it would be nice to save others some of this trouble that they are bound to run into (*), either by just mentioning the option or by setting it automatically in buildroot. If you are saying that CONFIG_BR2_EXTRA_TARGET_GCC_CONFIG_OPTIONS is better suited for the required target CPU option than BR2_EXTRA_GCC_CONFIG_OPTIONS, that could very well be.

(*) This is the error I got after kernel boot on ARM920T/EABI default config, w/o the required CPU option:
init (1): undefined instruction: pc=00008c60
This error with buildroot and busybox configurations have been mailed to this group, please let me know if you would like me to attach this to a bug.

Quoted 77 lines
Quoted 2 lines

found that I had to add -march=armv4t to properly build my application, Just

doh!

Quoted 1 line

because gcc was not using the right load register code for the data

well, if you don't tell it to do and _do not help in improving the generic situation_ how should we guess what you are trying to achieve?

Get real. (yes, i'm in a bad mood and i'm fond of stupid whining about 'Doctor, it hurts when i..'

Q:
Dear X-mas whatever. I want this and that. Now. Immediately. No, i have no idea how to implement 'this' 'now', but it has to be done. What? Nah, no idea what 'this' nor 'that' nor 'now' is supposed to do, i'd have provided a guidance otherwise.
A: alright. At your service.

Quoted 2 lines

size I wanted to read. It would use ldrw instead of ldrh. So, It would help avoid those errors.

Try searching the archives for CPU selection (from memory, so may not be accurate) for further details.

Quoted 1 line

Stuart

See below.

Quoted 5 lines
Quoted 4 lines · Tom

I did think about adding -mcpu=<cpu> to the build CFLAGS, but that is not going to help with the problem that libgcc is not going to be compiled correctly.

Quoted 7 lines

Why not? The kernel image, built with the same "incorrect" toolchain, must have used only ARMv4 instructions. If it hadn't, I would have never gotten far enough to even execute vprintf, libc. I would suspect that the kernel does a better job of setting -mcpu, -mtune. Thus these options should work for libc too. What makes you think that it wouldn't work for libc, have you tried? (PS: Even if it did, bug #1406 is probably the better fix, in particular as buildroot users might use its

bug #1406 is completely crap. Let me cite:
<quote>
Reporter bjdooks
Summary 0001403: printf and anything using vfprintf() hangs
system
Description Any function using vfprintf, such as printf and snprintf
cause the system to stop. A test program shows that stdout is functional, as fwrite() to stdout will display messages on the console
Additional Information uclibc 0.9.29
gcc 4.1.2 (arm-linux-uclibcgnueabi)
binutils 2.17.50.0.16
configure for ARM920T, EABI
---
(0002514)
bjdooks
06-25-07 17:26

The bug is still present in the development snapshot
---
(0002517)
bjdooks
06-26-07 05:03

Building gcc 4.1.2 for OABI (patches will be sent in seperate report) does not work either.
</quote>

Quoted 1 line

toolchain to build their own code w/o always setting these options)

- No actual error shown.
- no code/arch/toolchain hints to reproduce. This is one of the 'Doctor, it hurts'.. goto above;
_______________________________________________
buildroot mailing list
buildroot at uclibc.org
http://busybox.net/mailman/listinfo/buildroot

#3 lore raw
Quoted 25 lines · Tom
Quoted 9 lines · Bernhard Fischer
Quoted 1 line · Stuart Wood

Just a note on what Tom said about user land application. I've already

Just as a note on what everybody seems to say about configuring GCC:
It is very amusing that you guys seem to be excited about _not_ setting a config option -- CONFIG_BR2_EXTRA_TARGET_GCC_CONFIG_OPTIONS -- which is specifically exported to you, to spell out specific requirements put upon gcc (other toolchain parts of course also provide said means for hand-crafted options, mind you).

Speaking for myself, I am not excited about any particular option. Also I don't need a doctor for this anymore, as for my part it works. Now.

However, as the combination EABI and ARM9 seems to be popular, I thought it would be nice to save others some of this trouble that they are bound to run into (*), either by just mentioning the option or by setting it automatically in buildroot. If you are saying that CONFIG_BR2_EXTRA_TARGET_GCC_CONFIG_OPTIONS is better suited for the required target CPU option than BR2_EXTRA_GCC_CONFIG_OPTIONS, that could very well be.

Quoted 3 lines

(*) This is the error I got after kernel boot on ARM920T/EABI default config, w/o the required CPU option:
init (1): undefined instruction: pc=00008c60

That is interesting, because I haven't been getting that when my system fails. I'll check the setup of /dev/console and the /dev entries for the serial ports. This would have been very helpful in pointing out the problem.

As an aside, it would be possible to fix the instruction in the kernel's undefined instruction trap (as is done to emulate the old hardware floating point instructions on newer processors) but I personally feel that this is something the kernel should not have to be doing.

[snip]

Signature · 4 lines
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#4 lore raw
In reply to Bernhard Fischer

Umm, I don't really know anything about Buildroot on ARM or EABI, but reading through this discussion I did feel compelled to point out one thing I noticed:

Quoted 8 lines · Bernhard Fischer
Quoted 2 lines

work for libc, have you tried? (PS: Even if it did, bug #1406 is probably the better fix, in particular as buildroot users might use its

bug #1406 is completely crap. Let me cite:
<quote>
Reporter bjdooks
Summary 0001403: printf and anything using vfprintf() hangs
system

As noted in the "Summary" line, the bug you quoted is 1403, not 1406. Bug 1406 does appear to have a clear description of the issue and a proposed patch to fix it, so while I can't comment on the merit of the patch contents, the bug report itself, at least, does not appear to be "completely crap"..

-alex

#5 lore raw
Quoted 9 lines · Alex Stewart

Umm, I don't really know anything about Buildroot on ARM or EABI, but reading through this discussion I did feel compelled to point out one thing I noticed:

Quoted 3 lines · Bernhard Fischer
Quoted 1 line

work for libc, have you tried? (PS: Even if it did, bug #1406 is

Summary 0001403: printf and anything using vfprintf() hangs

As noted in the "Summary" line, the bug you quoted is 1403, not 1406.

my bad.

Quoted 3 lines

Bug 1406 does appear to have a clear description of the issue and a proposed patch to fix it, so while I can't comment on the merit of the patch contents, the bug report itself, at least, does not appear to be "completely crap"..

Yes, that one is ok.

#6 lore raw
In reply to Bernhard Fischer
Quoted 9 lines · Bernhard Fischer
Quoted 1 line · Stuart Wood

Just a note on what Tom said about user land application. I've already

Just as a note on what everybody seems to say about configuring GCC:
It is very amusing that you guys seem to be excited about _not_ setting a config option -- CONFIG_BR2_EXTRA_TARGET_GCC_CONFIG_OPTIONS -- which is specifically exported to you, to spell out specific requirements put upon gcc (other toolchain parts of course also provide said means for hand-crafted options, mind you).

The point I was making in bug 1406, is that the config system already asks you which cpu you are building for, and then does not pass it to programs that use it, such as the compiler configuration.

Quoted 5 lines
Quoted 1 line

found that I had to add -march=armv4t to properly build my application, Just

doh!

Quoted 1 line

because gcc was not using the right load register code for the data

you'll have also seen that libgcc.a has various optimisations in routines such as the division/modulus helpers which use instructions like CLZ, which only got added in ARMv5.

Quoted 37 lines

well, if you don't tell it to do and _do not help in improving the generic situation_ how should we guess what you are trying to achieve?

Get real. (yes, i'm in a bad mood and i'm fond of stupid whining about 'Doctor, it hurts when i..'

Q:
Dear X-mas whatever. I want this and that. Now. Immediately. No, i have no idea how to implement 'this' 'now', but it has to be done. What? Nah, no idea what 'this' nor 'that' nor 'now' is supposed to do, i'd have provided a guidance otherwise.
A: alright. At your service.

Quoted 2 lines

size I wanted to read. It would use ldrw instead of ldrh. So, It would help avoid those errors.

Try searching the archives for CPU selection (from memory, so may not be accurate) for further details.

Quoted 2 lines

Stuart

See below.

Quoted 7 lines
Quoted 5 lines · Tom

I did think about adding -mcpu=<cpu> to the build CFLAGS, but that is not going to help with the problem that libgcc is not going to be compiled correctly.

Quoted 7 lines

Why not? The kernel image, built with the same "incorrect" toolchain, must have used only ARMv4 instructions. If it hadn't, I would have never gotten far enough to even execute vprintf, libc. I would suspect that the kernel does a better job of setting -mcpu, -mtune. Thus these options should work for libc too. What makes you think that it wouldn't work for libc, have you tried? (PS: Even if it did, bug #1406 is probably the better fix, in particular as buildroot users might use its

Quoted 4 lines

bug #1406 is completely crap. Let me cite:
<quote>
Reporter bjdooks
Summary 0001403: printf and anything using vfprintf() hangs

that's not bug 1406, looks like 1403 to me.

Quoted 19 lines

system
Description Any function using vfprintf, such as printf and snprintf
cause the system to stop. A test program shows that stdout is functional, as fwrite() to stdout will display messages on the console
Additional Information uclibc 0.9.29
gcc 4.1.2 (arm-linux-uclibcgnueabi)
binutils 2.17.50.0.16
configure for ARM920T, EABI
---
(0002514)
bjdooks
06-25-07 17:26

The bug is still present in the development snapshot
---
(0002517)
bjdooks
06-26-07 05:03

Quoted 6 lines

Building gcc 4.1.2 for OABI (patches will be sent in seperate report) does not work either.
</quote>

Quoted 1 line

toolchain to build their own code w/o always setting these options)

- No actual error shown.

I thought vfprintf() hangs is a pretty good error report, the system did not give me any more information, and when you can't run init, then it is very difficult to get gdb to do anything.

Quoted 1 line

- no code/arch/toolchain hints to reproduce.

I added details of the versions of the toolchain (gcc, uclibc) and the ARM core being configured for ARM920T. Ok there was no .config attached which wasn't helpful.

Quoted 1 line

This is one of the 'Doctor, it hurts'.. goto above;

ok, so not the world's best bug report, but after several days of frustration with EABI not producing a working build, and OABI simply not building a compiler, I was getting frustrated.

I finally got some inspiration from elsewhere, and decided to disassemble libgcc.a and found the culprits in the div/mod code and then set about trying to correct these.

Signature · 4 lines
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.