1

GNU C compiler passes the wrong architecture name to the linker. For example gcc helloworld.i throws the error ld: unknown/unsupported architecture name: -arch arm. After some experimenting with LD, it seems armv7 is the architecture I should use. The compiling and assembling operations seem to work fine.

It appears that the compiler collection (iphone-gcc) is designed to work with an older version of the linker provided through the open-source Darwin CC Tools, not the newer LD64 I have installed provided as a stand-alone outside the CC tool collection. Is there any way to tell GCC to pass another architecture to the linker? Passing -Wl,-arch,armv7 or -Xlinker -arch -Xlinker armv7 to GCC gives the same error.

3 Answers 3

3

You shouldn't be upgrading your toolchain piecemeal. The parts have to work together. The GNU tools allow so much variation that it is essential that the pieces be set up to work together, especially for a cross-compiler.

If you need a newer ld for some reason, you should build up a complete toolchain to support it.

2
  • I know, but compiling on Darwin on ARM is kind of messed up as the manufacturer does not officially support the installation and use of such tools. Is there no way at all to tell GCC what architecture to pass to the linker?
    – osvein
    Commented Jun 9, 2014 at 14:42
  • 1
    @anustart: Yes. Again: build a gcc that is set up to work with your custom ld. Expecting someone else's gcc to somehow know what your custom ld wants is silly, and attempting to arm-twist it into doing the right thing is misguided. What you have there are two tools that must normally work closely together, but which have purposely been built independently of each other, so no wonder they don't work properly together. Commented Jun 9, 2014 at 16:36
1

Take @Warren Young's advice and upgrade the rest of the toolchain instead of upgrading just the linker.

For Darwin 9 and later on ARM, the toolchain by CoolStar available from the BigBoss repository is recommended. The toolchain contains LLVM+Clang as a replacement for the outdated iphone-gcc, as well as LD64 and the newer Darwin CC Tools. See the iphone-dev wiki (somewhat outdated) for a more detailed comparison between iphone-gcc and LLVM+Clang.

0

If you use the EasyBuild tool, you can automagically deliver multiple toolchains: https://hpc.uni.lu/users/software/#sw-toolchain
fi. look at ClangGCC

Now, GCC has a system of spec strings to specify how it works with & feeds other programs: http://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html

Your task would be to tune them to your needs; once done, please document it and/or make an EasyBuild toolchain that others can rely upon!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .