Skip to content

Commit fd0174a

Browse files
gcc-5659
Imported from gcc-5659.tar.gz
1 parent 03a56dc commit fd0174a

File tree

2,014 files changed

+86741
-2503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,014 files changed

+86741
-2503
lines changed

ChangeLog.apple

+26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2009-05-27 Bob Wilson <[email protected]>
2+
3+
Radar 6915254
4+
* build_gcc: When the Legacy PDK (or whatever B&I uses) is not
5+
available, fall back to use the internal iPhone SDK with the tools
6+
from the iPhone platform directory.
7+
8+
2009-02-25 Jim Grosbach <[email protected]>
9+
10+
Radar 6611402
11+
* build_gcc (ARM_MAKEFLAGS, ARM_MULTILIB_ARCHS): New.
12+
* build_libgcc (ARM_MAKEFLAGS, ARM_MULTILIB_ARCHS): New.
13+
114
2008-10-09 Devang Patel <[email protected]>
215

316
Radar 6184418
@@ -30,6 +43,19 @@
3043
* driverdriver.c (main): Instead of aborting, print a fatal error when
3144
there is no argument after -o.
3245

46+
2008-08-07 Jim Grosbach <[email protected]>
47+
48+
* build_libgcc: enable building fat for v4/v6/v7
49+
50+
2008-06-27 Josh Conner <[email protected]>
51+
52+
* build_libgcc: s/[^-]-enable-werror/--enable-werror/
53+
Also, strip out --enable-werror for ARM builds.
54+
55+
2008-06-19 Josh Conner <[email protected]>
56+
57+
* build_gcc: s/[^-]-enable-werror/--enable-werror/g
58+
3359
2008-06-04 Josh Conner <[email protected]>
3460

3561
Radar 5961147

build_gcc

+118-23
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333
# whether the C++ driver and driver-driver are installed
3434
LANGUAGES=${LANGUAGES-c,objc,c++,obj-c++}
3535

36-
# The B&I build srcript (~rc/bin/buildit) accepts an '-othercflags'
36+
# The B&I build script (~rc/bin/buildit) accepts an '-othercflags'
3737
# command-line flag, and captures the argument to that flag in
3838
# $RC_NONARCH_CFLAGS (and mysteriously prepends '-pipe' thereto).
3939
# We will allow this to override the default $CFLAGS and $CXXFLAGS.
@@ -79,14 +79,6 @@ fi
7979
# to be built. It's VERS but only up to the second '.' (if there is one).
8080
MAJ_VERS=`echo $VERS | sed 's/\([0-9]*\.[0-9]*\)[.-].*/\1/'`
8181

82-
# APPLE LOCAL begin ARM ARM_CONFIGFLAGS
83-
# For ARM, grab all system files from an SDK.
84-
ARM_SYSROOT="/Developer/SDKs/Extra"
85-
ARM_LIBSTDCXX_VERSION=4.2.1
86-
ARM_CONFIGFLAGS="--with-build-sysroot=\"$ARM_SYSROOT\" \
87-
--with-gxx-include-dir=\${prefix}/include/c++/$ARM_LIBSTDCXX_VERSION"
88-
# APPLE LOCAL end ARM ARM_CONFIGFLAGS
89-
9082
# This is the libstdc++ version to use.
9183
LIBSTDCXX_VERSION=4.2.1
9284
if [ ! -d "$DEST_ROOT/include/c++/$LIBSTDCXX_VERSION" ]; then
@@ -97,6 +89,66 @@ NON_ARM_CONFIGFLAGS="--with-gxx-include-dir=\${prefix}/include/c++/$LIBSTDCXX_VE
9789
DARWIN_VERS=`uname -r | sed 's/\..*//'`
9890
echo DARWIN_VERS = $DARWIN_VERS
9991

