From 742b4cee78366204381d1c864d42ec744f543e0f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 22 May 2017 22:54:51 +0200 Subject: [PATCH 01/12] add clang scan-build --- .travis.yml | 4 ++++ scan_build.sh | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100755 scan_build.sh diff --git a/.travis.yml b/.travis.yml index 20bf726..80892b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,10 @@ env: BUILDSCRIPT="check_source.sh" BUILDNAME="CHECK_SOURCES" BUILDOPTIONS=" " + - | + BUILDSCRIPT="scan_build.sh" + BUILDNAME="SCAN_BUILD" + BUILDOPTIONS=" " - | BUILDSCRIPT="coverage.sh" BUILDNAME="COVERAGE" diff --git a/scan_build.sh b/scan_build.sh new file mode 100755 index 0000000..b1df43e --- /dev/null +++ b/scan_build.sh @@ -0,0 +1,9 @@ +#!/bin/bash +[ "$TRAVIS_CI" != "" ] && sudo apt-get install clang -y -qq || true + +# output version +bash printinfo.sh + +make clean > /dev/null + +scan-build make -f makefile.unix all From ff2de0b07a98709cb5774d4db378698a2b5357a8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 15:50:49 +0200 Subject: [PATCH 02/12] looks like precise doesn't have scan-build under that name ...but we should be able to find it somewhere in /usr/bin/ --- scan_build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scan_build.sh b/scan_build.sh index b1df43e..f05e8cc 100755 --- a/scan_build.sh +++ b/scan_build.sh @@ -1,9 +1,12 @@ #!/bin/bash -[ "$TRAVIS_CI" != "" ] && sudo apt-get install clang -y -qq || true +[ "$TRAVIS_CI" != "" ] && { [ -z "$(which scan-build)" ] && { echo "installing clang"; sudo apt-get install clang -y -qq; }; } || true # output version bash printinfo.sh make clean > /dev/null -scan-build make -f makefile.unix all +scan_build=$(which scan-build) +[ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true +[ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || true +$scan_build make -f makefile.unix all From 75e00e097c01c144e5f57b781d1ff428cb2f52a0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 16:14:48 +0200 Subject: [PATCH 03/12] well, then install a new clang version and see... --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 80892b5..e34ee5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,14 @@ addons: apt: sources: - debian-sid + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.7 packages: - binutils + - clang-3.7 + - cloud-utils - libtommath-dev + - util-linux before_script: - gem install coveralls-lcov From 3bb9193d6f5c3cf44e4e90c83cabcf3fea1bc65f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 16:28:37 +0200 Subject: [PATCH 04/12] alright, let's try if upgrading to trusty helps... --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e34ee5b..ec7e6c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,17 @@ +dist: trusty +sudo: required + language: c addons: apt: sources: - debian-sid - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.7 + - llvm-toolchain-trusty-4.0 packages: - binutils - - clang-3.7 - - cloud-utils + - clang-4.0 - libtommath-dev - - util-linux before_script: - gem install coveralls-lcov From ebfd164246000225f37ce94419314d01bc0f7d7e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 17:21:12 +0200 Subject: [PATCH 05/12] alright, let's also use ltm from packagecloud --- .travis.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec7e6c0..88e37d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,19 +6,16 @@ language: c addons: apt: sources: - - debian-sid - llvm-toolchain-trusty-4.0 packages: - - binutils - clang-4.0 - - libtommath-dev before_script: - gem install coveralls-lcov - curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz - export PATH=$PATH:`pwd`/lcov-1.11/bin - - curl -s https://packagecloud.io/install/repositories/libtom/tomsfastmath/script.deb.sh | sudo bash - - sudo apt-get install libtfm-dev=0.13-5 + - curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash + - sudo apt-get install libtfm-dev=0.13-5 libtommath-dev=1.0-5 matrix: fast_finish: true From 9baba0a83aca7e430f2a7ccdd54dedf208b302ad Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 17:21:46 +0200 Subject: [PATCH 06/12] fix usage of makefile.unix --- scan_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scan_build.sh b/scan_build.sh index f05e8cc..c7395ff 100755 --- a/scan_build.sh +++ b/scan_build.sh @@ -9,4 +9,4 @@ make clean > /dev/null scan_build=$(which scan-build) [ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true [ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || true -$scan_build make -f makefile.unix all +$scan_build make -f makefile.unix all CFLAGS="" EXTRALIBS="" From 52672bc358d1d346743a033d45e205e6874ab660 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 17:48:08 +0200 Subject: [PATCH 07/12] m( --- coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coverage.sh b/coverage.sh index d582f92..48ef7f1 100755 --- a/coverage.sh +++ b/coverage.sh @@ -17,8 +17,8 @@ if [ -z "$(echo $CC | grep "gcc")" ]; then exit 0 fi -if [ "$(echo $2 | grep -v 'makefile[.]')" == "" ]; then - echo "only run coverage for the regular makefile, early exit success" +if [ "$(echo $3 | grep -v 'makefile[.]')" == "" ]; then + echo "only run $0 for the regular makefile, early exit success" exit 0 fi From 1ee2662ab52c2d03cc3b818713084959a110fb68 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 17:48:21 +0200 Subject: [PATCH 08/12] only run scan_build.sh once --- scan_build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scan_build.sh b/scan_build.sh index c7395ff..05d4fde 100755 --- a/scan_build.sh +++ b/scan_build.sh @@ -1,6 +1,11 @@ #!/bin/bash [ "$TRAVIS_CI" != "" ] && { [ -z "$(which scan-build)" ] && { echo "installing clang"; sudo apt-get install clang -y -qq; }; } || true +if [ "$#" = "5" -a "$(echo $3 | grep -v 'makefile[.]')" = "" ]; then + echo "only run $0 for the regular makefile, early exit success" + exit 0 +fi + # output version bash printinfo.sh @@ -9,4 +14,4 @@ make clean > /dev/null scan_build=$(which scan-build) [ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true [ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || true -$scan_build make -f makefile.unix all CFLAGS="" EXTRALIBS="" +CFLAGS="" EXTRALIBS="" $scan_build make -f makefile.unix all CFLAGS="" EXTRALIBS="" From ba94b536bec4bf267f9f88008324b514a792401a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 18:03:15 +0200 Subject: [PATCH 09/12] this is a horrible PR --- .travis.yml | 5 +++-- scan_build.sh | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88e37d1..89eadea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,10 @@ language: c addons: apt: sources: - - llvm-toolchain-trusty-4.0 + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 packages: - - clang-4.0 + - clang-3.8 before_script: - gem install coveralls-lcov diff --git a/scan_build.sh b/scan_build.sh index 05d4fde..571ec4d 100755 --- a/scan_build.sh +++ b/scan_build.sh @@ -13,5 +13,7 @@ make clean > /dev/null scan_build=$(which scan-build) [ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true -[ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || true -CFLAGS="" EXTRALIBS="" $scan_build make -f makefile.unix all CFLAGS="" EXTRALIBS="" +[ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || echo "run $scan_build" +export CFLAGS="-DUSE_LTM -DLTM_DESC -I/usr/include" +export EXTRALIBS="-ltommath" +$scan_build make -f makefile.unix all CFLAGS="$CFLAGS" EXTRALIBS="$EXTRALIBS" From ea08fbb777f15a0e24938bdb299c4ff9f4f128d3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 18:13:00 +0200 Subject: [PATCH 10/12] use libtommath from debian sid --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 89eadea..8bd7661 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_script: - curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz - export PATH=$PATH:`pwd`/lcov-1.11/bin - curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash - - sudo apt-get install libtfm-dev=0.13-5 libtommath-dev=1.0-5 + - sudo apt-get install libtfm-dev=0.13-5 libtommath-dev=1.0-4 matrix: fast_finish: true From ac41d07247f30d31acdc4927651870a7b7b471ba Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 18:21:06 +0200 Subject: [PATCH 11/12] try libtommath from ubuntu --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8bd7661..05638bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,12 +11,16 @@ addons: packages: - clang-3.8 +install: + - sudo apt-get update -qq + - sudo apt-get install libtommath-dev + before_script: - gem install coveralls-lcov - curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz - export PATH=$PATH:`pwd`/lcov-1.11/bin - curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash - - sudo apt-get install libtfm-dev=0.13-5 libtommath-dev=1.0-4 + - sudo apt-get install libtfm-dev=0.13-5 matrix: fast_finish: true From 31ddf7c894a3fc5036ae52eec3e5a43108b39584 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 18:28:14 +0200 Subject: [PATCH 12/12] ... https://www.youtube.com/watch?v=6bbIBs0P2t0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 05638bd..77e5254 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ compiler: - gcc - clang script: - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC" "/usr/lib/x86_64-linux-gnu/libtommath.a" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC" "-ltommath" - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DTFM_DESC" "-ltfm" env: - |