Skip to content

Commit 7cab926

Browse files
almusilnumansiddique
authored andcommitted
ci: Use CFLAGS instead of OVS_CFLAGS
The OVS_CFLAGS variable is for internal use only. Use regular CFLAGS instead. This also has the effect of correctly propagating the flags, when the OVS_CFLAGS variable was used the -O1 was in the overwritten by autoconf defaulting to -O2. Signed-off-by: Ales Musil <[email protected]> Acked-by: Mark Michelson <[email protected]> Signed-off-by: Numan Siddique <[email protected]>
1 parent ee9134f commit 7cab926

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

.ci/linux-build.sh

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,23 @@
33
set -o errexit
44
set -x
55

6-
CFLAGS=""
6+
COMMON_CFLAGS=""
77
OVN_CFLAGS=""
8-
SPARSE_FLAGS=""
98
EXTRA_OPTS="--enable-Werror"
109

1110
function configure_ovs()
1211
{
1312
pushd ovs
14-
./boot.sh && ./configure $* || { cat config.log; exit 1; }
13+
./boot.sh && ./configure CFLAGS="${COMMON_CFLAGS}" $* || \
14+
{ cat config.log; exit 1; }
1515
make -j4 || { cat config.log; exit 1; }
1616
popd
1717
}
1818

1919
function configure_ovn()
2020
{
2121
configure_ovs $*
22-
23-
export OVS_CFLAGS="${OVS_CFLAGS} ${OVN_CFLAGS}"
24-
./boot.sh && ./configure $* || \
22+
./boot.sh && ./configure CFLAGS="${COMMON_CFLAGS} ${OVN_CFLAGS}" $* || \
2523
{ cat config.log; exit 1; }
2624
}
2725

@@ -33,21 +31,19 @@ OPTS="${EXTRA_OPTS} ${save_OPTS}"
3331
# OVS, to make sanitizer reports user friendly.
3432
if [ "$SANITIZERS" ]; then
3533
# Use the default options configured in tests/atlocal.in, in UBSAN_OPTIONS.
36-
CFLAGS="-O1 -fno-omit-frame-pointer -fno-common -g"
37-
CFLAGS_SANITIZERS="-fsanitize=address,undefined"
38-
OVN_CFLAGS="${OVN_CFLAGS} ${CFLAGS_SANITIZERS}"
34+
COMMON_CFLAGS="${COMMON_CFLAGS} -O1 -fno-omit-frame-pointer -fno-common -g"
35+
OVN_CFLAGS="${OVN_CFLAGS} -fsanitize=address,undefined"
3936
fi
4037

4138
if [ "$CC" = "clang" ]; then
42-
export OVS_CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
39+
COMMON_CFLAGS="${COMMON_CFLAGS} -Wno-error=unused-command-line-argument"
4340
elif [ "$M32" ]; then
4441
# Not using sparse for 32bit builds on 64bit machine.
45-
# Adding m32 flag directly to CC to avoid any posiible issues with API/ABI
42+
# Adding m32 flag directly to CC to avoid any possible issues with API/ABI
4643
# difference on 'configure' and 'make' stages.
4744
export CC="$CC -m32"
4845
else
4946
OPTS="$OPTS --enable-sparse"
50-
export OVS_CFLAGS="$CFLAGS $SPARSE_FLAGS"
5147
fi
5248

5349
if [ "$TESTSUITE" ]; then
@@ -65,7 +61,9 @@ if [ "$TESTSUITE" ]; then
6561
configure_ovn
6662

6763
export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
68-
if ! make distcheck -j4 TESTSUITEFLAGS="-j4" RECHECK=yes; then
64+
if ! make distcheck CFLAGS="${COMMON_CFLAGS} ${OVN_CFLAGS}" -j4 \
65+
TESTSUITEFLAGS="-j4" RECHECK=yes
66+
then
6967
# testsuite.log is necessary for debugging.
7068
cat */_build/sub/tests/testsuite.log
7169
exit 1

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
OPTS: ${{ matrix.opts }}
2626
TESTSUITE: ${{ matrix.testsuite }}
2727
SANITIZERS: ${{ matrix.sanitizers }}
28-
CFLAGS: ${{ matrix.cflags }}
2928

3029
name: linux ${{ join(matrix.*, ' ') }}
3130
runs-on: ubuntu-20.04
@@ -46,7 +45,6 @@ jobs:
4645
- compiler: clang
4746
testsuite: test
4847
sanitizers: sanitizers
49-
cflags: -g
5048

5149
- compiler: gcc
5250
testsuite: test

0 commit comments

Comments
 (0)