92+
# APPLE LOCAL begin ARM
93+
ARM_LIBSTDCXX_VERSION=4.2.1
94+
ARM_CONFIGFLAGS="--with-gxx-include-dir=/usr/include/c++/$ARM_LIBSTDCXX_VERSION"
95+
96+
if [ -n "$ARM_SDK" ]; then
97+
98+
ARM_PLATFORM=`xcodebuild -version -sdk $ARM_SDK PlatformPath`
99+
ARM_SYSROOT=`xcodebuild -version -sdk $ARM_SDK Path`
100+
ARM_TOOLROOT=$ARM_PLATFORM/Developer
101+
102+
elif [ "x$RC_TARGET_CONFIG" = "xiPhone" ]; then
103+
104+
# If the build target is iPhone, use the iPhone SDK as the build sysroot
105+
# and use the tools from the iPhone platform directory. FIXME: This is a
106+
# temporary fallback for builds where ARM_SDK is not set. It can be removed,
107+
# along with the following bootstrap SDK fallback, when ARM_SDK is set for
108+
# all builds.
109+
ARM_PLATFORM=/Developer/Platforms/iPhoneOS.platform
110+
ARM_IPHONE_SDK=iPhoneOS${IPHONEOS_DEPLOYMENT_TARGET}.Internal.sdk
111+
112+
ARM_SYSROOT=$ARM_PLATFORM/Developer/SDKs/$ARM_IPHONE_SDK
113+
ARM_TOOLROOT=$ARM_PLATFORM/Developer
114+
115+
else
116+
117+
# Use bootstrap SDK if it is available.
118+
if [ -d /Developer/SDKs/Extra ]; then
119+
ARM_SYSROOT=/Developer/SDKs/Extra
120+
else
121+
ARM_SYSROOT=/
122+
fi
123+
ARM_TOOLROOT=/
124+
125+
fi
126+
ARM_CONFIGFLAGS="$ARM_CONFIGFLAGS --with-build-sysroot=\"$ARM_SYSROOT\""
127+
128+
# If building an ARM target, check that the required directories exist
129+
# and query the libSystem arm slices to determine which multilibs we should
130+
# build.
131+
if echo $TARGETS | grep arm; then
132+
if [ ! -d $ARM_SYSROOT ]; then
133+
echo "Error: cannot find ARM SDK to build ARM target"
134+
exit 1
135+
fi
136+
if [ ! -d $ARM_TOOLROOT ]; then
137+
echo "Error: $ARM_TOOLROOT directory is not installed"
138+
exit 1
139+
fi
140+
if [ "x$ARM_MULTILIB_ARCHS" = "x" ] ; then
141+
ARM_MULTILIB_ARCHS=`/usr/bin/lipo -info $ARM_SYSROOT/usr/lib/libSystem.dylib | cut -d':' -f 3 | sed -e 's/x86_64//' -e 's/i386//' -e 's/ppc7400//' -e 's/ppc64//' -e 's/^ *//' -e 's/ $//'`
142+
fi;
143+
if [ "x$ARM_MULTILIB_ARCHS" == "x" ] ; then
144+
echo "Error: missing ARM slices in $ARM_SYSROOT"
145+
exit 1
146+
else
147+
export ARM_MULTILIB_ARCHS
148+
fi
149+
fi
150+
# APPLE LOCAL end ARM
151+
100152
# If the user has CC set in their environment unset it now
101153
unset CC
102154

@@ -159,9 +211,9 @@ unset LANGUAGES
159211
mkdir -p $DIR/obj-$BUILD-$BUILD $DIR/dst-$BUILD-$BUILD || exit 1
160212
cd $DIR/obj-$BUILD-$BUILD || exit 1
161213
if [ \! -f Makefile ]; then
162-
$SRC_DIR/configure $bootstrap $CONFIGFLAGS \
163-
$NON_ARM_CONFIGFLAGS \
164-
--host=$BUILD-apple-darwin$DARWIN_VERS --target=$BUILD-apple-darwin$DARWIN_VERS || exit 1
214+
$SRC_DIR/configure $bootstrap $CONFIGFLAGS $NON_ARM_CONFIGFLAGS \
215+
--host=$BUILD-apple-darwin$DARWIN_VERS \
216+
--target=$BUILD-apple-darwin$DARWIN_VERS || exit 1
165217
fi
166218
# Unset RC_DEBUG_OPTIONS because it causes the bootstrap to fail.
167219
# Also keep unset for cross compilers so that the cross built libraries are
@@ -187,18 +239,34 @@ mkdir $DIR/bin || exit 1
187239
for prog in ar nm ranlib strip lipo ld ; do
188240
for t in `echo $TARGETS $HOSTS | sort -u`; do
189241
P=$DIR/bin/${t}-apple-darwin$DARWIN_VERS-${prog}
242+
# APPLE LOCAL begin toolroot
243+
if [ $t = "arm" ]; then
244+
toolroot=$ARM_TOOLROOT
245+
else
246+
toolroot=
247+
fi
248+
# APPLE LOCAL end toolroot
190249
echo '#!/bin/sh' > $P || exit 1
191-
echo 'exec /usr/bin/'${prog}' "$@"' >> $P || exit 1
250+
# APPLE LOCAL insert toolroot below
251+
echo 'exec '${toolroot}'/usr/bin/'${prog}' "$@"' >> $P || exit 1
192252
chmod a+x $P || exit 1
193253
done
194254
done
195255
for t in `echo $1 $2 | sort -u`; do
196256
gt=`echo $t | $TRANSLATE_ARCH`
197257
P=$DIR/bin/${gt}-apple-darwin$DARWIN_VERS-as
258+
# APPLE LOCAL begin toolroot
259+
if [ $gt = "arm" ]; then
260+
toolroot=$ARM_TOOLROOT
261+
else
262+
toolroot=
263+
fi
264+
# APPLE LOCAL end toolroot
198265
echo '#!/bin/sh' > $P || exit 1
199266

