diff options
author | Oliver Chang <ochang@google.com> | 2018-01-24 10:39:29 +1100 |
---|---|---|
committer | Oliver Chang <ochang@google.com> | 2018-01-24 10:40:20 +1100 |
commit | f1fb0b4a6a917b842ea060e42756edb017e44c91 (patch) | |
tree | ff23222c13d461a3d23fe519c36fc940e353cc83 | |
parent | 5b7b48d7678084f1e27d4c9f5abb71e32ebe27f0 (diff) |
msan-builder: properly disable asm for gnutls and libgcrypt
-rw-r--r-- | infra/base-images/msan-builder/packages/gnutls28.py | 37 | ||||
-rw-r--r-- | infra/base-images/msan-builder/packages/libgcrypt20.py | 18 |
2 files changed, 44 insertions, 11 deletions
diff --git a/infra/base-images/msan-builder/packages/gnutls28.py b/infra/base-images/msan-builder/packages/gnutls28.py new file mode 100644 index 00000000..f8407a66 --- /dev/null +++ b/infra/base-images/msan-builder/packages/gnutls28.py @@ -0,0 +1,37 @@ +#!/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 os +import shutil + +import package +import wrapper_utils + + +class Package(package.Package): + """gnutls28 package.""" + + def __init__(self, apt_version): + super(Package, self).__init__('gnutls28', apt_version) + + def PreBuild(self, source_directory, env, custom_bin_dir): + configure_wrapper = ( + '#!/bin/bash\n' + '/usr/bin/dh_auto_configure "$@" --disable-hardware-acceleration') + + wrapper_utils.InstallWrapper( + custom_bin_dir, 'dh_auto_configure', configure_wrapper) diff --git a/infra/base-images/msan-builder/packages/libgcrypt20.py b/infra/base-images/msan-builder/packages/libgcrypt20.py index 78a976c5..9d200af6 100644 --- a/infra/base-images/msan-builder/packages/libgcrypt20.py +++ b/infra/base-images/msan-builder/packages/libgcrypt20.py @@ -19,16 +19,7 @@ import os import shutil import package - - -def AddNoAsmArg(config_path): - """Add --no-asm to config scripts.""" - shutil.move(config_path, config_path + '.real') - with open(config_path, 'w') as f: - f.write( - '#!/bin/sh\n' - '%s.real --disable-asm "$@"\n' % config_path) - os.chmod(config_path, 0755) +import wrapper_utils class Package(package.Package): @@ -38,4 +29,9 @@ class Package(package.Package): super(Package, self).__init__('libgcrypt20', apt_version) def PreBuild(self, source_directory, env, custom_bin_dir): - AddNoAsmArg(os.path.join(source_directory, 'configure')) + configure_wrapper = ( + '#!/bin/bash\n' + '/usr/bin/dh_auto_configure "$@" --disable-asm') + + wrapper_utils.InstallWrapper( + custom_bin_dir, 'dh_auto_configure', configure_wrapper) |