From 25acbeb679e1ae0baabd013ddd005067cdde0f26 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Mon, 16 Jan 2017 09:20:28 +0100 Subject: [PATCH] Bug 1330944 - GYP: Don't require Valgrind (ct_verif) for -Dtest_build=1 r=mt Differential Revision: https://nss-review.dev.mozaws.net/D149 --HG-- extra : amend_source : f272a956650b66b9caec9df65e82711290c9c49a --- automation/taskcluster/docker-fuzz/setup.sh | 3 --- automation/taskcluster/graph/src/extend.js | 2 +- build.sh | 2 ++ coreconf/config.gypi | 1 + gtests/freebl_gtest/freebl_gtest.gyp | 8 ++++++-- gtests/freebl_gtest/mpi_unittest.cc | 2 ++ lib/freebl/freebl.gyp | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/automation/taskcluster/docker-fuzz/setup.sh b/automation/taskcluster/docker-fuzz/setup.sh index f84614ab5f..7b53316ba9 100644 --- a/automation/taskcluster/docker-fuzz/setup.sh +++ b/automation/taskcluster/docker-fuzz/setup.sh @@ -19,9 +19,6 @@ apt_packages+=('ninja-build') apt_packages+=('pkg-config') apt_packages+=('zlib1g-dev') -# ct-verif and sanitizers -apt_packages+=('valgrind') - # Latest Mercurial. apt_packages+=('mercurial') apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 41BD8711B1F0EC2B0D85B91CF59CE3A8323293EE diff --git a/automation/taskcluster/graph/src/extend.js b/automation/taskcluster/graph/src/extend.js index 1468c27502..25f2e3f2b3 100644 --- a/automation/taskcluster/graph/src/extend.js +++ b/automation/taskcluster/graph/src/extend.js @@ -368,7 +368,7 @@ async function scheduleTestBuilds() { "/bin/bash", "-c", "bin/checkout.sh && " + - "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --test" + "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --test --ct-verif" ], artifacts: { public: { diff --git a/build.sh b/build.sh index f5f4fdff00..003e1b3240 100755 --- a/build.sh +++ b/build.sh @@ -36,6 +36,7 @@ NSS build tool options: --test ignore map files and export everything we have --fuzz enable fuzzing mode. this always enables test builds --pprof build with gperftool support + --ct-verif build with valgrind for ct-verif --scan-build run the build with scan-build (scan-build has to be in the path) --scan-build=/out/path sets the output path for scan-build --asan do an asan build @@ -103,6 +104,7 @@ while [ $# -gt 0 ]; do --sancov) enable_sancov ;; --sancov=?*) enable_sancov "${1#*=}" ;; --pprof) gyp_params+=(-Duse_pprof=1) ;; + --ct-verif) gyp_params+=(-Dct_verif=1) ;; *) show_help; exit 2 ;; esac shift diff --git a/coreconf/config.gypi b/coreconf/config.gypi index ed063c60d8..b531239cf9 100644 --- a/coreconf/config.gypi +++ b/coreconf/config.gypi @@ -105,6 +105,7 @@ 'fuzz%': 0, 'sign_libs%': 1, 'use_pprof%': 0, + 'ct_verif%': 0, 'nss_public_dist_dir%': '<(nss_dist_dir)/public', 'nss_private_dist_dir%': '<(nss_dist_dir)/private', }, diff --git a/gtests/freebl_gtest/freebl_gtest.gyp b/gtests/freebl_gtest/freebl_gtest.gyp index 730520fca5..bda3806860 100644 --- a/gtests/freebl_gtest/freebl_gtest.gyp +++ b/gtests/freebl_gtest/freebl_gtest.gyp @@ -19,8 +19,12 @@ '<(DEPTH)/lib/freebl/freebl.gyp:<(freebl_name)', '<(DEPTH)/gtests/google_test/google_test.gyp:gtest', ], - 'defines': [ - 'CT_VERIF', + 'conditions': [ + [ 'ct_verif==1', { + 'defines': [ + 'CT_VERIF', + ], + }], ], } ], diff --git a/gtests/freebl_gtest/mpi_unittest.cc b/gtests/freebl_gtest/mpi_unittest.cc index c6e1404923..d465d5c5af 100644 --- a/gtests/freebl_gtest/mpi_unittest.cc +++ b/gtests/freebl_gtest/mpi_unittest.cc @@ -83,8 +83,10 @@ TEST_F(MPITest, MpiCmpConstTest) { "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632550"), 16); +#ifdef CT_VERIF mp_taint(&b); mp_taint(&c); +#endif uint32_t runs = 5000000; uint32_t time_b = 0, time_c = 0; diff --git a/lib/freebl/freebl.gyp b/lib/freebl/freebl.gyp index a98a999f8f..dc2d5f8965 100644 --- a/lib/freebl/freebl.gyp +++ b/lib/freebl/freebl.gyp @@ -233,7 +233,7 @@ 'UNSAFE_FUZZER_MODE', ], }], - [ 'test_build==1', { + [ 'ct_verif==1', { 'defines': [ 'CT_VERIF', ],