10.4 cross-compilation on 10.5

30 views
Skip to first unread message

Jjgod Jiang

unread,
Nov 2, 2007, 6:07:36 AM11/2/07
to vim...@googlegroups.com
Hi,

Ff we use the current configure script of vim, ./configure --with-mac-arch=both
will not be able to found the 10.4u SDK correctly, because 10.5 has a bug on
10.4 compilation, this bug can be demonstrated like this:

$ vi hello.c # put some simple C code into hello.c
$ gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk hello.c
ld: library not found for -lcrt1.10.5.o
collect2: ld returned 1 exit status

But

$ gcc -c -isysroot /Developer/SDKs/MacOSX10.4u.sdk hello.c
$ gcc hello.o

succeed.

so we have to:

$ sudo ln -s /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/crt1.o
/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/crt1.10.5.o

Now

$ gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk hello.c

succeed without an error. This problem will cause

$ ./configure ... --with-mac-arch=both
...
checking for 10.4 universal SDK... not found
...

Now we have two options:

1. Use /Developer/SDKs/MacOSX10.5.sdk instead of
/Developer/SDKs/MacOSX10.4u.sdk if the former exists.
(or maybe we can add an option to configure, allow the user to specify
which SDK he wants to use)
2. Reminds everyone who wants to build an universal binary to make
that symbol link first.

- Jiang

Reply all
Reply to author
Forward
0 new messages