diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2019-10-03 13:45:29 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2019-10-04 19:37:28 +0200 |
commit | aa135fb9b164b37ac1f7c131e8018253904806ef (patch) | |
tree | 25fcd2d2cd8049f332340edd8f98524185874ba7 /.travis | |
parent | ae05d68139e44820155d55c685f127066d340c50 (diff) | |
download | openvswitch-aa135fb9b164b37ac1f7c131e8018253904806ef.tar.gz |
ci: Get rid of OVS_CFLAGS in CI scripts.
Our CI scripts uses OVS_CFLAGS variable that is intended for internal
usage by 'configure' script only. Usual CFLAGS should be used instead
to avoid giving bad example to users.
Additionally, '-m32' flag passed directly to CC variable to avoid
splitting it from the compiler invocations and force same API/ABI for
invocations of 'configure' and 'make'.
'BUILD_ENV' dropped as not needed anymore.
Before this patch 'configure' always checked for 64bit libraries
regardless of fact that we're going to build 32bit binary. This
caused issues if only 64bit version of desired library was available.
Suggested-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to '.travis')
-rwxr-xr-x | .travis/linux-build.sh | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index 89496e2a2..758c8235c 100755 --- a/.travis/linux-build.sh +++ b/.travis/linux-build.sh @@ -3,7 +3,7 @@ set -o errexit set -x -CFLAGS="" +CFLAGS_FOR_OVS="-g -O2" SPARSE_FLAGS="" EXTRA_OPTS="--enable-Werror" TARGET="x86_64-native-linuxapp-gcc" @@ -116,7 +116,8 @@ function install_dpdk() function configure_ovs() { - ./boot.sh && ./configure $* || { cat config.log; exit 1; } + ./boot.sh + ./configure CFLAGS="${CFLAGS_FOR_OVS}" $* || { cat config.log; exit 1; } } function build_ovs() @@ -147,18 +148,20 @@ if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then install_dpdk $DPDK_VER if [ "$CC" = "clang" ]; then # Disregard cast alignment errors until DPDK is fixed - CFLAGS="$CFLAGS -Wno-cast-align" + CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -Wno-cast-align" fi fi if [ "$CC" = "clang" ]; then - export OVS_CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument" -elif [[ $BUILD_ENV =~ "-m32" ]]; then - # Disable sparse for 32bit builds on 64bit machine - export OVS_CFLAGS="$CFLAGS $BUILD_ENV" + CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -Wno-error=unused-command-line-argument" +elif [ "$M32" ]; then + # Not using sparse for 32bit builds on 64bit machine. + # Adding m32 flag directly to CC to avoid any posiible issues with API/ABI + # difference on 'configure' and 'make' stages. + export CC="$CC -m32" else OPTS="--enable-sparse" - export OVS_CFLAGS="$CFLAGS $BUILD_ENV $SPARSE_FLAGS" + CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${SPARSE_FLAGS}" fi save_OPTS="${OPTS} $*" @@ -170,7 +173,8 @@ if [ "$TESTSUITE" ]; then configure_ovs export DISTCHECK_CONFIGURE_FLAGS="$OPTS" - if ! make distcheck TESTSUITEFLAGS=-j4 RECHECK=yes; then + if ! make distcheck CFLAGS="${CFLAGS_FOR_OVS}" \ + TESTSUITEFLAGS=-j4 RECHECK=yes; then # testsuite.log is necessary for debugging. cat */_build/sub/tests/testsuite.log exit 1 |