Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio: xtensa: add Kconfig for inline functions #8033

Merged
merged 4 commits into from
Aug 18, 2023
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
7 changes: 7 additions & 0 deletions Kconfig.sof
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ config COMPILER_WORKAROUND_CACHE_ATTR
There is a weird optimization bug with gcc10x and gcc8.1
(with -O2 flags) on IMX platforms. See PR #4605.

config COMPILER_INLINE_FUNCTION_OPTION
bool
default y if CAVS_VERSION_2_5 || ACE
default n
help
When enabled, -fno-inline-function option is not passed to compiler

rsource "src/Kconfig"

# See zephyr/modules/Kconfig
Expand Down
6 changes: 5 additions & 1 deletion src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ else()
endif()
btian1 marked this conversation as resolved.
Show resolved Hide resolved

# C & ASM flags
target_compile_options(sof_options INTERFACE ${stdlib_flag} -fno-inline-functions ${XTENSA_C_ASM_FLAGS})
if(CONFIG_COMPILER_INLINE_FUNCTION_OPTION)
target_compile_options(sof_options INTERFACE ${stdlib_flag} ${XTENSA_C_ASM_FLAGS})
btian1 marked this conversation as resolved.
Show resolved Hide resolved
else()
target_compile_options(sof_options INTERFACE ${stdlib_flag} -fno-inline-functions ${XTENSA_C_ASM_FLAGS})
endif()

# C flags
# TODO: Generator expressions are supported only with Make and Ninja,
Expand Down
2 changes: 2 additions & 0 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ static int dai_verify_params(struct dai_data *dd, struct comp_dev *dev,
struct sof_ipc_stream_params hw_params;
int ret;

memset(&hw_params, 0, sizeof(hw_params));

ret = dai_common_get_hw_params(dd, dev, &hw_params, params->direction);
if (ret < 0) {
comp_err(dev, "dai_verify_params(): dai_verify_params failed ret %d", ret);
Expand Down
3 changes: 2 additions & 1 deletion zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,9 @@ set(VERSION_H_PATH ${GENERATED_DIRECTORY}/sof_versions.h)
find_package(Python3 COMPONENTS Interpreter)
set(PYTHON3 "${Python3_EXECUTABLE}")

# We don't know why we have this https://github.com/thesofproject/sof/issues/5212
if (NOT CONFIG_COMPILER_INLINE_FUNCTION_OPTION)
target_compile_options(SOF INTERFACE -fno-inline-functions)
endif()

# SOF needs `typeof`, `__VA_ARGS__` and maybe other GNU C99
# extensions. TODO other flags required ?
Expand Down