diff options
author | Oliver Chang <oliverchang@users.noreply.github.com> | 2018-01-11 12:56:33 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-11 12:56:33 +1100 |
commit | 3d0c96c0876c4e89e9f48bd457f9d2c9a7ab1ca2 (patch) | |
tree | 704e8e8247bf84b6cc5ce9f5c7963d2cd5bc195e /infra/base-images | |
parent | be4e8181b64ece25c5bd93ee227a4c73e5832a9f (diff) |
Make MSan builds with instrumented libraries (#608) (#1064)
Diffstat (limited to 'infra/base-images')
-rwxr-xr-x | infra/base-images/base-builder/compile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/infra/base-images/base-builder/compile b/infra/base-images/base-builder/compile index 24143a9a..51572cec 100755 --- a/infra/base-images/base-builder/compile +++ b/infra/base-images/base-builder/compile @@ -29,9 +29,17 @@ fi if [[ $SANITIZER_FLAGS = *sanitize=memory* ]] then - # Take all libraries from lib/msan + # Take all libraries from lib/msan and MSAN_LIBS_PATH # export CXXFLAGS_EXTRA="-L/usr/msan/lib $CXXFLAGS_EXTRA" cp -R /usr/msan/lib/* /usr/lib/ + + if [[ -z "${MSAN_LIBS_PATH-}" ]]; then + echo 'WARNING: Building without MSan instrumented libraries.' + else + # Copy all static libraries only. Don't include .so files because they can + # break non MSan compiled programs. + (cd "$MSAN_LIBS_PATH" && find . -name '*.a' -exec cp --parents '{}' / ';') + fi fi # Coverage flag overrides. |