diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-11-16 23:22:07 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-11-16 23:22:07 +0000 |
commit | a8c9886dccedc532abd9cb607278868f1c2b165d (patch) | |
tree | 41bdb5044c9b7d26e991b293fbb5b6ab680090d2 | |
parent | b65dbfff527537c10406632e14ecd94b8896a042 (diff) | |
download | bcm5719-llvm-a8c9886dccedc532abd9cb607278868f1c2b165d.tar.gz bcm5719-llvm-a8c9886dccedc532abd9cb607278868f1c2b165d.zip |
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.
llvm-svn: 144860
-rw-r--r-- | clang/runtime/compiler-rt/Makefile | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/clang/runtime/compiler-rt/Makefile b/clang/runtime/compiler-rt/Makefile index 8888556738a..8963c393f38 100644 --- a/clang/runtime/compiler-rt/Makefile +++ b/clang/runtime/compiler-rt/Makefile @@ -31,6 +31,40 @@ COMPILERRT_SRC_ROOT := $(LLVM_SRC_ROOT)/projects/compiler-rt # 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 @@ ifeq ($(shell test -d $(COMPILERRT_SRC_ROOT) && echo OK),OK) 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 @@ CLANG_CCFLAGS += -ccc-install-dir \ 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 @@ clean-local:: CleanRuntimeLibraries endif endif +endif |