msan-builder: fix boost build.

This commit is contained in:
Oliver Chang 2018-01-18 14:35:01 +11:00
parent 5aafd18141
commit 442891c4ef
3 changed files with 37 additions and 4 deletions

View File

@ -92,7 +92,7 @@ def RemoveZDefs(args):
return filtered
def GetCompilerArgs(args):
def GetCompilerArgs(args, is_cxx):
"""Generate compiler args."""
compiler_args = args[1:]
@ -125,6 +125,9 @@ def GetCompilerArgs(args):
# If MSan flags weren't added for some reason, add them here.
compiler_args.extend(msan_build.INJECTED_ARGS)
if is_cxx:
compiler_args.append('-stdlib=libc++')
return compiler_args
@ -140,7 +143,7 @@ def main(args):
if is_cxx:
real_clang += '++'
args = [real_clang] + GetCompilerArgs(args)
args = [real_clang] + GetCompilerArgs(args, is_cxx)
debug_log_path = os.getenv('WRAPPER_DEBUG_LOG_PATH')
if debug_log_path:
with open(debug_log_path, 'a') as f:

View File

@ -215,14 +215,15 @@ def GetPackage(package_name):
apt_cache = apt.Cache()
version = apt_cache[package_name].candidate
source_name = version.source_name
local_source_name = source_name.replace('.', '_')
custom_package_path = os.path.join(PACKAGES_DIR, source_name) + '.py'
custom_package_path = os.path.join(PACKAGES_DIR, local_source_name) + '.py'
if not os.path.exists(custom_package_path):
print('Using default package build steps.')
return package.Package(source_name, version)
print('Using custom package build steps.')
module = imp.load_source('packages.' + source_name, custom_package_path)
module = imp.load_source('packages.' + local_source_name, custom_package_path)
return module.Package(version)

View File

@ -0,0 +1,29 @@
#!/usr/bin/env python
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
import package
class Package(package.Package):
"""boost1.58 package."""
def __init__(self, apt_version):
super(Package, self).__init__('boost1.58', apt_version)
def PreBuild(self, source_directory, env, custom_bin_dir):
# Otherwise py_nonblocking.cpp fails to build.
env['DEB_CXXFLAGS_APPEND'] += ' -std=c++98'