summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/utils/buildit/build_llvm
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/utils/buildit/build_llvm')
-rwxr-xr-xcontrib/llvm/utils/buildit/build_llvm73
1 files changed, 43 insertions, 30 deletions
diff --git a/contrib/llvm/utils/buildit/build_llvm b/contrib/llvm/utils/buildit/build_llvm
index a9a11d9..37ef16e 100755
--- a/contrib/llvm/utils/buildit/build_llvm
+++ b/contrib/llvm/utils/buildit/build_llvm
@@ -63,16 +63,6 @@ DIR=`pwd`
DARWIN_VERS=`uname -r | sed 's/\..*//'`
echo DARWIN_VERS = $DARWIN_VERS
-DEVELOPER_DIR="${DEVELOPER_DIR-Developer}"
-if [ "$ARM_HOSTED_BUILD" = yes ]; then
- DT_HOME="$DEST_DIR/usr"
- HOST_SDKROOT=$SDKROOT
-else
- DT_HOME="$DEST_DIR/$DEVELOPER_DIR/usr"
-fi
-
-DEST_ROOT="/$DEVELOPER_DIR$DEST_ROOT"
-
################################################################################
# Run the build.
@@ -132,16 +122,14 @@ elif [ $DARWIN_VERS -gt 9 ]; then
fi
if [ "$ARM_HOSTED_BUILD" = yes ]; then
- configure_prefix=$DT_HOME
configure_opts="--enable-targets=arm --host=arm-apple-darwin10 \
--target=arm-apple-darwin10 --build=i686-apple-darwin10"
else
- configure_prefix=$DT_HOME/local
configure_opts="--enable-targets=arm,x86,powerpc,cbe"
fi
if [ \! -f Makefile.config ]; then
- $SRC_DIR/configure --prefix=$configure_prefix $configure_opts \
+ $SRC_DIR/configure --prefix=$DEST_DIR$DEST_ROOT $configure_opts \
--enable-assertions=$LLVM_ASSERTIONS \
--enable-optimized=$LLVM_OPTIMIZED \
--disable-bindings \
@@ -195,9 +183,10 @@ if [ "x$MAJ_VER" != "x4" -o "x$MIN_VER" != "x0" ]; then
fi
make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$HOSTS" \
- UNIVERSAL_SDK_PATH=$HOST_SDKROOT \
+ UNIVERSAL_SDK_PATH=$SDKROOT \
NO_RUNTIME_LIBS=1 \
DISABLE_EDIS=1 \
+ DEBUG_SYMBOLS=1 \
LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \
LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \
CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" \
@@ -223,6 +212,7 @@ cd $DIR/obj-llvm || exit 1
make $LOCAL_MAKEFLAGS $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$HOSTS" \
NO_RUNTIME_LIBS=1 \
DISABLE_EDIS=1 \
+ DEBUG_SYMBOLS=1 \
LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \
LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \
OPTIMIZE_OPTION='-O3' VERBOSE=1 install
@@ -243,14 +233,17 @@ echo "#define LLVM_MINOR_VERSION ${RC_ProjectSourceSubversion}" >> $DEST_DIR$DES
if [ "x$LLVM_DEBUG" != "x1" ]; then
# Strip local symbols from llvm libraries.
- strip -S $DEST_DIR$DEST_ROOT/lib/*.[oa]
+ #
+ # Use '-l' to strip i386 modules. N.B. that flag doesn't work with kext or
+ # PPC objects!
+ strip -Sl $DEST_DIR$DEST_ROOT/lib/*.[oa]
for f in `ls $DEST_DIR$DEST_ROOT/lib/*.so`; do
- strip -Sx $f
+ strip -Sxl $f
done
fi
# Copy over the tblgen utility.
-cp `find $DIR -name tblgen` $DT_HOME/local/bin
+cp `find $DIR -name tblgen` $DEST_DIR$DEST_ROOT/bin
# Remove .dir files
cd $DEST_DIR$DEST_ROOT
@@ -269,16 +262,8 @@ else
-exec lipo -extract ppc7400 -extract i386 -extract x86_64 {} -output {} \;
fi
-cd $DEST_DIR$DEST_ROOT
-if [ "$INSTALL_LIBLTO" == yes ]; then
- mkdir -p $DT_HOME/lib
- mv lib/libLTO.dylib $DT_HOME/lib/libLTO.dylib
- strip -S $DT_HOME/lib/libLTO.dylib
-fi
-rm -f lib/libLTO.a lib/libLTO.la
-
# The Hello dylib is an example of how to build a pass. No need to install it.
-rm lib/libLLVMHello.dylib
+rm $DEST_DIR$DEST_ROOT/lib/LLVMHello.dylib
# Compress manpages
MDIR=$DEST_DIR$DEST_ROOT/share/man/man1
@@ -324,25 +309,53 @@ find obj-* -name \*.\[chy\] -o -name \*.cpp -print \
| cpio -pdml $SYM_DIR/src || exit 1
################################################################################
+# Install and strip libLTO.dylib
+
+cd $DEST_DIR$DEST_ROOT
+if [ "$INSTALL_LIBLTO" = "yes" ]; then
+ DT_HOME="$DEST_DIR/Developer/usr"
+ mkdir -p $DT_HOME/lib
+ mv lib/libLTO.dylib $DT_HOME/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
+else
+ rm -f lib/libLTO.dylib
+fi
+rm -f lib/libLTO.a lib/libLTO.la
+
+################################################################################
# Remove debugging information from DEST_DIR.
+cd $DIR || exit 1
+
find $DEST_DIR -name \*.a -print | xargs ranlib || exit 1
find $DEST_DIR -name \*.dSYM -print | xargs rm -r || exit 1
+
+# Strip debugging information from files
+#
+# Use '-l' to strip i386 modules. N.B. that flag doesn't work with kext or
+# PPC objects!
+find $DEST_DIR -perm -0111 -type f \
+ ! \( -name '*.la' -o -name gccas -o -name gccld -o -name llvm-config \) \
+ -print | xargs -n 1 -P ${SYSCTL} strip -arch all -Sl
+
chgrp -h -R wheel $DEST_DIR
chgrp -R wheel $DEST_DIR
################################################################################
-# Remove tar ball from docs directory
+# Remove the docs directory
-find $DEST_DIR -name html.tar.gz -exec rm {} \;
+rm -rf $DEST_DIR$DEST_ROOT/docs
################################################################################
# symlinks so that B&I can find things
-if [ "$INSTALL_LIBLTO" == yes ]; then
+if [ "$INSTALL_LIBLTO" = "yes" ]; then
mkdir -p $DEST_DIR/usr/lib/
cd $DEST_DIR/usr/lib && \
- ln -s ../../$DEVELOPER_DIR/usr/lib/libLTO.dylib ./libLTO.dylib
+ ln -s ../../Developer/usr/lib/libLTO.dylib ./libLTO.dylib
fi
################################################################################
OpenPOWER on IntegriCloud