Skip to content

Commit a2acc88

Browse files
committed
configure: gcc: make sure CFLAGS and LDFLAGS are set correctly.
GCC needs flags set correctly in order to pass AC_PROG_CC test. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 295d0c1 commit a2acc88

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

configure.ac

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ AC_DEFINE_UNQUOTED([SOF_MICRO], sof_micro, [Sof micro version])
1818

1919
AC_CANONICAL_HOST
2020

21-
# General compiler flags
22-
CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes"
23-
2421
# General assembler flags
2522
ASFLAGS="-DASSEMBLY"
2623
AC_SUBST(ASFLAGS)
@@ -94,6 +91,11 @@ case "$with_arch" in
9491
AM_LDFLAGS="-nostdlib"
9592
AM_CCASFLAGS="-fno-inline-functions -nostdlib -mlongcalls"
9693

94+
# GCC needs these additional flags on top of any user flags.
95+
CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes"
96+
LDFLAGS="${LDFLAGS:+$LDFLAGS } ${AM_LDFLAGS}"
97+
CCASFLAGS="${CCASFLAGS:+$CCASFLAGS } ${AM_CCASFLAGS}"
98+
9799
ARCH="xtensa"
98100
AC_SUBST(ARCH)
99101

0 commit comments

Comments
 (0)