ARM EABI builds
Has anyone had success with building an EABI buildroot? I have tried building ARM (arm920t,gcc 4.1.2) and the image produced hangs (it seems vfprintf does not work)
I have succesfully built images with gcc 4.1.2 and a patch to make it build gcc with OABI.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
Quoted 7 lines · Ben Dooks
Has anyone had success with building an EABI buildroot? I have tried building ARM (arm920t,gcc 4.1.2) and the image produced hangs (it seems vfprintf does not work)
I have succesfully built images with gcc 4.1.2 and a patch to make it build gcc with OABI.
Yes, I had success. (After an issue described in "[Buildroot] Arm / buildroot / kernel issue: init crashes?", maybe this is your problem too.)
Quoted 11 lines · Tom
Quoted 7 lines · Ben Dooks
Has anyone had success with building an EABI buildroot? I have tried building ARM (arm920t,gcc 4.1.2) and the image produced hangs (it seems vfprintf does not work)
I have succesfully built images with gcc 4.1.2 and a patch to make it build gcc with OABI.
Yes, I had success. (After an issue described in "[Buildroot] Arm / buildroot / kernel issue: init crashes?", maybe this is your problem too.)
Next time, could you please post an URL, it doesn't seem to be trivially findable with google.
I have tried EABI build with what should be an EABI only kernel, and this still shows that /bin/sh is not running to a point where you can interact with it.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
Quoted 13 lines · Ben Dooks
Quoted 11 lines · Tom
Quoted 7 lines · Ben Dooks
Has anyone had success with building an EABI buildroot? I have tried building ARM (arm920t,gcc 4.1.2) and the image produced hangs (it seems vfprintf does not work)
I have succesfully built images with gcc 4.1.2 and a patch to make it build gcc with OABI.
Yes, I had success. (After an issue described in "[Buildroot] Arm / buildroot / kernel issue: init crashes?", maybe this is your problem too.)
Quoted 6 lines
Next time, could you please post an URL, it doesn't seem to be trivially findable with google.
I have tried EABI build with what should be an EABI only kernel, and this still shows that
/bin/shis not running to a point where you can interact with it.
I have finally tracked down the problem, and will be submitting a fix as soon as I have reviewed the patch.
The basic problem is as so:
1) Buildroot asks for the processor type (ARM920,etc)
2) Buildroot does not pass this to gcc when building
3) GCC makes a guess about architecture based on internal configuration
4) GCC EABI defaults to ARMv5
5) ARMv5 produces instructions that cannot execute on ARMv4
6) applications fail to work due to invalid instructions in libgcc
The first part of the solution is to pass --with-cpu=<cpu> to the gcc configuration, thus forcing the use of a particular cpu and architecture.
The next thing is, do we then need to produce our compiler and libraries in toolchain_arm_<cpu>_<fp> and build_arm_<cpu>_<fp> ?
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
Am 2007-06-27 09:19 +0100 schrieb Ben Dooks:
Quoted 2 lines
I have finally tracked down the problem, and will be submitting a fix as soon as I have reviewed the patch.
*argh*
I followed your thread and I am so sorry that I forgot that I for myself apply a patch regarding this issue. It floated around a while ago and it is called unbreak-armv4t.patch:
ff -urN gcc-4.1.1/gcc/config/arm/linux-eabi.h gcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.h
gcc/config/arm/linux-eabi.h 2006-10-24 21:34:01.000000000 -0700 renamed from gcc/config/arm/linux-eabi.h 2006-10-22 11:11:49.000000000 -0700 +1 -1
@@ -45,7 +45,7 @@ The ARM10TDMI core is the default for armv5t, so set SUBTARGET_CPU_DEFAULT to achieve this. */ #undef SUBTARGET_CPU_DEFAULT -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi #undef SUBTARGET_EXTRA_LINK_SPEC #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
Quoted 2 lines
The next thing is, do we then need to produce our compiler and libraries in toolchain_arm_<cpu>_<fp> and build_arm_<cpu>_<fp> ?
Well... why not? The toolchain_arm_<cpu>_<fp> directory is some sort of PIC in the filesystem and can moved around and used for crosscompiling other stuff standing alone.
Konsti
Signature · 2 lines
GPG KeyID EF62FCEF Fingerprint: 13C9 B16B 9844 EC15 CC2E A080 1E69 3FDA EF62 FCEF
Quoted 10 lines · Konstantin Kletschke
Am 2007-06-27 09:19 +0100 schrieb Ben Dooks:
Quoted 2 lines
I have finally tracked down the problem, and will be submitting a fix as soon as I have reviewed the patch.
*argh*
I followed your thread and I am so sorry that I forgot that I for myself apply a patch regarding this issue. It floated around a while ago and it is called unbreak-armv4t.patch:
Whilst this is also a fix, I think that passing --with-cpu= to the compiler at generation time is a better option. This will allow OABI builds for any pre-armv4 sytems, and ensure that xscale/v5/v6/etc will also produce optimal output as they will be configured with the correct cpu architecture.
Quoted 14 lines
ff -urN
gcc-4.1.1/gcc/config/arm/linux-eabi.hgcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.hgcc/config/arm/linux-eabi.h 2006-10-24 21:34:01.000000000 -0700 renamed from gcc/config/arm/linux-eabi.h 2006-10-22 11:11:49.000000000 -0700 +1
-1@@ -45,7 +45,7 @@ The ARM10TDMI core is the default for armv5t, so set SUBTARGET_CPU_DEFAULT to achieve this. */ #undef SUBTARGET_CPU_DEFAULT -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi #undef SUBTARGET_EXTRA_LINK_SPEC #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
Quoted 6 lines
Quoted 2 lines
The next thing is, do we then need to produce our compiler and libraries in toolchain_arm_<cpu>_<fp> and build_arm_<cpu>_<fp> ?
Well... why not? The toolchain_arm_<cpu>_<fp> directory is some sort of PIC in the filesystem and can moved around and used for crosscompiling other stuff standing alone.
That was more a request for comments, it can sometimes be difficult to guage exactly how people view these things until you've asked.
It would also need EABI/OABI in there. I tried switching an already configured buildroot from EABI to OABI, and found that it did not build correctly (but that is for another post).
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
Quoted 31 lines · Ben Dooks
Quoted 9 lines · Ben Dooks
Quoted 8 lines · Tom
Quoted 7 lines · Ben Dooks
Has anyone had success with building an EABI buildroot? I have tried building ARM (arm920t,gcc 4.1.2) and the image produced hangs (it seems vfprintf does not work)
I have succesfully built images with gcc 4.1.2 and a patch to make it build gcc with OABI.
Quoted 8 lines
Quoted 2 lines
Yes, I had success. (After an issue described in "[Buildroot] Arm / buildroot / kernel issue: init crashes?", maybe this is your problem too.)
Next time, could you please post an URL, it doesn't seem to be trivially findable with google.
I have tried EABI build with what should be an EABI only kernel, and this still shows that
/bin/shis not running to a point where you can interact with it.I have finally tracked down the problem, and will be submitting a fix as soon as I have reviewed the patch.
The basic problem is as so:
1) Buildroot asks for the processor type (ARM920,etc)
2) Buildroot does not pass this to gcc when building
3) GCC makes a guess about architecture based on internal configuration
4) GCC EABI defaults to ARMv5
5) ARMv5 produces instructions that cannot execute on ARMv4
6) applications fail to work due to invalid instructions in libgcc
Quoted 7 lines
The first part of the solution is to pass --with-cpu=<cpu> to the gcc configuration, thus forcing the use of a particular cpu and architecture.
The next thing is, do we then need to produce our compiler and libraries in toolchain_arm_<cpu>_<fp> and build_arm_<cpu>_<fp> ?
We need to keep in mind that the same gcc toolchain can support several subarchitectures, thus this naming would be somewhat misleading (for example, in our cases it did produce both ARMv4 (in the kernel) and ARMv5 (in user libs)).
To me it would be great if the gcc toolchain always printed out whatever the default SUBTARGET / CPU is as part of its specs. (It does this only if one is passed with the --with-cpu option, so if it's not passed, you can't easily find the default.) This would have helped me immensely to find the --with-cpu workaround, but I am afraid this is not really a buildroot issue.
Quoted 37 lines · Tom
Quoted 36 lines · Ben Dooks
Quoted 12 lines · Ben Dooks
Quoted 11 lines · Tom
Quoted 7 lines · Ben Dooks
Has anyone had success with building an EABI buildroot? I have tried building ARM (arm920t,gcc 4.1.2) and the image produced hangs (it seems vfprintf does not work)
I have succesfully built images with gcc 4.1.2 and a patch to make it build gcc with OABI.
Yes, I had success. (After an issue described in "[Buildroot] Arm / buildroot / kernel issue: init crashes?", maybe this is your problem too.)
Quoted 6 lines
Next time, could you please post an URL, it doesn't seem to be trivially findable with google.
I have tried EABI build with what should be an EABI only kernel, and this still shows that
/bin/shis not running to a point where you can interact with it.I have finally tracked down the problem, and will be submitting a fix as soon as I have reviewed the patch.
The basic problem is as so:
1) Buildroot asks for the processor type (ARM920,etc)
2) Buildroot does not pass this to gcc when building
3) GCC makes a guess about architecture based on internal configuration
4) GCC EABI defaults to ARMv5
5) ARMv5 produces instructions that cannot execute on ARMv4
6) applications fail to work due to invalid instructions in libgccThe first part of the solution is to pass --with-cpu=<cpu> to the gcc configuration, thus forcing the use of a particular cpu and architecture.
Quoted 7 lines
Quoted 3 lines
The next thing is, do we then need to produce our compiler and libraries in toolchain_arm_<cpu>_<fp> and build_arm_<cpu>_<fp> ?
We need to keep in mind that the same gcc toolchain can support several subarchitectures, thus this naming would be somewhat misleading (for example, in our cases it did produce both ARMv4 (in the kernel) and ARMv5 (in user libs)).
Yes, the naming would indicate the default cpu the compiler is configured for. The gcc docs[1] indicate the --with-cpu= option only sets the default cpu to compile for. Unfortunately this affects how it produces libgcc.
I don't see why you would end up producing ARMv4 kernel when producing an ARMv5 user space. Either you are producing a kernel to run on the same arch as your userspace (the kernel will correctly assign -mcpu=<x>) when it is building.
Quoted 6 lines
To me it would be great if the gcc toolchain always printed out whatever the default SUBTARGET / CPU is as part of its specs. (It does this only if one is passed with the --with-cpu option, so if it's not passed, you can't easily find the default.) This would have helped me immensely to find the --with-cpu workaround, but I am afraid this is not really a buildroot issue.
It is part of a problem with gcc where libgcc is being built for some arbitrary default, instead of one suitable for each architecture that can be selected at run-time.
The problem with buildroot is that it gives you a choice of ARM cpus. If you select ARM920T, then you have an expectation of being able to run the binaries produced on an ARM920T, which currently if EABI is also selected is impossible.
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.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
Quoted 10 lines · Ben Dooks
Quoted 4 lines
We need to keep in mind that the same gcc toolchain can support several subarchitectures, thus this naming would be somewhat misleading (for example, in our cases it did produce both ARMv4 (in the kernel) and ARMv5 (in user libs)).
Yes, the naming would indicate the default cpu the compiler is configured for. The gcc docs[1] indicate the --with-cpu= option only sets the default cpu to compile for. Unfortunately this affects how it produces libgcc.
Quoted 5 lines
I don't see why you would end up producing ARMv4 kernel when producing an ARMv5 user space. Either you are producing a kernel to run on the same arch as your userspace (the kernel will correctly assign -mcpu=<x>) when it is building.
Why? Because of the bug: Configured all builds with ARM920T:
Buildroot creates "incorrect" toolchain, "incorrect" toolchain fails to build uclibc in ARMv4 only but uses ARMv5. However, it did build a kernel in ARMv4 fine.
Quoted 7 lines
Quoted 6 lines
To me it would be great if the gcc toolchain always printed out whatever the default SUBTARGET / CPU is as part of its specs. (It does this only if one is passed with the --with-cpu option, so if it's not passed, you can't easily find the default.) This would have helped me immensely to find the --with-cpu workaround, but I am afraid this is not really a buildroot issue.
Quoted 8 lines
It is part of a problem with gcc where libgcc is being built for some arbitrary default, instead of one suitable for each architecture that can be selected at run-time.
The problem with buildroot is that it gives you a choice of ARM cpus. If you select ARM920T, then you have an expectation of being able to run the binaries produced on an ARM920T, which currently if EABI is also selected is impossible.
Yes, I agree. I like your solution in
http://busybox.net/bugs/view.php?id=1406 .
Quoted 5 lines
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)
Quoted 42 lines · Tom
Quoted 10 lines · Ben Dooks
Quoted 4 lines
We need to keep in mind that the same gcc toolchain can support several subarchitectures, thus this naming would be somewhat misleading (for example, in our cases it did produce both ARMv4 (in the kernel) and ARMv5 (in user libs)).
Yes, the naming would indicate the default cpu the compiler is configured for. The gcc docs[1] indicate the --with-cpu= option only sets the default cpu to compile for. Unfortunately this affects how it produces libgcc.
Quoted 5 lines
I don't see why you would end up producing ARMv4 kernel when producing an ARMv5 user space. Either you are producing a kernel to run on the same arch as your userspace (the kernel will correctly assign -mcpu=<x>) when it is building.
Why? Because of the bug: Configured all builds with ARM920T:
Buildroot creates "incorrect" toolchain, "incorrect" toolchain fails to build uclibc in ARMv4 only but uses ARMv5. However, it did build a kernel in ARMv4 fine.Quoted 7 lines
Quoted 6 lines
To me it would be great if the gcc toolchain always printed out whatever the default SUBTARGET / CPU is as part of its specs. (It does this only if one is passed with the --with-cpu option, so if it's not passed, you can't easily find the default.) This would have helped me immensely to find the --with-cpu workaround, but I am afraid this is not really a buildroot issue.
Quoted 8 lines
It is part of a problem with gcc where libgcc is being built for some arbitrary default, instead of one suitable for each architecture that can be selected at run-time.
The problem with buildroot is that it gives you a choice of ARM cpus. If you select ARM920T, then you have an expectation of being able to run the binaries produced on an ARM920T, which currently if EABI is also selected is impossible.
Yes, I agree. I like your solution in
http://busybox.net/bugs/view.php?id=1406 .Quoted 1 line
Quoted 6 lines
Quoted 4 lines
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
1) the kernel passed -march= and -mcpu= to the compiler
2) the kernel does not use libgcc.a to provide compiler support
this ensures the kernel will not build code which cannot be run on the target system. if you look at arch/arm/Makefile you'll see an number of compiler configurations based on arch and compiler version being used. In fact, if another compiler came along, it is entirely possible the kernel could be modified to use that instead.
passing -mcpu= to the application builds will ensure that the application is built for the correct cpu, but unfortunately there is the possibility that libgcc (built as part of the compiler build) will have been configured with invalid instructions.
Quoted 6 lines
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)
the configuration for gcc's default build for userland must be for the lowest common denominator that the build is going to run on, otherwise libgcc will be produced with invalid instructions.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
Quoted 6 lines
The problem with buildroot is that it gives you a choice of ARM cpus. If you select ARM920T, then you have an expectation of being able to run the binaries produced on an ARM920T, which currently if EABI is also selected is impossible.
So should we not just make EABI depend on !ARM920T
Best Regards
Ulf Samuelsson
Quoted 8 lines · Ulf Samuelsson
Quoted 5 lines
The problem with buildroot is that it gives you a choice of ARM cpus. If you select ARM920T, then you have an expectation of being able to run the binaries produced on an ARM920T, which currently if EABI is also selected is impossible.
So should we not just make EABI depend on !ARM920T
I would say no, because this combination works for buildroot. (However, if you _only_ select ARM920T and EABI and don't take care of the CPU options, it will fail.)
Quoted 9 lines · Tom
Quoted 8 lines · Ulf Samuelsson
Quoted 5 lines
The problem with buildroot is that it gives you a choice of ARM cpus. If you select ARM920T, then you have an expectation of being able to run the binaries produced on an ARM920T, which currently if EABI is also selected is impossible.
So should we not just make EABI depend on !ARM920T
1) EABI will work fine on ARM920T (and other ARMv4) targets
2) Currently, until other patches, a number of the available gcc choices do not currently build a compiler, let alone make it to the application stage.
3) The proposed fix in 1406 attempts to ensure that down the road we don't fall into this trap again.
Quoted 3 lines
I would say no, because this combination works for buildroot. (However, if you _only_ select ARM920T and EABI and don't take care of the CPU options, it will fail.)
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.