mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 761421 - Upgrade clang to 158160. r=rail.
Add support for OS X in the build script. DONTBUILD
This commit is contained in:
parent
1b59bf2aea
commit
f6a345edce
@ -13,6 +13,7 @@ import os.path
|
||||
import shutil
|
||||
import tarfile
|
||||
import subprocess
|
||||
import platform
|
||||
|
||||
def check_run(args):
|
||||
r = subprocess.call(args)
|
||||
@ -46,7 +47,7 @@ def with_env(env, f):
|
||||
|
||||
def build_tar_package(tar, name, base, directory):
|
||||
name = os.path.realpath(name)
|
||||
run_in(base, [tar, "-cjf", name, "--owner=root", directory])
|
||||
run_in(base, [tar, "-cjf", name, directory])
|
||||
|
||||
def svn_co(url, directory, revision):
|
||||
check_run(["svn", "co", "-r", revision, url, directory])
|
||||
@ -83,6 +84,8 @@ def build_one_stage_aux(stage_dir, is_stage_one):
|
||||
|
||||
build_package(llvm_source_dir, build_dir, configure_opts)
|
||||
|
||||
isDarwin = platform.system() == "Darwin"
|
||||
|
||||
if not os.path.exists(source_dir):
|
||||
os.makedirs(source_dir)
|
||||
svn_co("http://llvm.org/svn/llvm-project/llvm/trunk",
|
||||
@ -93,8 +96,12 @@ if not os.path.exists(source_dir):
|
||||
compiler_rt_source_dir, llvm_revision)
|
||||
os.symlink("../../clang", llvm_source_dir + "/tools/clang")
|
||||
os.symlink("../../compiler-rt", llvm_source_dir + "/projects/compiler-rt")
|
||||
patch("old-ld-hack.patch", 1, llvm_source_dir)
|
||||
patch("compiler-rt-gnu89-inline.patch", 0, compiler_rt_source_dir)
|
||||
if isDarwin:
|
||||
patch("clang-no-ios.patch", 0, clang_source_dir)
|
||||
patch("compiler-rt-no-ios.patch", 0, compiler_rt_source_dir)
|
||||
else:
|
||||
patch("old-ld-hack.patch", 1, llvm_source_dir)
|
||||
patch("compiler-rt-gnu89-inline.patch", 0, compiler_rt_source_dir)
|
||||
|
||||
if os.path.exists(build_dir):
|
||||
shutil.rmtree(build_dir)
|
||||
@ -102,13 +109,28 @@ os.makedirs(build_dir)
|
||||
|
||||
stage1_dir = build_dir + '/stage1'
|
||||
stage1_inst_dir = stage1_dir + '/clang'
|
||||
build_one_stage({"CC" : "/tools/gcc-4.5-0moz3/bin/gcc -static-libgcc",
|
||||
"CXX" : "/tools/gcc-4.5-0moz3/bin/g++ -static-libgcc -static-libstdc++"},
|
||||
|
||||
if isDarwin:
|
||||
extra_cflags = ""
|
||||
extra_cxxflags = ""
|
||||
cc = "/usr/bin/clang"
|
||||
cxx = "/usr/bin/clang++"
|
||||
else:
|
||||
extra_cflags = "-static-libgcc"
|
||||
extra_cxxflags = "-static-libgcc -static-libstdc++"
|
||||
cc = "/tools/gcc-4.5-0moz3/bin/gcc %s" % extra_cflags
|
||||
cxx = "/tools/gcc-4.5-0moz3/bin/g++ %s" % extra_cxxflags
|
||||
|
||||
build_one_stage({"CC" : cc,
|
||||
"CXX" : cxx },
|
||||
stage1_dir, True)
|
||||
|
||||
if not isDarwin:
|
||||
extra_cflags += " -fgnu89-inline"
|
||||
|
||||
stage2_dir = build_dir + '/stage2'
|
||||
build_one_stage({"CC" : stage1_inst_dir + "/bin/clang -static-libgcc -fgnu89-inline",
|
||||
"CXX" : stage1_inst_dir + "/bin/clang++ -static-libgcc -static-libstdc++"},
|
||||
build_one_stage({"CC" : stage1_inst_dir + "/bin/clang %s" % extra_cflags,
|
||||
"CXX" : stage1_inst_dir + "/bin/clang++ %s" % extra_cxxflags},
|
||||
stage2_dir, False)
|
||||
|
||||
build_tar_package("/bin/tar", "clang.tar.bz2", stage2_dir, "clang")
|
||||
build_tar_package("tar", "clang.tar.bz2", stage2_dir, "clang")
|
||||
|
15
build/unix/build-clang/clang-no-ios.patch
Normal file
15
build/unix/build-clang/clang-no-ios.patch
Normal file
@ -0,0 +1,15 @@
|
||||
Index: runtime/compiler-rt/Makefile
|
||||
===================================================================
|
||||
--- runtime/compiler-rt/Makefile (revision 157958)
|
||||
+++ runtime/compiler-rt/Makefile (working copy)
|
||||
@@ -74,8 +74,8 @@
|
||||
ifeq ($(OS),Darwin)
|
||||
RuntimeDirs += darwin
|
||||
RuntimeLibrary.darwin.Configs := \
|
||||
- eprintf 10.4 osx ios cc_kext \
|
||||
- asan_osx profile_osx profile_ios
|
||||
+ eprintf 10.4 osx \
|
||||
+ asan_osx profile_osx
|
||||
endif
|
||||
|
||||
# On Linux, include a library which has all the runtime functions.
|
29
build/unix/build-clang/compiler-rt-no-ios.patch
Normal file
29
build/unix/build-clang/compiler-rt-no-ios.patch
Normal file
@ -0,0 +1,29 @@
|
||||
Index: make/platform/clang_darwin.mk
|
||||
===================================================================
|
||||
--- make/platform/clang_darwin.mk (revision 157958)
|
||||
+++ make/platform/clang_darwin.mk (working copy)
|
||||
@@ -47,7 +47,7 @@
|
||||
# Configuration for targetting iOS, for some ARMv6 functions, which must be
|
||||
# in the same linkage unit, and for a couple of other functions that didn't
|
||||
# make it into libSystem.
|
||||
-Configs += ios
|
||||
+#Configs += ios
|
||||
UniversalArchs.ios := $(call CheckArches,i386 x86_64 armv6 armv7,ios)
|
||||
|
||||
# Configuration for targetting OSX. These functions may not be in libSystem
|
||||
@@ -56,13 +56,13 @@
|
||||
UniversalArchs.osx := $(call CheckArches,i386 x86_64,osx)
|
||||
|
||||
# Configuration for use with kernel/kexts.
|
||||
-Configs += cc_kext
|
||||
+#Configs += cc_kext
|
||||
UniversalArchs.cc_kext := $(call CheckArches,armv6 armv7 i386 x86_64,cc_kext)
|
||||
|
||||
# Configurations which define the profiling support functions.
|
||||
Configs += profile_osx
|
||||
UniversalArchs.profile_osx := $(call CheckArches,i386 x86_64,profile_osx)
|
||||
-Configs += profile_ios
|
||||
+#Configs += profile_ios
|
||||
UniversalArchs.profile_ios := $(call CheckArches,i386 x86_64 armv6 armv7,profile_ios)
|
||||
|
||||
# Configurations which define the ASAN support functions.
|
Loading…
Reference in New Issue
Block a user