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.
GCC: set architecture to pass to linker
compiling;gcc;arm;linker;darwin
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.