From ea0a4c2ae2b713b3fa1f23a46e84835da8ab8de8 Mon Sep 17 00:00:00 2001 From: jdh8d <jdh8d@git.zephyr-software.com> Date: Sun, 6 Dec 2015 02:48:40 +0000 Subject: [PATCH] Added Diehard heap randomization integration --- .gitattributes | 2 ++ build-all.sh | 21 +++++++++++++-------- build_diehard.sh | 15 +++++++++++++++ clean-all.sh | 3 +++ clean_diehard.sh | 5 +++++ 5 files changed, 38 insertions(+), 8 deletions(-) create mode 100755 build_diehard.sh create mode 100755 clean_diehard.sh diff --git a/.gitattributes b/.gitattributes index b7d99216f..37e62a9f6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,9 @@ * text=auto !eol /build-all.sh -text +/build_diehard.sh -text /cfar_postgres_setup.sh -text /clean-all.sh -text +/clean_diehard.sh -text /get-peasoup-packages.sh -text /irdb_vars -text /postgres_setup.sh -text diff --git a/build-all.sh b/build-all.sh index 901ae5951..ce85496a0 100755 --- a/build-all.sh +++ b/build-all.sh @@ -10,7 +10,7 @@ if [ "$PEASOUP_UMBRELLA_DIR" != "$FULL_BUILD_LOC" ]; then exit 1; fi -if [ `basename $BUILD_LOC` == "cfar_umbrella" ]; then +if [ `basename $FULL_BUILD_LOC` == "cfar_umbrella" ]; then cfar_mode="--enable-cfar" fi @@ -101,11 +101,16 @@ cd $IRDB_TRANSFORMS scons || exit - -if [ `basename $BUILD_LOC` == "cfar_umbrella" ]; then - mkdir -p lib - cd DieHard/src - make linux-gcc-x86-64 - cd $PEASOUP_UMBRELLA_DIR - cp DieHard/src/libdiehard.so lib +cd $PEASOUP_UMBRELLA_DIR +if [ -d DieHard ]; then + ./build_diehard.sh fi + +cd $PEASOUP_UMBRELLA_DIR + + +echo +echo +echo "Overall build complete." +echo +echo diff --git a/build_diehard.sh b/build_diehard.sh new file mode 100755 index 000000000..041fa5a21 --- /dev/null +++ b/build_diehard.sh @@ -0,0 +1,15 @@ +#!/bin/bash + + +if [ ! -f DieHard/src/libdiehard.so ]; then + + sed -i "s|/dev/urandom|/dev/cfar_urandom|" \ + DieHard/src/archipelago/benchmarks/pine4.64/imap/src/osdep/unix/ssl_unix.c \ + DieHard/src/include/rng/realrandomvalue.h \ + DieHard/src/exterminator/src/realrandomvalue.h + cd DieHard/src + make linux-gcc-x86-64 +fi + +echo Diehard Build complete. + diff --git a/clean-all.sh b/clean-all.sh index 978dc7e67..8bcb909af 100755 --- a/clean-all.sh +++ b/clean-all.sh @@ -48,3 +48,6 @@ if [ -d $ZIPR_HOME ]; then cd $ZIPR_HOME scons -c || exit fi + +cd $PEASOUP_UMBRELLA_DIR +./clean_diehard.sh diff --git a/clean_diehard.sh b/clean_diehard.sh new file mode 100755 index 000000000..c62db6d60 --- /dev/null +++ b/clean_diehard.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +\rm -f DieHard/src/libdiehard.so + +echo Diehard cleaned. -- GitLab