This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: darwin cross compiling breakage


A strategic use of --with-as/--with-ld is at least enough to work as a proof of concept.

$ cat test.c
int main() {}
[ssen@handual]$ /opt/cross/bin/i686-apple-darwin8-gcc -o test test.c -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: ../gcc.fsf/configure --disable-checking --enable- languages=c,c++ --build=powerpc-apple-darwin8 --host=powerpc-apple- darwin8 --target=i686-apple-darwin8 --with-sysroot=/ --prefix=/opt/ cross --with-as=/usr/bin/as --with-ld=/usr/bin/ld
Thread model: posix
gcc version 4.2.0 20060610 (experimental)
/opt/cross/libexec/gcc/i686-apple-darwin8/4.2.0/cc1 -quiet -v - D__DYNAMIC__ test.c -fPIC -quiet -dumpbase test.c -mtune=generic - auxbase test -version -o /var/tmp//ccUruMSh.s
ignoring nonexistent directory "/opt/cross/lib/gcc/i686-apple- darwin8/4.2.0/../../../../i686-apple-darwin8/include"
#include "..." search starts here:
#include <...> search starts here:
//usr/local/include
/opt/cross/lib/gcc/i686-apple-darwin8/4.2.0/include
//usr/include
//System/Library/Frameworks
//Library/Frameworks
End of search list.
GNU C version 4.2.0 20060610 (experimental) (i686-apple-darwin8)
compiled by GNU C version 4.0.1 (Apple Computer, Inc. build 5359).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min- heapsize=131072
Compiler executable checksum: 1564ee5ebb324959d41c9b29267eac6d
/usr/bin/as -arch i386 -force_cpusubtype_ALL -o /var/tmp// cchnoecO.o /var/tmp//ccUruMSh.s
/opt/cross/libexec/gcc/i686-apple-darwin8/4.2.0/collect2 -dynamic - arch i386 -weak_reference_mismatches non-weak -o test -lcrt1.o -L/opt/ cross/lib/gcc/i686-apple-darwin8/4.2.0 -L/opt/cross/lib/gcc/i686-apple- darwin8/4.2.0/../../../../i686-apple-darwin8/lib -L//usr/lib /var/tmp// cchnoecO.o -lgcc -lSystem
[ssen@handual]$ file test
test: Mach-O executable i386
$


The point is that it can be done, with enough changes, and prevents abuse of CROSS_COMPILE

Shantonu

On Jun 12, 2006, at 9:50 AM, Andrew Pinski wrote:


On Jun 12, 2006, at 8:13 AM, Andrew Pinski wrote:
That solution is uninteresting, as I don't think it works.
Shantonu, did you test the result without modifying your PATH?

You need that right now even with your change or Shantonu's.

If you think I need it, please explain the command that you think won't work, and I will run it and see if you are correct. I have a feeling that it actually works. It appears to work just fine for me:

mrs $ gcc-4.2 -arch i386 t.c -c
mrs $

but maybe I missed something?

Yes this is not really a cross but a fake cross.


Apple has other local changes to "fix" up the use of as/ld/ar/ranlib.

-- Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]