From 7cfb7aab73c4f4813db4d87d192825360920873e Mon Sep 17 00:00:00 2001 From: Catena cyber <35799796+catenacyber@users.noreply.github.com> Date: Thu, 9 Jan 2020 16:46:31 +0100 Subject: [PATCH] Silence unsigned integer overflows in binutils project (#3178) * Silence unsigned integer overflows in binutils * Use fno-sanitize * Condition on sanitizer --- projects/binutils/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/binutils/build.sh b/projects/binutils/build.sh index c5476fda5..1ca33515b 100755 --- a/projects/binutils/build.sh +++ b/projects/binutils/build.sh @@ -16,6 +16,10 @@ ################################################################################ # build project +if [ "$SANITIZER" = undefined ]; then + export CFLAGS="$CFLAGS -fsanitize=unsigned-integer-overflow -fno-sanitize-recover=unsigned-integer-overflow" + export CXXFLAGS="$CXXFLAGS -fsanitize=unsigned-integer-overflow -fno-sanitize-recover=unsigned-integer-overflow" +fi cd binutils-gdb ./configure --disable-gdb --enable-targets=all make MAKEINFO=true && true