Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ AC_DEFINE_UNQUOTED([SOF_MICRO], sof_micro, [Sof micro version])

AC_CANONICAL_HOST

# General compiler flags
CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes"

# General assembler flags
ASFLAGS="-DASSEMBLY"
AC_SUBST(ASFLAGS)
Expand Down Expand Up @@ -68,6 +65,7 @@ AM_CONDITIONAL(BUILD_LIB, test "$have_library" = "yes")
AC_ARG_ENABLE(rimage, [AS_HELP_STRING([--enable-rimage],[build rimage tool])], have_rimage=$enableval, have_rimage=no)
if test "$have_rimage" = "yes"; then
AC_DEFINE([CONFIG_RIMAGE], [1], [Configure to build rimage])
AM_CFLAGS="-O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes"
fi
AM_CONDITIONAL(BUILD_RIMAGE, test "$have_rimage" = "yes")

Expand All @@ -94,6 +92,11 @@ case "$with_arch" in
AM_LDFLAGS="-nostdlib"
AM_CCASFLAGS="-fno-inline-functions -nostdlib -mlongcalls"

# GCC needs these additional flags on top of any user flags.
CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes"
LDFLAGS="${LDFLAGS:+$LDFLAGS } ${AM_LDFLAGS}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't put AM_* flags in user FLAGS, cos it will cause duplication, flags should be in LDFLAGS if is forced or in AM_LDFLAGS otherwise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AC_PROG_CC needs correct CFLAGS etc otherwise compiler is sane check fails. AC_PROG_CC needs and expects a target C library (which we don't need).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CFLAGS are ok I meant LDFLAGS/CCASFLAGS ;)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, can you fix them and add to your unit test build script PR.

CCASFLAGS="${CCASFLAGS:+$CCASFLAGS } ${AM_CCASFLAGS}"

ARCH="xtensa"
AC_SUBST(ARCH)

Expand All @@ -107,9 +110,9 @@ case "$with_arch" in
ARCH_CFLAGS="-g"

# automake FLAGS defined here
AM_CFLAGS="-O3"
AM_CFLAGS="-O3 -Wall -Werror -Wl,-EL -Wmissing-prototypes"
AM_LDFLAGS="-lpthread"
AM_CCASFLAGS="-O3"
AM_CCASFLAGS="-O3 -Wall -Werror -Wl,-EL -Wmissing-prototypes"

ARCH="host"
AC_SUBST(ARCH)
Expand Down
2 changes: 1 addition & 1 deletion src/audio/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if BUILD_HOST
# common linker flags for host libs
host_lib_ldflags = \
$(AM_LDFLAGS) \
-version-info `echo $(VERSION) | cut -d '.' -f 1` \
-version-info `echo $(VERSION) | cut -d '.' -f 1 | cut -d '0' -f 2` \
-no-undefined \
-export-dynamic

Expand Down
2 changes: 1 addition & 1 deletion src/ipc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ libsof_ipc_la_SOURCES = \

libsof_ipc_la_LDFLAGS = \
$(AM_LDFLAGS) \
-version-info `echo $(VERSION) | cut -d '.' -f 1` \
-version-info `echo $(VERSION) | cut -d '.' -f 1 | cut -d '0' -f 2` \
-no-undefined \
-export-dynamic

Expand Down