Merge pull request #110 from jajanusz/ut-makefile-fix

configure: fix flags for unit tests
This commit is contained in:
Liam Girdwood 2018-07-16 19:46:22 +01:00 committed by GitHub
commit 20204a9cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -89,13 +89,13 @@ case "$with_arch" in
# automake FLAGS defined here # automake FLAGS defined here
AM_CFLAGS="-fno-inline-functions -nostdlib -mlongcalls" AM_CFLAGS="-fno-inline-functions -nostdlib -mlongcalls"
AM_LDFLAGS="-nostdlib" AM_LDFLAGS=""
AM_CCASFLAGS="-fno-inline-functions -nostdlib -mlongcalls" AM_CCASFLAGS=""
# GCC needs these additional flags on top of any user flags. # GCC needs these additional flags on top of any user flags.
CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes" CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes"
LDFLAGS="${LDFLAGS:+$LDFLAGS } ${AM_LDFLAGS}" LDFLAGS="${LDFLAGS:+$LDFLAGS } -nostdlib"
CCASFLAGS="${CCASFLAGS:+$CCASFLAGS } ${AM_CCASFLAGS}" CCASFLAGS="${CCASFLAGS:+$CCASFLAGS } -fno-inline-functions -nostdlib -mlongcalls"
ARCH="xtensa" ARCH="xtensa"
AC_SUBST(ARCH) AC_SUBST(ARCH)

View File

@ -6,6 +6,9 @@ if BUILD_XTENSA
LOG_COMPILER = xt-run LOG_COMPILER = xt-run
endif endif
# cmocka needs stdlib
override LDFLAGS := $(filter-out -nostdlib,$(LDFLAGS))
override AM_CFLAGS := \ override AM_CFLAGS := \
$(filter-out -nostdlib,$(AM_CFLAGS)) \ $(filter-out -nostdlib,$(AM_CFLAGS)) \
$(SOF_INCDIR) $(SOF_INCDIR)