Skip to content

Commit

Permalink
Sets -Wno-error=address-of-packed-member built with GCC9
Browse files Browse the repository at this point in the history
See also frugalos#10.
  • Loading branch information
shinnya committed Jul 27, 2019
1 parent 199c96e commit c1cc1a2
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 33 deletions.
173 changes: 169 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,180 @@ rust:
before_script:
- rustup component add clippy-preview

before_install:
- echo "MATRIX_EVAL=${MATRIX_EVAL}"
- echo "CC=$CC"
- echo "CXX=$CXX"
- eval "${MATRIX_EVAL}"

script:
- cargo test -- --test-threads=1
- cargo clippy

env:
global:
- RUSTFLAGS="-D warnings"

addons:
apt:
packages:
- make
- autoconf
- autoconf-archive # for AX_CHECK_COMPILE_FLAG
- automake
- libtool
homebrew:
update: true
packages:
- make
- autoconf
- autoconf-archive
- automake
- libtool

matrix:
allow_failures:
- rust: beta
- rust: nightly

env:
global:
- RUSTFLAGS="-D warnings"
include:
# GCC on Linux
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- make
- autoconf
- autoconf-archive
- automake
- libtool
env:
- MATRIX_EVAL="CC=gcc-4.8 CXX=g++-4.8"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
- make
- autoconf
- autoconf-archive
- automake
- libtool
env:
- MATRIX_EVAL="CC=gcc-4.9 CXX=g++-4.9"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- make
- autoconf
- autoconf-archive
- automake
- libtool
env:
- MATRIX_EVAL="CC=gcc-9 CXX=g++-9"
# Clang on Linux
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-4.0
packages:
- clang-4.0
- make
- autoconf
- autoconf-archive
- automake
- libtool
env:
- MATRIX_EVAL="CC=clang-4.0 CXX=clang++-4.0"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-5.0
packages:
- clang-5.0
- make
- autoconf
- autoconf-archive
- automake
- libtool
env:
- MATRIX_EVAL="CC=clang-5.0 CXX=clang++-5.0"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-6.0
packages:
- clang-6.0
- make
- autoconf
- autoconf-archive
- automake
- libtool
env:
- MATRIX_EVAL="CC=clang-6.0 CXX=clang++-6.0"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- clang-7
- make
- autoconf
- autoconf-archive
- automake
- libtool
env:
- MATRIX_EVAL="CC=clang-7 CXX=clang++-7"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- clang-8
- make
- autoconf
- autoconf-archive
- automake
- libtool
env:
- MATRIX_EVAL="CC=clang-8 CXX=clang++-8"
# Clang on macOS
- os: osx
osx_image: xcode10.2
- os: osx
osx_image: xcode9.4
- os: osx
osx_image: xcode8
# GCC on macOS
- os: osx
osx_image: xcode8
env:
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- os: osx
osx_image: xcode9.4
env:
- MATRIX_EVAL="brew install gcc && CC=gcc-8 && CXX=g++-8"
- os: osx
osx_image: xcode9.4
env:
- MATRIX_EVAL="brew install gcc && CC=gcc-9 && CXX=g++-9"
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() {
for file in &[
"install_deps.sh",
"liberasurecode.patch",
"for_darwin_to_detect_compiler_flag.patch",
"liberasurecode_configure_ac.patch",
] {
fs::copy(file, build_dir.join(file)).unwrap();
}
Expand Down
23 changes: 0 additions & 23 deletions for_darwin_to_detect_compiler_flag.patch

This file was deleted.

8 changes: 3 additions & 5 deletions install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ cd ../
git clone https://github.com/openstack/liberasurecode.git
cd liberasurecode/
git checkout 1.5.0
if [ "$(uname)" == "Darwin" ]; then
# if the compiler has the feature to check `address-of-packed-member`, we suppress it.
# it is only annoying for liberasurecode v1.5.0.
patch -p1 < ../for_darwin_to_detect_compiler_flag.patch
fi
# if the compiler has the feature to check `address-of-packed-member`, we suppress it.
# it is only annoying for liberasurecode v1.5.0.
patch -p1 < ../liberasurecode_configure_ac.patch
./autogen.sh
CFLAGS="-I${BUILD_DIR}/jerasure/include -I${BUILD_DIR}/include"
CFLAGS=$CFLAGS LIBS="-lJerasure" LDFLAGS="-L${BUILD_DIR}/lib" ./configure --disable-shared --with-pic --prefix $BUILD_DIR
Expand Down
16 changes: 16 additions & 0 deletions liberasurecode_configure_ac.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/configure.ac b/configure.ac
index 16d4dc4..6614878 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,6 +146,11 @@ fi
AC_SUBST(GCOV_FLAGS)
AC_SUBST(GCOV_LDFLAGS)

+# Check if a compiler supports "-Wno-error=address-of-packed-member"
+# If it supports the option, we add it to CFLAGS.
+AX_CHECK_COMPILE_FLAG([-Wno-error=address-of-packed-member],
+ [CFLAGS="${CFLAGS} -Wno-error=address-of-packed-member"])
+
dnl Expand the sources and objects needed to build the library
AC_SUBST(ac_aux_dir)
AC_SUBST(OBJECTS)

0 comments on commit c1cc1a2

Please sign in to comment.