summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/utils/buildit
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/utils/buildit')
-rw-r--r--contrib/llvm/utils/buildit/GNUmakefile16
-rwxr-xr-xcontrib/llvm/utils/buildit/build_llvm33
2 files changed, 33 insertions, 16 deletions
diff --git a/contrib/llvm/utils/buildit/GNUmakefile b/contrib/llvm/utils/buildit/GNUmakefile
index d17585f..54577e2 100644
--- a/contrib/llvm/utils/buildit/GNUmakefile
+++ b/contrib/llvm/utils/buildit/GNUmakefile
@@ -49,8 +49,9 @@ endif
# Default to not install libLTO.dylib.
INSTALL_LIBLTO := no
-# Default to do a native build, not a cross-build for an ARM host.
+# Default to do a native build, not a cross-build for an ARM host or simulator.
ARM_HOSTED_BUILD := no
+IOS_SIM_BUILD := no
ifndef RC_ProjectSourceVersion
RC_ProjectSourceVersion = 9999
@@ -66,11 +67,18 @@ install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
$(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
$(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
$(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) $(INSTALL_LIBLTO) \
- $(ARM_HOSTED_BUILD) \
+ $(ARM_HOSTED_BUILD) $(IOS_SIM_BUILD) \
$(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
EmbeddedHosted:
- $(MAKE) ARM_HOSTED_BUILD=yes PREFIX=/usr install
+ $(MAKE) ARM_HOSTED_BUILD=yes PREFIX=/usr/local install
+
+# When building for the iOS simulator, MACOSX_DEPLOYMENT_TARGET is not set
+# by default, but it needs to be set when building tools that run on the host
+# (e.g., tblgen), so set it here.
+EmbeddedSim:
+ export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`; \
+ $(MAKE) IOS_SIM_BUILD=yes PREFIX=$(SDKROOT)/usr/local install
# installhdrs does nothing, because the headers aren't useful until
# the compiler is installed.
@@ -120,4 +128,4 @@ clean:
$(OBJROOT) $(SYMROOT) $(DSTROOT):
mkdir -p $@
-.PHONY: install installsrc clean EmbeddedHosted
+.PHONY: install installsrc clean EmbeddedHosted EmbeddedSim
diff --git a/contrib/llvm/utils/buildit/build_llvm b/contrib/llvm/utils/buildit/build_llvm
index 37ef16e..39ec1cc 100755
--- a/contrib/llvm/utils/buildit/build_llvm
+++ b/contrib/llvm/utils/buildit/build_llvm
@@ -49,11 +49,14 @@ INSTALL_LIBLTO="$9"
# A yes/no parameter that controls whether to cross-build for an ARM host.
ARM_HOSTED_BUILD="${10}"
+# A yes/no parameter that controls whether to cross-build for the iOS simulator
+IOS_SIM_BUILD="${11}"
+
# The version number of the submission, e.g. 1007.
-LLVM_SUBMIT_VERSION="${11}"
+LLVM_SUBMIT_VERSION="${12}"
# The subversion number of the submission, e.g. 03.
-LLVM_SUBMIT_SUBVERSION="${12}"
+LLVM_SUBMIT_SUBVERSION="${13}"
# The current working directory is where the build will happen. It may already
# contain a partial result of an interrupted build, in which case this script
@@ -97,7 +100,7 @@ if [ "$ARM_HOSTED_BUILD" = yes ]; then
# Try to use the platform llvm-gcc. Fall back to gcc if it's not available.
for prog in gcc g++ ; do
P=$DIR/bin/arm-apple-darwin$DARWIN_VERS-${prog}
- T=`xcrun -find llvm-${prog}`
+ T=`xcrun -sdk $SDKROOT -find llvm-${prog}`
if [ "x$T" = "x" ] ; then
T=`xcrun -sdk $SDKROOT -find ${prog}`
fi
@@ -124,6 +127,10 @@ fi
if [ "$ARM_HOSTED_BUILD" = yes ]; then
configure_opts="--enable-targets=arm --host=arm-apple-darwin10 \
--target=arm-apple-darwin10 --build=i686-apple-darwin10"
+elif [ "$IOS_SIM_BUILD" = yes ]; then
+ # Use a non-standard "darwin_sim" host triple to trigger a cross-build.
+ configure_opts="--enable-targets=x86 --host=i686-apple-darwin_sim \
+ --build=i686-apple-darwin10"
else
configure_opts="--enable-targets=arm,x86,powerpc,cbe"
fi
@@ -317,9 +324,20 @@ if [ "$INSTALL_LIBLTO" = "yes" ]; then
mkdir -p $DT_HOME/lib
mv lib/libLTO.dylib $DT_HOME/lib/libLTO.dylib
+ # Save a copy of the unstripped dylib
+ mkdir -p $SYM_DIR/Developer/usr/lib
+ cp $DT_HOME/lib/libLTO.dylib $SYM_DIR/Developer/usr/lib/libLTO.dylib
+
# Use '-l' to strip i386 modules. N.B. that flag doesn't work with kext or
# PPC objects!
strip -arch all -Sl $DT_HOME/lib/libLTO.dylib
+
+ if [ "x$DISABLE_USR_LINKS" == "x" ]; then
+ # Add a symlink in /usr/lib for B&I.
+ mkdir -p $DEST_DIR/usr/lib/
+ (cd $DEST_DIR/usr/lib && \
+ ln -s ../../Developer/usr/lib/libLTO.dylib ./libLTO.dylib)
+ fi
else
rm -f lib/libLTO.dylib
fi
@@ -350,15 +368,6 @@ chgrp -R wheel $DEST_DIR
rm -rf $DEST_DIR$DEST_ROOT/docs
################################################################################
-# symlinks so that B&I can find things
-
-if [ "$INSTALL_LIBLTO" = "yes" ]; then
- mkdir -p $DEST_DIR/usr/lib/
- cd $DEST_DIR/usr/lib && \
- ln -s ../../Developer/usr/lib/libLTO.dylib ./libLTO.dylib
-fi
-
-################################################################################
# w00t! Done!
exit 0
OpenPOWER on IntegriCloud