[cfe-commits] r144860 - /cfe/trunk/runtime/compiler-rt/Makefile
Daniel Dunbar
daniel at zuster.org
Wed Nov 16 15:22:07 PST 2011
Author: ddunbar
Date: Wed Nov 16 17:22:07 2011
New Revision: 144860
URL: http://llvm.org/viewvc/llvm-project?rev=144860&view=rev
Log:
build/make/compiler-rt: Don't attempt to build compiler-rt runtime libraries
when cross compiling under the current organization.
- See verbose comment for explanation, justification, and how to fix.
Modified:
cfe/trunk/runtime/compiler-rt/Makefile
Modified: cfe/trunk/runtime/compiler-rt/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/runtime/compiler-rt/Makefile?rev=144860&r1=144859&r2=144860&view=diff
==============================================================================
--- cfe/trunk/runtime/compiler-rt/Makefile (original)
+++ cfe/trunk/runtime/compiler-rt/Makefile Wed Nov 16 17:22:07 2011
@@ -31,6 +31,40 @@
# Additional flags to pass to Clang.
CLANG_CCFLAGS := -no-integrated-as
+# We don't currently support building runtime libraries when we are
+# cross-compiling. The issue is that we really want to be set up so that the
+# available compiler targets are independent of the current build.
+#
+# Since we have to build the runtime libraries for the target, it requires we
+# have a cross compiler from the build machine to the target. Although in the
+# case where for the current build (host == target), we do have such a cross
+# compiler, but not defined in a way that is easy for us to reuse. Regardless,
+# that also wouldn't help for other possible compiler configurations.
+#
+# Thus, the simple set up we currently use is to assume that we will be using
+# the just built Clang to compile the compiler-rt libraries. As we grow better
+# cross compilation support inside Clang and tool support in LLVM, this makes it
+# easier for us to achieve the goal of having the compiler targets be easily
+# selected at configure time. However, this design does currently preclude the
+# building of compiler-rt libraries when the Clang itself is being cross
+# compiled.
+#
+# There are three possible solutions:
+# 1. Require building a build-target version of Clang when cross compiling. This
+# is simplest, but als greatly increases the build time of cross builds.
+#
+# 2. Require cross builds have a build-target version of Clang available for
+# use. This is a reasonable compromise on #1, as the compiler-rt libraries
+# are simple enough that there is not a strong desire to ensure they are
+# built with the exact version of Clang being used. Similarly, as Clang
+# becomes a better cross compiler it is also increasingly more likely that
+# the cross compiler being used will already be a version of Clang.
+#
+# 3. Come up with an alternate mechanism to define all the toolchain
+# information that compiler-rt would need to build libraries for all the
+# requested targets. This might be a simple short term solution, but is
+# likely to be unwieldly and irritating to maintain in the long term.
+ifneq ($(LLVM_CROSS_COMPILING),1)
ifneq ($(CLANG_NO_RUNTIME),1)
ifeq ($(shell test -d $(COMPILERRT_SRC_ROOT) && echo OK),OK)
@@ -42,7 +76,7 @@
RuntimeDirs :=
ifeq ($(OS),Darwin)
RuntimeDirs += darwin
-RuntimeLibrary.darwin.Configs = eprintf 10.4 osx ios cc_kext
+RuntimeLibrary.darwin.Configs := eprintf 10.4 osx ios cc_kext
# On Darwin, fake Clang into using the iOS assembler (since compiler-rt wants to
# build ARM bits).
@@ -52,6 +86,11 @@
endif
endif
+####
+# The build rules below are designed to be generic and should only need to be
+# modified based on changes in the compiler-rt layout or build system.
+####
+
# Rule to build the compiler-rt libraries we need.
#
# We build all the libraries in a single shot to avoid recursive make as much as
@@ -112,3 +151,4 @@
endif
endif
+endif
More information about the cfe-commits
mailing list