-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcc_42-5574.README
86 lines (75 loc) · 3.44 KB
/
gcc_42-5574.README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Apple gcc_42 5574 Linux cross-toolchain patch
Mark Mentovai
2009 March 18, 2009 August 16
THE DEAL
--------
This patch allows the Apple-customized version of gcc 4.2 to be built on Linux,
forming a portion of a cross toolchain able to produce Mac OS X binaries.
REQUIREMENTS
------------
Install both cctools and ld64 to /Developer. See cctools-698.1.README and
ld64-85.2.1.README.
Copy the appropriate Mac OS X SDK onto the Linux system. For example:
linux$ mkdir -p /Developer/SDKs
mac$ rsync -az /Developer/SDKs/MacOSX10.5.sdk/ linux:/Developer/SDKs/MacOSX10.5.sdk/
Copy additional SDKs as needed.
BUILD
-----
mkdir gcc.i386.obj
cd gcc.i386.obj
CC="gcc -m32" CXX="g++ -m32" CFLAGS="-O2" CXXFLAGS="-O2" \
PATH="${PATH}:/Developer/usr/bin" \
sh ../gcc_42-5574/configure --disable-checking --enable-werror --prefix=/usr \
--mandir=/usr/share/man --enable-languages=c,objc,c++,obj-c++ \
--program-transform-name='/^[cg][^.-]*$/s/$/-4.2/' --with-slibdir=/usr/lib \
--build=i686-pc-linux-gnu --with-gxx-include-dir=/usr/include/c++/4.0.0 \
--host=i686-pc-linux-gnu --target=i686-apple-darwin9 \
--with-sysroot=/Developer/SDKs/MacOSX10.5.sdk
PATH="${PATH}:/Developer/usr/bin" make
for i in gcc g++ ; do
gcc -m32 -O2 -I../usr_include -I../gcc_42-5574/include -I../gcc_42-5574/gcc \
-I../gcc_42-5574/gcc/config -D__LITTLE_ENDIAN__ \
"-DPDN=\"-apple-darwin9-$i-4.2.1\"" ../gcc_42-5574/driverdriver.c \
-Llibiberty -liberty -o $i-4.2
done
mkdir ../gcc.ppc.obj
cd ../gcc.ppc.obj
CC="gcc -m32" CXX="g++ -m32" CFLAGS="-O2" CXXFLAGS="-O2" \
PATH="${PATH}:/Developer/usr/bin" \
sh ../gcc_42-5574/configure --disable-checking --enable-werror --prefix=/usr \
--mandir=/usr/share/man --enable-languages=c,objc,c++,obj-c++ \
--program-transform-name='/^[cg][^.-]*$/s/$/-4.2/' --with-slibdir=/usr/lib \
--build=i686-pc-linux-gnu --with-gxx-include-dir=/usr/include/c++/4.0.0 \
--host=i686-pc-linux-gnu --target=powerpc-apple-darwin9 \
--with-sysroot=/Developer/SDKs/MacOSX10.5.sdk
PATH="${PATH}:/Developer/usr/bin" make
INSTALL
-------
cd ../gcc.i386.obj
mkdir -p /Developer/usr/bin
cp gcc/xgcc /Developer/usr/bin/i686-apple-darwin9-gcc-4.2.1
cp gcc/g++ /Developer/usr/bin/i686-apple-darwin9-g++-4.2.1
mkdir -p /Developer/usr/libexec/gcc/i686-apple-darwin9/4.2.1
cp gcc/cc1 gcc/cc1obj gcc/cc1objplus gcc/cc1plus gcc/collect2 \
/Developer/usr/libexec/gcc/i686-apple-darwin9/4.2.1
ln -sf ../../../../bin/as \
/Developer/usr/libexec/gcc/i686-apple-darwin9/4.2.1/as
ln -sf ../../../../bin/ld \
/Developer/usr/libexec/gcc/i686-apple-darwin9/4.2.1/ld
mkdir -p /Developer/usr/lib/gcc/i686-apple-darwin9
ln -sf ../../../../SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.2.1 \
/Developer/usr/lib/gcc/i686-apple-darwin9/4.2.1
cp gcc-4.2 g++-4.2 /Developer/usr/bin
cd ../gcc.ppc.obj
cp gcc/xgcc /Developer/usr/bin/powerpc-apple-darwin9-gcc-4.2.1
cp gcc/g++ /Developer/usr/bin/powerpc-apple-darwin9-g++-4.2.1
mkdir -p /Developer/usr/libexec/gcc/powerpc-apple-darwin9/4.2.1
cp gcc/cc1 gcc/cc1obj gcc/cc1objplus gcc/cc1plus gcc/collect2 \
/Developer/usr/libexec/gcc/powerpc-apple-darwin9/4.2.1
ln -sf ../../../../bin/as \
/Developer/usr/libexec/gcc/powerpc-apple-darwin9/4.2.1/as
ln -sf ../../../../bin/ld \
/Developer/usr/libexec/gcc/powerpc-apple-darwin9/4.2.1/ld
mkdir -p /Developer/usr/lib/gcc/powerpc-apple-darwin9
ln -sf ../../../../SDKs/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.2.1 \
/Developer/usr/lib/gcc/powerpc-apple-darwin9/4.2.1