Problems installing i386-elf-gcc on Snow Leopard

Björn Swift bjorn at swift.is
Mon Oct 26 10:41:13 PDT 2009


I've been trying to get i386-elf-gcc working on my machine, without much luck.

1) i386-elf-binutils

Failed with:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_cross_i386-elf-binutils/work/binutils-2.18.50.0.9/binutils/strings.c:100:8:

Fixed by editing string.c, as described in
http://thread.gmane.org/gmane.os.apple.macports.user/16155

2) i386-elf-gcc

Had to patch Make-lang.in, like
http://trac.macports.org/changeset/57794 does for lang/gcc43, and
update the Portfile, like http://trac.macports.org/changeset/59653
does for cross/i386-mingw32-gcc. I suppose these should be ported to
i386-elf-gcc, right? If so, I can provide patch were that to be of
interest.

After this, the compilation succeeded, but then I got the following error:

--->  Activating i386-elf-gcc @4.3.2_0
Error: Unable to execute port: Image error:
/opt/local/lib/x86_64/libiberty.a is being used by the active
i386-elf-binutils port.  Please deactivate this port first, or use
'port -f activate i386-elf-gcc' to force the activation.

I decided to force the activation, without really knowing the
consequences. That seemed to work.

I tried two gcc binaries (see below), both of which throw errors. One
can't find cc1 and the other crt0.o:

$ /opt/local/i386-elf/bin/gcc -o test-i386 test-i386.c
gcc: error trying to exec 'cc1': execvp: No such file or directory

$ /opt/local/bin/i386-elf-gcc-4.3.2 -o test-i386 test-i386.c
/opt/local/lib/gcc/i386-elf/4.3.2/../../../../i386-elf/bin/ld: crt0.o:
No such file: No such file or directory
collect2: ld returned 1 exit status

Does anyone have any ideas?

Thanks in advance,
Bjorn Swift


More information about the macports-users mailing list