Commit b5ab35b4 authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

Clang build.py: Verify zlib support after building

Bug: 1112506
Change-Id: Ice8b1deeabb449c8cedf0f59f8688d9ac0b4a073
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339455
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795043}
parent b72d517d
......@@ -336,6 +336,26 @@ def VerifyVersionOfBuiltClangMatchesVERSION():
sys.exit(1)
def VerifyZlibSupport():
"""Check that clang was built with zlib support enabled."""
clang = os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')
test_file = '/dev/null'
if sys.platform == 'win32':
clang += '-cl.exe'
test_file = 'nul'
print('Checking for zlib support')
clang_out = subprocess.check_output([
clang, '--driver-mode=gcc', '-target', 'x86_64-unknown-linux-gnu', '-gz',
'-c', '-###', '-x', 'c', test_file ],
stderr=subprocess.STDOUT, universal_newlines=True)
if (re.search(r'--compress-debug-sections', clang_out)):
print('OK')
else:
print(('Failed to detect zlib support!\n\n(driver output: %s)') % clang_out)
sys.exit(1)
def CopyLibstdcpp(args, build_dir):
if not args.gcc_toolchain:
return
......@@ -878,6 +898,7 @@ def main():
RunCommand(['ninja', 'cr-install'], msvc_arch='x64')
VerifyVersionOfBuiltClangMatchesVERSION()
VerifyZlibSupport()
if sys.platform == 'win32':
platform = 'windows'
......
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