diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
| commit | bca07a4524feb4edec581062d631a13116320a24 (patch) | |
| tree | a9243275843fbeaa590afc07ee888e006b8d54ea /runtime | |
| parent | 998bc5802ecdd65ce3b270f6c69a8ae8557f0a10 (diff) | |
Notes
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | runtime/Makefile | 16 | ||||
| -rw-r--r-- | runtime/libcxx/Makefile | 63 |
3 files changed, 88 insertions, 3 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt new file mode 100644 index 000000000000..68ee266ecae9 --- /dev/null +++ b/runtime/CMakeLists.txt @@ -0,0 +1,12 @@ +# TODO: Set the install directory. + +set(known_subdirs + "compiler-rt" + "libcxx" + ) + +foreach (dir ${known_subdirs}) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/CMakeLists.txt) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${dir}) + endif() +endforeach() diff --git a/runtime/Makefile b/runtime/Makefile index 0e8b359123b1..375f312debd1 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -28,7 +28,10 @@ PROJ_resources_lib := $(PROJ_resources)/lib # Expect compiler-rt to be in llvm/projects/compiler-rt COMPILERRT_SRC_ROOT := $(LLVM_SRC_ROOT)/projects/compiler-rt -ifndef CLANG_NO_RUNTIME +# Additional flags to pass to Clang. +CLANG_CCFLAGS := -no-integrated-as + +ifneq ($(CLANG_NO_RUNTIME),1) ifeq ($(shell test -d $(COMPILERRT_SRC_ROOT) && echo OK),OK) # Select the compiler-rt configuration to use, and install directory. @@ -39,7 +42,14 @@ ifeq ($(shell test -d $(COMPILERRT_SRC_ROOT) && echo OK),OK) RuntimeDirs := ifeq ($(OS),Darwin) RuntimeDirs += darwin -RuntimeLibrary.darwin.Configs = 10.4 armv6 cc_kext +RuntimeLibrary.darwin.Configs = eprintf 10.4 armv6 cc_kext + +# On Darwin, fake Clang into using the iOS assembler (since compiler-rt wants to +# build ARM bits). +ifeq ($(OS),Darwin) +CLANG_CCFLAGS += -ccc-install-dir \ + /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ +endif endif # Rule to build the compiler-rt libraries we need. @@ -50,7 +60,7 @@ BuildRuntimeLibraries: $(Verb) $(MAKE) -C $(COMPILERRT_SRC_ROOT) \ ProjSrcRoot=$(COMPILERRT_SRC_ROOT) \ ProjObjRoot=$(PROJ_OBJ_DIR) \ - CC="$(ToolDir)/clang -no-integrated-as" \ + CC="$(ToolDir)/clang $(CLANG_CCFLAGS)" \ $(RuntimeDirs:%=clang_%) .PHONY: BuildRuntimeLibraries CleanRuntimeLibraries: diff --git a/runtime/libcxx/Makefile b/runtime/libcxx/Makefile new file mode 100644 index 000000000000..10d4e9bb8455 --- /dev/null +++ b/runtime/libcxx/Makefile @@ -0,0 +1,63 @@ +##===- clang/runtime/libcxx/Makefile -----------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +# +# This file defines support for building the "libc++" C++ standard library as +# part of a Clang compiler build. +# +##===----------------------------------------------------------------------===## + +CLANG_LEVEL := ../.. +LEVEL := $(CLANG_LEVEL)/../.. +LIBRARYNAME = c++ + +LINK_LIBS_IN_SHARED = 1 +SHARED_LIBRARY = 1 + +# Include LLVM common makefile. +include $(LEVEL)/Makefile.config + +# Expect libcxx to be in llvm/projects/libcxx +LIBCXX_SRC_ROOT := $(LLVM_SRC_ROOT)/projects/libcxx + +# Override the source root to point at the libcxx sources. +PROJ_MAKEFILE := $(PROJ_SRC_DIR)/Makefile +PROJ_SRC_DIR := $(LIBCXX_SRC_ROOT)/src +CPP.Flags := -nostdinc++ -I$(LIBCXX_SRC_ROOT)/include +CXX.Flags := -std=c++0x + +# Include LLVM makefile rules. +include $(LLVM_SRC_ROOT)/Makefile.rules + +# Force building with the just built Clang. +# +# FIXME: Do we really want to do this? It is uber slow. +# CXX := $(ToolDir)/clang + +ifeq ($(HOST_OS),Darwin) + LLVMLibsOptions += -Wl,-compatibility_version,1 + + # Don't link with default libraries. + LLVMLibsOptions += -nodefaultlibs + + # Reexport libc++abi. + LLVMLibsOptions += -Wl,-reexport_library,/usr/lib/libc++abi.dylib + + # Set dylib internal version number to submission number. + ifdef LLVM_SUBMIT_VERSION + LLVMLibsOptions += -Wl,-current_version \ + -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) + endif + + # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line + DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') + ifneq ($(DARWIN_VERS),8) + LLVMLibsOptions += -Wl,-install_name \ + -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)" + endif +endif |
