'ld' gives "unrecognised emulation mode" during make; gcc-3.4.3
Am using buildroot-20061031 to build arm926t system, Toolchain options gcc-3.4.3 (-final), ARM, EABI, binutils-2.16.91.0.7 and have set the GNU target suffix to linux-uclibcgnueabi. [Host system gcc-3.4.6 20060404]
During building libgcc, I get the message
->>/home/fred/buildroot/build_arm_nofpu/staging_dir/
arm-linux-uclibcgnueabi/b in/ld: unrecognised emulation mode: armelf_linux
Supported emulations: armelf_linux_eabi
collect2: ld returned 1 exit status
make[3]: *** [libgcc/./_udivsi3.oS] Error 1
-<<
[Buildroot] 'ld' gives "unrecognised emulation mode" - ARM toolchain unbuildable ??
Quoted 10 lines · MikeW
Am using buildroot-20061031 to build arm926t system, Toolchain options gcc-3.4.3 (-final), ARM, EABI, binutils-2.16.91.0.7 and have set the GNU target suffix to linux-uclibcgnueabi. [Host system gcc-3.4.6 20060404]
During building libgcc, I get the message
->>/home/fred/buildroot/build_arm_nofpu/staging_dir/
arm-linux-uclibcgnueabi/b in/ld: unrecognised emulation mode:
armelf_linux
Quoted 6 lines
Supported emulations:
armelf_linux_eabi
collect2: ld returned 1 exit status
make[3]: *** [libgcc/./_udivsi3.oS] Error 1
-<<From Google, I note that this type of problem is not infrequent
(for other
Quoted 1 line
target types), but the usual reponse is 'get the latest version'
which seems a bit of
Quoted 1 line
a cop-out, plus I am currently required to use 3.4.3 so
this does not apply.
Quoted 7 lines
a) any ideas to defeat this problem (not involving 3.4.x, x>3 !)
b) if it's frequent, how come it's not been resolved once & for allThanks,
MikeW
This seems to be due to an incompatibility between:
1) toolchain.../gcc-x.x.x/config/arm/linux-elf.h
2) toolchain.../binutils-x.x.x/ld/earmelf_linux_eabi.c
In 1) there is a setting TARGET_LINKER_EMULATION "armelf_linux" In 2) there is a string (part of a struct initialiser) "armelf_linux_eabi"
so unless I can find matching strings in a version of gcc and ld, buildroot will never be able to build a toolchain.
But 2) says the file is generated by a shell script, so maybe it's that script which is to blame !
Or maybe I could just hack 1) to have the correct string.
But that raises the question - how does anyone build an ARM toolchain, with this incompatibility in place ?
Regards,
MikeW
[Buildroot] 'ld' gives
In reply to MikeWQuoted 8 lines · MikeW
During building libgcc, I get the message
->>/home/fred/buildroot/build_arm_nofpu/staging_dir/
arm-linux-uclibcgnueabi/b in/ld: unrecognised emulation mode:armelf_linux
Supported emulations:armelf_linux_eabi
collect2: ld returned 1 exit status
make[3]: *** [libgcc/./_udivsi3.oS] Error 1
-<<
Fixed by setting GNU target suffix to 'elf-linux' instead.
Regards,
MikeW
[Buildroot] 'ld' gives "unrecognised emulation mode" - ARM toolchain unbuildable ??
Quoted 12 lines · MikeW
Quoted 8 lines · MikeW <mw_phil <at> ...> writes:
During building libgcc, I get the message
->>/home/fred/buildroot/build_arm_nofpu/staging_dir/
arm-linux-uclibcgnueabi/b in/ld: unrecognised emulation mode:armelf_linux
Supported emulations:armelf_linux_eabi
collect2: ld returned 1 exit status
make[3]: *** [libgcc/./_udivsi3.oS] Error 1
-<<
Quoted 5 lines
Fixed by setting GNU target suffix to 'elf-linux' instead.
Regards,
MikeW
Except that objects created by the toolchain have EABI version = 0 !! I need EABI version = 4 for compatibility :(
So that suggests that I need a target suffix containing '-eabi'.
Any ideas ?
I mean, where is this stuff documented - I've trawled through gcc docs and not found anything that explains these problems.
I'm presumably not the only person to encounter this issue !
Mike
[Buildroot] 'ld' gives "unrecognised emulation mode" - ARM toolchain unbuildable ??
You probably want to stick to armelf(b)-linux-eabi, since that's clearly the right thing in later toolchains. EABI on ARM seems to be better supported in an up-to-date toolchain combination consisting of gcc 4.1.1, binutils 2.17.50.0.6, and headers from glibc 2.5 and kernel 2.6.16 or later. I used crosstool to build a glibc toolchain first, and am currently grinding through compiling a full glibc/NPTL userspace with ptxdist, cleaning up all the non-uClibc-specific issues. Once I have the kinks worked out of that, I'll be trying a uClibc version; I'll keep the list posted.
As of gcc 4.1.1, it seems that one still needs this patch to fix up some include issues:
http://www.kegel.com/crosstool/crosstool-0.42/contrib/2006/crosstool-0.38-add-gcc-4.1-20060210.diff
Also, if your target is big-endian, you need the one-line patch below so that big-endian is really big-endian.
Cheers,
- Michael
--- gcc-4.1.0/gcc/config/arm/linux-eabi.h 2005-11-15
06:32:13.000000000 -0800
+++ gcc-4.1.0-patched/gcc/config/arm/linux-eabi.h 2006-04-26
22:13:14.000000000 -0700
@@ -48,7 +48,8 @@
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
#undef SUBTARGET_EXTRA_LINK_SPEC
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi" +#define SUBTARGET_EXTRA_LINK_SPEC \
+ " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} "
/* Use ld-linux.so.3 so that it will be possible to run "classic"
GNU/Linux binaries on an EABI system. */
[Buildroot] 'ld' gives "unrecognised emulation mode" - ARM toolchain unbuildable ??
Quoted 11 lines · Michael K. Edwards
You probably want to stick to armelf(b)-linux-eabi, since that's clearly the right thing in later toolchains. EABI on ARM seems to be better supported in an up-to-date toolchain combination consisting of gcc 4.1.1, binutils 2.17.50.0.6, and headers from glibc 2.5 and kernel 2.6.16 or later. I used crosstool to build a glibc toolchain first, and am currently grinding through compiling a full glibc/NPTL userspace with ptxdist, cleaning up all the non-uClibc-specific issues. Once I have the kinks worked out of that, I'll be trying a uClibc version; I'll keep the list posted.
Quoted 3 lines
As of gcc 4.1.1, it seems that one still needs this patch to fix up some include issues:
http://www.kegel.com/crosstool/crosstool-0.42/contrib/2006/crosstool-0.38-add-gcc-4.1-20060210.diff
Quoted 6 lines
Also, if your target is big-endian, you need the one-line patch below so that big-endian is really big-endian.
Cheers,
- Michael
Many thanks - but I am unable to configure Buildroot to give an EABI compatible (version != 0) toolchain.
I have now tried also using the most recent GCC and Binutils in the Buildroot menuconfig options, this using buildroot-20061031.
What is the required 'GNU target suffix' or other setting to enable EABI operation ? (Obviously I have set 'Target ABI: EABI')
The only target suffix that appears to give a workable toolchain (i.e. one that doesn't say 'unrecognised emulation mode') is 'elf-linux', and that doesn't seem to support EABI (objects built with it have EABI version 0)
If I use any other target suffix settings in the menuconfig (e.g. elf-linux-eabi or even tried elf-linux_eabi) I get:
".../bin/ld: unrecognised emulation mode: armelf_linux Supported emulations: armelf_linux_eabi" ... but I am unable to obtain that setting :(
Regards,
Mike
[Buildroot] 'ld' gives "unrecognised emulation mode" - ARM toolchain unbuildable ??
Did I say armelf-linux-eabi? Silly me. What's working for me (with glibc and crosstool) is armelf-linux-gnueabi. I'm almost done scrubbing cross-configure problems out of my ptxdist userland and will start banging on uClibc/buildroot today; I'll let you know what I find.
Cheers,
- Michael
[Buildroot] 'ld' gives "unrecognised emulation mode" - ARM toolchain unbuildable ??
Quoted 10 lines · Michael K. Edwards
Did I say armelf-linux-eabi? Silly me. What's working for me (with glibc and crosstool) is armelf-linux-gnueabi. I'm almost done scrubbing cross-configure problems out of my ptxdist userland and will start banging on uClibc/buildroot today; I'll let you know what I find.
Cheers,
- Michael
Even that gets rejected as being 'armelf_linux', not 'armelf_linux_eabi'.
Looks to me as if there's a regexp somewhere picking out the subcomponents of the string, and it's somehow not getting the final '_eabi' section.
But where ... crosstool ?
Regards,
MikeW
[Buildroot] 'ld' gives
Quoted 2 lines · MikeW
But where ... crosstool ?
Except Buildroot doesn't use crosstool.