Commit a733581c authored by Amy Huang's avatar Amy Huang Committed by Commit Bot

Clang build.py: add zlib to linker search path so that cmake can find it

There appear to have been some changes in LLVM that affect how cmake
searches for zlib.

Bug: 1061189
Change-Id: Ie834d3b1e67bb4ed0427e788b67310d33127c6c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2101301Reviewed-by: Nico's avatarNico Weber <[email protected]>
Commit-Queue: Hans Wennborg <[email protected]>
Cr-Original-Commit-Position: refs/heads/[email protected]{#750133}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f8b71941c8cad4ef9615b08e71c50d11409b9f0a
parent 8bf2cd1b
...@@ -487,9 +487,10 @@ def main(): ...@@ -487,9 +487,10 @@ def main():
# Require zlib compression. # Require zlib compression.
zlib_dir = AddZlibToPath() zlib_dir = AddZlibToPath()
base_cmake_args.append('-DLLVM_ENABLE_ZLIB=FORCE_ON') base_cmake_args.append('-DLLVM_ENABLE_ZLIB=ON')
cflags.append('-I' + zlib_dir) cflags.append('-I' + zlib_dir)
cxxflags.append('-I' + zlib_dir) cxxflags.append('-I' + zlib_dir)
ldflags.append('-LIBPATH:' + zlib_dir)
if sys.platform == 'darwin': if sys.platform == 'darwin':
# Use the system libc++abi. # Use the system libc++abi.
...@@ -528,9 +529,12 @@ def main(): ...@@ -528,9 +529,12 @@ def main():
'-DCMAKE_INSTALL_PREFIX=' + LLVM_BOOTSTRAP_INSTALL_DIR, '-DCMAKE_INSTALL_PREFIX=' + LLVM_BOOTSTRAP_INSTALL_DIR,
'-DCMAKE_C_FLAGS=' + ' '.join(cflags), '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
'-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags), '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags),
'-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(ldflags),
'-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(ldflags),
'-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(ldflags),
# Ignore args.disable_asserts for the bootstrap compiler. # Ignore args.disable_asserts for the bootstrap compiler.
'-DLLVM_ENABLE_ASSERTIONS=ON', '-DLLVM_ENABLE_ASSERTIONS=ON',
] ]
if sys.platform == 'darwin': if sys.platform == 'darwin':
# On macOS, the bootstrap toolchain needs to have compiler-rt because # On macOS, the bootstrap toolchain needs to have compiler-rt because
# dsymutil's link needs libclang_rt.osx.a. Only the x86_64 osx # dsymutil's link needs libclang_rt.osx.a. Only the x86_64 osx
...@@ -614,9 +618,12 @@ def main(): ...@@ -614,9 +618,12 @@ def main():
'-DLLVM_ENABLE_PROJECTS=' + projects, '-DLLVM_ENABLE_PROJECTS=' + projects,
'-DCMAKE_C_FLAGS=' + ' '.join(cflags), '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
'-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags), '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags),
'-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(ldflags),
'-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(ldflags),
'-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(ldflags),
# Build with instrumentation. # Build with instrumentation.
'-DLLVM_BUILD_INSTRUMENTED=IR', '-DLLVM_BUILD_INSTRUMENTED=IR',
] ]
# Build with the bootstrap compiler. # Build with the bootstrap compiler.
if cc is not None: instrument_args.append('-DCMAKE_C_COMPILER=' + cc) if cc is not None: instrument_args.append('-DCMAKE_C_COMPILER=' + cc)
if cxx is not None: instrument_args.append('-DCMAKE_CXX_COMPILER=' + cxx) if cxx is not None: instrument_args.append('-DCMAKE_CXX_COMPILER=' + cxx)
...@@ -789,13 +796,16 @@ def main(): ...@@ -789,13 +796,16 @@ def main():
compiler_rt_args = base_cmake_args + [ compiler_rt_args = base_cmake_args + [
'-DCMAKE_C_FLAGS=' + ' '.join(cflags), '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
'-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags), '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags),
'-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(ldflags),
'-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(ldflags),
'-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(ldflags),
'-DCOMPILER_RT_BUILD_BUILTINS=OFF', '-DCOMPILER_RT_BUILD_BUILTINS=OFF',
'-DCOMPILER_RT_BUILD_CRT=OFF', '-DCOMPILER_RT_BUILD_CRT=OFF',
'-DCOMPILER_RT_BUILD_LIBFUZZER=OFF', '-DCOMPILER_RT_BUILD_LIBFUZZER=OFF',
'-DCOMPILER_RT_BUILD_PROFILE=ON', '-DCOMPILER_RT_BUILD_PROFILE=ON',
'-DCOMPILER_RT_BUILD_SANITIZERS=OFF', '-DCOMPILER_RT_BUILD_SANITIZERS=OFF',
'-DCOMPILER_RT_BUILD_XRAY=OFF', '-DCOMPILER_RT_BUILD_XRAY=OFF',
] ]
RunCommand(['cmake'] + compiler_rt_args + RunCommand(['cmake'] + compiler_rt_args +
[os.path.join(LLVM_DIR, 'llvm')], [os.path.join(LLVM_DIR, 'llvm')],
msvc_arch='x86', env=deployment_env) msvc_arch='x86', env=deployment_env)
......
...@@ -41,7 +41,7 @@ import zipfile ...@@ -41,7 +41,7 @@ import zipfile
# Reverting problematic clang rolls is safe, though. # Reverting problematic clang rolls is safe, though.
CLANG_REVISION = '9284abd0040afecfd619dbcf1b244a8b533291c9' CLANG_REVISION = '9284abd0040afecfd619dbcf1b244a8b533291c9'
CLANG_SVN_REVISION = 'n344329' CLANG_SVN_REVISION = 'n344329'
CLANG_SUB_REVISION = 5 CLANG_SUB_REVISION = 6
PACKAGE_VERSION = '%s-%s-%s' % (CLANG_SVN_REVISION, CLANG_REVISION[:8], PACKAGE_VERSION = '%s-%s-%s' % (CLANG_SVN_REVISION, CLANG_REVISION[:8],
CLANG_SUB_REVISION) CLANG_SUB_REVISION)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment