My environment:
Darwin MacBook-Air-2.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 arm64
So im trying to compile binutils-2.42
from source with $TARGET=i686-elf
( Im trying to build a cross compiler for i686 using my m1 mac)
Then i run ./configure --prefix=$PREFIX --target=$TARGET --enable-interwork --enable-multilib --disable-nls --disable-werror
and then make
.
Running make
gives me this huge chunk of error: Error Link
In this chunk of errors i see “_xmalloc” symbol unresolved.So to try to find the cause of the problem, I made a simple .c program to malloc, and there is no linking error.
Please help me find the cause and a solution to the error.
Some more details that might help you:
-
Output of a simple ld command
ld: warning: platform not specified ld: warning: -arch not specified ld: warning: No platform min-version specified on command line ld: no object files specified
-
Output of gcc -v
gcc -v Apple clang version 13.1.6 (clang-1316.0.21.2) Target: arm64-apple-darwin21.3.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
-
Output of ld-v
@(#)PROGRAM:ld PROJECT:ld64-762 BUILD 06:28:58 Feb 18 2022 configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em LTO support using: LLVM version 13.1.6, (clang-1316.0.21.2) (static support for 28, runtime is 28) TAPI support using: Apple TAPI version 13.1.6 (tapi-1316.0.7.3)
4)IMPORTANT: I’ve already built the same binutils successfully on the same system few days back. Then in the next step, i tried to compile gcc from source and it threw some errors. In order to fix those errors i had tried to change my gcc from clang-gcc to gnu-gcc. As even gnu-gcc threw those same errors, i removed gnu-gcc and brought back clang-gcc to default. Consciously I havent deleted any libraries in the process. But maybe i’ve messed up something here?