Backed out changeset a275000100a4 (bug 1704766) for causing build bustages CLOSED TREE

This commit is contained in:
Noemi Erli 2021-07-15 02:14:21 +03:00
Родитель a7ac37f4d9
Коммит e276a4bf18
18 изменённых файлов: 63 добавлений и 5 удалений

Просмотреть файл

@ -30,6 +30,7 @@ build-clang.py accepts a JSON config format with the following fields:
* stages: Use 1, 2, 3 or 4 to select different compiler stages. The default is 3.
* python_path: Path to the Python 2.7 installation on the machine building clang.
* gcc_dir: Path to the gcc toolchain installation, only required on Linux.
* cc: Path to the bootsraping C Compiler.
* cxx: Path to the bootsraping C++ Compiler.
* as: Path to the assembler tool.

Просмотреть файл

@ -21,6 +21,7 @@ import sys
import tarfile
from contextlib import contextmanager
from distutils.dir_util import copy_tree
from distutils.file_util import copy_file
from shutil import which
@ -166,6 +167,37 @@ def delete(path):
pass
def install_libgcc(gcc_dir, clang_dir, is_final_stage):
gcc_bin_dir = os.path.join(gcc_dir, "bin")
out = subprocess.check_output(
[os.path.join(gcc_bin_dir, "gcc"), "-print-libgcc-file-name"]
)
libgcc_dir = os.path.dirname(out.decode().rstrip())
clang_lib_dir = os.path.join(
clang_dir,
"lib",
"gcc",
"x86_64-unknown-linux-gnu",
os.path.basename(libgcc_dir),
)
mkdir_p(clang_lib_dir)
copy_tree(libgcc_dir, clang_lib_dir, preserve_symlinks=True)
libgcc_dir = os.path.join(gcc_dir, "lib64")
# This is necessary as long as CI runs on debian8 docker images.
copy_file(
os.path.join(libgcc_dir, "libstdc++.so.6"), os.path.join(clang_dir, "lib")
)
copy_tree(libgcc_dir, clang_lib_dir, preserve_symlinks=True)
libgcc_dir = os.path.join(gcc_dir, "lib32")
clang_lib_dir = os.path.join(clang_lib_dir, "32")
copy_tree(libgcc_dir, clang_lib_dir, preserve_symlinks=True)
include_dir = os.path.join(gcc_dir, "include")
clang_include_dir = os.path.join(clang_dir, "include")
copy_tree(include_dir, clang_include_dir, preserve_symlinks=True)
def install_import_library(build_dir, clang_dir):
shutil.copy2(
os.path.join(build_dir, "lib", "clang.lib"), os.path.join(clang_dir, "lib")
@ -216,6 +248,7 @@ def build_one_stage(
build_type,
assertions,
python_path,
gcc_dir,
libcxx_include_dir,
build_wasm,
compiler_rt_source_dir=None,
@ -281,10 +314,6 @@ def build_one_stage(
sysroot = os.path.join(os.environ.get("MOZ_FETCHES_DIR", ""), "sysroot")
if os.path.exists(sysroot):
cmake_args += ["-DCMAKE_SYSROOT=%s" % sysroot]
# Work around the LLVM build system not building the i386 compiler-rt
# because it doesn't allow to use a sysroot for that during the cmake
# checks.
cmake_args += ["-DCAN_TARGET_i386=1"]
if is_windows():
cmake_args.insert(-1, "-DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON")
cmake_args.insert(-1, "-DLLVM_USE_CRT_RELEASE=MT")
@ -410,6 +439,8 @@ def build_one_stage(
cmake_args += [src_dir]
build_package(build_dir, cmake_args)
if is_linux():
install_libgcc(gcc_dir, inst_dir, is_final_stage)
# For some reasons the import library clang.lib of clang.exe is not
# installed, so we copy it by ourselves.
if is_windows():
@ -715,6 +746,11 @@ if __name__ == "__main__":
if "python_path" not in config:
raise ValueError("Config file needs to set python_path")
python_path = config["python_path"]
gcc_dir = None
if "gcc_dir" in config:
gcc_dir = config["gcc_dir"].format(**os.environ)
if not os.path.exists(gcc_dir):
raise ValueError("gcc_dir must point to an existing path")
ndk_dir = None
android_targets = None
if "android_targets" in config:
@ -734,6 +770,9 @@ if __name__ == "__main__":
if not all(isinstance(t, str) for t in extra_targets):
raise ValueError("members of extra_targets should be strings")
if is_linux() and gcc_dir is None:
raise ValueError("Config file needs to set gcc_dir")
if is_darwin() or osx_cross_compile:
os.environ["MACOSX_DEPLOYMENT_TARGET"] = (
"11.0" if os.environ.get("OSX_ARCH") == "arm64" else "10.12"
@ -885,6 +924,7 @@ if __name__ == "__main__":
build_type,
assertions,
python_path,
gcc_dir,
libcxx_include_dir,
build_wasm,
is_final_stage=(stages == 1),
@ -914,6 +954,7 @@ if __name__ == "__main__":
build_type,
assertions,
python_path,
gcc_dir,
libcxx_include_dir,
build_wasm,
compiler_rt_source_dir,
@ -946,6 +987,7 @@ if __name__ == "__main__":
build_type,
assertions,
python_path,
gcc_dir,
libcxx_include_dir,
build_wasm,
compiler_rt_source_dir,
@ -987,6 +1029,7 @@ if __name__ == "__main__":
build_type,
assertions,
python_path,
gcc_dir,
libcxx_include_dir,
build_wasm,
compiler_rt_source_dir,

Просмотреть файл

@ -6,6 +6,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -4,6 +4,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -6,6 +6,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -5,6 +5,7 @@
"assertions": false,
"osx_cross_compile": true,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/clang/bin/clang",
"cxx": "{MOZ_FETCHES_DIR}/clang/bin/clang++",
"as": "{MOZ_FETCHES_DIR}/clang/bin/clang",

Просмотреть файл

@ -4,6 +4,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -6,6 +6,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -5,6 +5,7 @@
"assertions": false,
"osx_cross_compile": true,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/clang/bin/clang",
"cxx": "{MOZ_FETCHES_DIR}/clang/bin/clang++",
"as": "{MOZ_FETCHES_DIR}/clang/bin/clang",

Просмотреть файл

@ -5,6 +5,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -4,6 +4,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -4,6 +4,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -6,6 +6,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -5,6 +5,7 @@
"assertions": false,
"build_clang_tidy": true,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -5,6 +5,7 @@
"assertions": false,
"build_clang_tidy": true,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -6,6 +6,7 @@
"build_clang_tidy": true,
"osx_cross_compile": true,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/clang/bin/clang",
"cxx": "{MOZ_FETCHES_DIR}/clang/bin/clang++",
"as": "{MOZ_FETCHES_DIR}/clang/bin/clang",

Просмотреть файл

@ -5,6 +5,7 @@
"build_type": "Release",
"assertions": false,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",

Просмотреть файл

@ -72,7 +72,6 @@ linux64-toolchain-sysroot:
# For clang
- binutils-dev
- gcc-multilib
- lib32stdc++-7-dev
- libxml2-dev
# For minidump-stackwalk
- libcurl4-openssl-dev