From 1d24a9dc61954a091ac74bbe2827e22d4ae5aeb9 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 27 Jan 2019 16:13:34 +0100 Subject: [PATCH 1/5] qa.sh: Fix incomplete link flags for Address Sanitizer Prefix "-Wc," is fot libtool, see https://www.gnu.org/software/libtool/manual/libtool.html#Stripped-link-flags --- expat/qa.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/expat/qa.sh b/expat/qa.sh index ccd2e56d..95daf222 100755 --- a/expat/qa.sh +++ b/expat/qa.sh @@ -16,6 +16,7 @@ set -o nounset : ${MAKE:=make} : ${BASE_COMPILE_FLAGS:="-pipe -Wall -Wextra -pedantic -Wno-overlength-strings -Wno-long-long"} +: ${BASE_LINK_FLAGS:=} ANNOUNCE() { local open='\e[1m' @@ -44,6 +45,7 @@ main() { local CC="${CLANG_CC}" local CXX="${CLANG_CXX}" BASE_COMPILE_FLAGS+=" -g -fsanitize=address -fno-omit-frame-pointer" + BASE_LINK_FLAGS+=" -g -Wc,-fsanitize=address" # "-Wc," is for libtool ;; coverage | lib-coverage | app-coverage) local CC="${GCC_CC}" @@ -78,6 +80,7 @@ main() { local CFLAGS="-std=c89 ${BASE_COMPILE_FLAGS} ${CFLAGS:-}" local CXXFLAGS="-std=c++98 ${BASE_COMPILE_FLAGS} ${CXXFLAGS:-}" + local LDFLAGS="${BASE_LINK_FLAGS} ${LDFLAGS:-}" ( set -e @@ -85,7 +88,7 @@ main() { RUN CC="${CC}" CFLAGS="${CFLAGS}" \ CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \ AR="${AR}" \ - LD="${LD}" \ + LD="${LD}" LDFLAGS="${LDFLAGS}" \ ./configure "$@" RUN "${MAKE}" \ From 9aaaac076ab3f8ead296c2709956f107e4510959 Mon Sep 17 00:00:00 2001 From: Stephen Date: Wed, 27 Sep 2017 09:50:18 -0700 Subject: [PATCH 2/5] Travis CI: Test OSX Use Brewfile for dependencies --- .travis.yml | 13 ++++++++++++- Brewfile | 12 ++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Brewfile diff --git a/.travis.yml b/.travis.yml index 62b5f982..b626bdbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ # Licensed under the MIT license language: cpp +os: + - linux + - osx dist: trusty # Unbreak clang address sanitizer, needs SYS_PTRACE @@ -14,7 +17,7 @@ git: env: global: - - CFLAGS='-g -pipe' + - CFLAGS='-g -pipe' PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" matrix: - MODE=address - MODE=cmake @@ -22,7 +25,15 @@ env: - MODE=distcheck - MODE=lib-coverage +matrix: + exclude: + - os: osx + env: MODE=lib-coverage + addons: + homebrew: + update: true + brewfile: true apt: packages: - cmake diff --git a/Brewfile b/Brewfile new file mode 100644 index 00000000..47e2bb47 --- /dev/null +++ b/Brewfile @@ -0,0 +1,12 @@ +brew "automake" +brew "autoconf" +brew "libtool" +brew "cmake" +brew "docbook2x" +brew "rpm" +brew "coreutils" +brew "ghostscript" +brew "gcc" +brew "m4" +brew "gettext" +brew "dos2unix" From d95d78721d68d8254c619e1284ba85eae97f5e91 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 27 Jan 2019 16:24:24 +0100 Subject: [PATCH 3/5] Travis CI: Keep macOS $PATH away from Linux --- .travis.sh | 4 ++++ .travis.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.sh b/.travis.sh index a9034583..24c7c3a4 100755 --- a/.travis.sh +++ b/.travis.sh @@ -30,6 +30,10 @@ set -e +if [[ ${TRAVIS_OS_NAME} = osx ]]; then + export PATH="/usr/local/opt/coreutils/libexec/gnubin${PATH:+:}${PATH}" +fi + PS4='# ' set -x diff --git a/.travis.yml b/.travis.yml index b626bdbc..d9aa2562 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ git: env: global: - - CFLAGS='-g -pipe' PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" + - CFLAGS='-g -pipe' matrix: - MODE=address - MODE=cmake From 75fbe10f71220528b9dc14a31a2919d1c4c1f501 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 27 Jan 2019 17:08:36 +0100 Subject: [PATCH 4/5] qa.sh: Dump config.log for configure failures --- expat/qa.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/expat/qa.sh b/expat/qa.sh index 95daf222..6a26976f 100755 --- a/expat/qa.sh +++ b/expat/qa.sh @@ -89,7 +89,8 @@ main() { CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \ AR="${AR}" \ LD="${LD}" LDFLAGS="${LDFLAGS}" \ - ./configure "$@" + ./configure "$@" \ + || { RUN cat config.log ; false ; } RUN "${MAKE}" \ CFLAGS="${CFLAGS} -Werror" \ From 6e29a8bbaf94c3acda75d66b81b9d1ed4a0c13af Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 27 Jan 2019 17:30:01 +0100 Subject: [PATCH 5/5] qa.sh: Link with clang for Address Sanitizer --- expat/qa.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/expat/qa.sh b/expat/qa.sh index 6a26976f..02159ec9 100755 --- a/expat/qa.sh +++ b/expat/qa.sh @@ -44,6 +44,7 @@ main() { # http://clang.llvm.org/docs/AddressSanitizer.html local CC="${CLANG_CC}" local CXX="${CLANG_CXX}" + local LD="${CLANG_CXX}" BASE_COMPILE_FLAGS+=" -g -fsanitize=address -fno-omit-frame-pointer" BASE_LINK_FLAGS+=" -g -Wc,-fsanitize=address" # "-Wc," is for libtool ;;