Skip to content

Commit

Permalink
travis: Add 32 bit (-m32) cross-compile build
Browse files Browse the repository at this point in the history
Inspired by Ben Pfaff's email on 32 bit build environment, this adds a
32bit build to the travis build matrix to catch alignment and padding
issues.

The 32 bit build is only enabled for non-DPDK builds as DPDK itself is
currently not capable to be compiled with -m32.

The build also has SSL disabled as the Ubuntu libssl-devel package is
not multiarch compatible on the travis build system.

Signed-off-by: Thomas Graf <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
Thomas Graf committed Feb 4, 2015
1 parent 8e04a33 commit b9aa727
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
- OPTS="--disable-ssl"
- TESTSUITE=1 KERNEL=3.18.1
- TESTSUITE=1 OPTS="--enable-shared"
- BUILD_ENV="-m32" OPTS="--disable-ssl"
- KERNEL=3.17.7 DPDK=1
- KERNEL=3.17.7 DPDK=1 OPTS="--enable-shared"
- KERNEL=3.17.7
Expand Down
8 changes: 6 additions & 2 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -o errexit

KERNELSRC=""
CFLAGS="-Werror"
SPARSE_FLAGS=""
EXTRA_OPTS=""

function install_kernel()
Expand Down Expand Up @@ -74,7 +75,7 @@ if [ "$DPDK" ]; then
EXTRA_OPTS+="--with-dpdk=./dpdk-$DPDK_VER/build"
elif [ $CC != "clang" ]; then
# DPDK headers currently trigger sparse errors
CFLAGS="$CFLAGS -Wsparse-error"
SPARSE_FLAGS="$SPARSE_FLAGS -Wsparse-error"
fi

configure_ovs $EXTRA_OPTS $*
Expand All @@ -86,8 +87,11 @@ fi

if [ $CC = "clang" ]; then
make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
elif [[ $BUILD_ENV =~ "-m32" ]]; then
# Disable sparse for 32bit builds on 64bit machine
make CFLAGS="$CFLAGS $BUILD_ENV"
else
make CFLAGS="$CFLAGS" C=1
make CFLAGS="$CFLAGS $BUILD_ENV $SPARSE_FLAGS" C=1
fi

if [ $TESTSUITE ] && [ $CC != "clang" ]; then
Expand Down
1 change: 1 addition & 0 deletions .travis/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

sudo apt-get update -qq
sudo apt-get install -qq libssl-dev llvm-dev
sudo apt-get install -qq gcc-multilib

git clone git://git.kernel.org/pub/scm/devel/sparse/chrisl/sparse.git
cd sparse && make && sudo make install PREFIX=/usr && cd ..

0 comments on commit b9aa727

Please sign in to comment.