[llvm-commits] [llvm-gcc-4.2] r140780 - in /llvm-gcc-4.2/trunk: GNUmakefile build_gcc
Bob Wilson
bob.wilson at apple.com
Thu Sep 29 00:23:23 PDT 2011
Author: bwilson
Date: Thu Sep 29 02:23:23 2011
New Revision: 140780
URL: http://llvm.org/viewvc/llvm-project?rev=140780&view=rev
Log:
Change the Apple-style build script to recognize a new RC_SUPPORTED_ARCHS
setting that specifies both the TARGETS and the ARM_MULTILIB_ARCHS.
rdar://9852476
Modified:
llvm-gcc-4.2/trunk/GNUmakefile
llvm-gcc-4.2/trunk/build_gcc
Modified: llvm-gcc-4.2/trunk/GNUmakefile
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/GNUmakefile?rev=140780&r1=140779&r2=140780&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/GNUmakefile (original)
+++ llvm-gcc-4.2/trunk/GNUmakefile Thu Sep 29 02:23:23 2011
@@ -34,6 +34,11 @@
HOSTS = $(RC_ARCHS)
targets = echo $(RC_ARCHS)
TARGETS := $(shell $(targets))
+ifneq ($(strip $(RC_SUPPORTED_ARCHS)),)
+TGT_ARCHS := $(shell echo $(RC_SUPPORTED_ARCHS))
+else
+TGT_ARCHS := $(shell echo $(TARGETS))
+endif
SRCROOT = .
@@ -102,7 +107,7 @@
exit 1; \
fi
cd $(OBJROOT) && \
- $(SRC)/llvmCore/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
+ $(SRC)/llvmCore/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TGT_ARCHS)"\
$(SRC)/llvmCore /Developer/usr/local $(DSTROOT) $(SYMROOT) \
$(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) $(INSTALL_LIBLTO) \
$(ARM_HOSTED_BUILD) $(IOS_SIM_BUILD) \
@@ -110,7 +115,7 @@
llvmgcc42: $(OBJROOT) $(SYMROOT) $(DSTROOT)
cd $(OBJROOT) && \
- $(SRC)/build_gcc "$(RC_ARCHS)" "$(TARGETS)" \
+ $(SRC)/build_gcc "$(RC_ARCHS)" "$(TGT_ARCHS)" \
$(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) $(INSTALL_LIBLTO) \
$(ENABLE_ASSERTIONS) $(LLVMCORE_PATH) \
$(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
Modified: llvm-gcc-4.2/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=140780&r1=140779&r2=140780&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/build_gcc (original)
+++ llvm-gcc-4.2/trunk/build_gcc Thu Sep 29 02:23:23 2011
@@ -15,13 +15,33 @@
# The first parameter is a space-separated list of the architectures
# the compilers will run on. For instance, "ppc i386". If the
# current machine isn't in the list, it will (effectively) be added.
-HOSTS=`echo $1 | $TRANSLATE_ARCH `
+ORIG_HOSTS=$1
+HOSTS=`echo $ORIG_HOSTS | $TRANSLATE_ARCH `
# The second parameter is a space-separated list of the architectures the
# compilers will generate code for. If the current machine isn't in
# the list, a compiler for it will get built anyway, but won't be
# installed.
-TARGETS=`echo $2 | $TRANSLATE_ARCH | $OMIT_X86_64 | sed -e s,\\',,g`
+for t in $2; do
+ if echo $t | grep arm; then
+ # Do not include a generic "arm" target in the list of ARM variants.
+ if [ "$t" != arm ]; then
+ ARM_ARCHS="$ARM_ARCHS $t"
+ fi
+ else
+ ORIG_TARGETS="$ORIG_TARGETS $t"
+ fi
+done
+# If the list of targets included specific ARM variants, e.g., as specified
+# by RC_SUPPORTED_ARCHS, then use those as list of ARM multilibs to build.
+if [ -n "$ARM_ARCHS" ]; then
+ ARM_MULTILIB_ARCHS=$ARM_ARCHS
+fi
+# Combine all the different ARM variants to a single "arm" target.
+if echo $2 | grep arm; then
+ ORIG_TARGETS="$ORIG_TARGETS arm"
+fi
+TARGETS=`echo $ORIG_TARGETS | $TRANSLATE_ARCH | $OMIT_X86_64 | sed -e s,\\',,g`
# The GNU makefile target ('bootstrap' by default).
BOOTSTRAP=${BOOTSTRAP-bootstrap}
@@ -323,10 +343,10 @@
chmod a+x $P || exit 1
done
done
-# The "as" script adds a default "-arch" option. Iterate over the lists of
-# untranslated HOSTS and TARGETS in $1 and $2 so those names can be used as
+# The "as" script adds a default "-arch" option. Iterate over the
+# ORIG_HOSTS and ORIG_TARGETS so those names can be used as
# the arguments for "-arch" in the scripts.
-for t in `echo $1 $2 | tr ' ' '\n' | sort -u`; do
+for t in `echo $ORIG_HOSTS $ORIG_TARGETS | tr ' ' '\n' | sort -u`; do
gt=`echo $t | $TRANSLATE_ARCH`
P=$DIR/bin/${gt}-apple-darwin$DARWIN_VERS-as
if [ "$gt" = "arm" -a -n "$ARM_SDK" ]; then
More information about the llvm-commits
mailing list