200-
echo 'for a; do case $a in -arch) exec /usr/bin/as "$@";; esac; done' >> $P || exit 1
201-
echo 'exec /usr/bin/as -arch '${t}' "$@"' >> $P || exit 1
267+
# APPLE LOCAL insert toolroot below
268+
echo 'for a; do case $a in -arch) exec '${toolroot}'/usr/bin/as "$@";; esac; done' >> $P || exit 1
269+
echo 'exec '${toolroot}'/usr/bin/as -arch '${t}' "$@"' >> $P || exit 1
202270
chmod a+x $P || exit 1
203271
done
204272
PATH=$DIR/bin:$PATH
@@ -219,17 +287,26 @@ for t in $CROSS_TARGETS ; do
219287
cd $DIR/obj-$BUILD-$t || exit 1
220288
if [ \! -f Makefile ]; then
221289
# APPLE LOCAL begin ARM ARM_CONFIGFLAGS
222-
$SRC_DIR/configure $CONFIGFLAGS --enable-werror-always \
223-
`if [ $t = 'arm' ] ; then echo $ARM_CONFIGFLAGS ; else echo $NON_ARM_CONFIGFLAGS ; fi` \
290+
T_CONFIGFLAGS="$CONFIGFLAGS --enable-werror-always \
224291
--program-prefix=$t-apple-darwin$DARWIN_VERS- \
225-
--host=$BUILD-apple-darwin$DARWIN_VERS --target=$t-apple-darwin$DARWIN_VERS || exit 1
292+
--host=$BUILD-apple-darwin$DARWIN_VERS \
293+
--target=$t-apple-darwin$DARWIN_VERS"
294+
if [ $t = 'arm' ] ; then
295+
# Explicitly set AS_FOR_TARGET and LD_FOR_TARGET to avoid picking up
296+
# older versions from the gcc installed in /usr. Radar 7230843.
297+
AS_FOR_TARGET=$DIR/bin/${t}-apple-darwin$DARWIN_VERS-as \
298+
LD_FOR_TARGET=$DIR/bin/${t}-apple-darwin$DARWIN_VERS-ld \
299+
$SRC_DIR/configure $T_CONFIGFLAGS $ARM_CONFIGFLAGS || exit 1
300+
else
301+
$SRC_DIR/configure $T_CONFIGFLAGS $NON_ARM_CONFIGFLAGS || exit 1
302+
fi
226303
# APPLE LOCAL end ARM ARM_CONFIGFLAGS
227304
fi
228305
make $MAKEFLAGS all CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
229306
make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$t install-gcc install-target \
230307
CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
231308

232-
# Add the compiler we just built to the path.
309+
# Add the compiler we just built to the path.
233310
PATH=$DIR/dst-$BUILD-$t/usr/bin:$PATH
234311
fi
235312
done
@@ -263,12 +340,25 @@ for h in $HOSTS ; do
263340

264341
if [ \! -f Makefile ]; then
265342
# APPLE LOCAL begin ARM ARM_CONFIGFLAGS
266-
$SRC_DIR/configure $CONFIGFLAGS \
267-
`if [ $t = 'arm' ] && [ $h != 'arm' ] ; then echo $ARM_CONFIGFLAGS ; else echo $NON_ARM_CONFIGFLAGS ; fi` \
268-
--program-prefix=$pp \
269-
--host=$h-apple-darwin$DARWIN_VERS --target=$t-apple-darwin$DARWIN_VERS || exit 1
343+
T_CONFIGFLAGS="$CONFIGFLAGS --program-prefix=$pp \
344+
--host=$h-apple-darwin$DARWIN_VERS \
345+
--target=$t-apple-darwin$DARWIN_VERS"
346+
if [ $t = 'arm' ] && [ $h != 'arm' ] ; then
347+
T_CONFIGFLAGS="$T_CONFIGFLAGS $ARM_CONFIGFLAGS"
348+
else
349+
T_CONFIGFLAGS="$T_CONFIGFLAGS $NON_ARM_CONFIGFLAGS"
350+
fi
351+
$SRC_DIR/configure $T_CONFIGFLAGS || exit 1
270352
# APPLE LOCAL end ARM ARM_CONFIGFLAGS
271353
fi
354+
355+
# For ARM, we need to make sure it picks up the ARM_TOOLROOT versions
356+
# of the linker and cctools.
357+
if [ $t = 'arm' ] ; then
358+
ORIG_COMPILER_PATH=$COMPILER_PATH
359+
export COMPILER_PATH=$ARM_TOOLROOT/usr/bin:$COMPILER_PATH
360+
fi
361+
272362
if [ $h = $t ] ; then
273363
make $MAKEFLAGS all CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
274364
make $MAKEFLAGS DESTDIR=$DIR/dst-$h-$t install-gcc install-target \
@@ -278,6 +368,11 @@ for h in $HOSTS ; do
278368
make $MAKEFLAGS DESTDIR=$DIR/dst-$h-$t install-gcc \
279369
CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
280370
fi
371+
372+
if [ $t = 'arm' ] ; then
373+
export COMPILER_PATH=$ORIG_COMPILER_PATH
374+
unset ORIG_COMPILER_PATH
375+
fi
281376
done
282377
fi
283378
done

0 commit comments

Comments
 (0)