Skip to content

Commit

Permalink
zephyr: Update GOOGLE_RTC_AUDIO_PROCESSING
Browse files Browse the repository at this point in the history
Unbreak the Zephyr build when this is enabled, and add the needed bits
to produce a working executable.

This is mostly just a recapitulation of the existing integration,
which means that it's manually pulling in bits from the Cadence
toolchain it needs.  Really this is nothing more than a C++ library
and it shouldn't have to do anything other than enable CONFIG_CPP=y in
the build.  But the upstream Zephyr C++ toolchain integration for
xcc/xt-clang isn't present yet.

Signed-off-by: Andy Ross <[email protected]>
  • Loading branch information
andyross committed Sep 28, 2023
1 parent 31f73bf commit abd5006
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rimage
21 changes: 20 additions & 1 deletion zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ zephyr_library_sources_ifdef(CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING
zephyr_library_sources_ifdef(CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK
${SOF_AUDIO_PATH}/google/google_rtc_audio_processing_mock.c
)

zephyr_library_sources_ifdef(CONFIG_COMP_IGO_NR
${SOF_AUDIO_PATH}/igo_nr/igo_nr.c
)
Expand Down Expand Up @@ -750,6 +749,26 @@ zephyr_library_sources_ifdef(CONFIG_DW_DMA
${SOF_DRIVERS_PATH}/dw/dma.c
)

if(CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING)
zephyr_include_directories(../third_party/include)
target_link_directories(SOF INTERFACE ../third_party/lib)
target_link_libraries(SOF INTERFACE google_rtc_audio_processing)

# This isn't quite right, Zephyr should be providing a C++
# linkage environment for the toolchain, but the xcc/xt-clang
# integration isn't yet. Note we need to specify libc/libm
# because the Cadence C++ standard library is tightly coupled
# to their own libc (which is just a newlib). And I have NO
# idea why libgcc isn't on the link currently, that's a Zephyr
# mistake and I guess I'm surprised nothing else has broken.
# Needs to be cleaned up Zephyr-side.
target_link_libraries(SOF INTERFACE c++)
target_link_libraries(SOF INTERFACE c++abi)
target_link_libraries(SOF INTERFACE m)
target_link_libraries(SOF INTERFACE c)
target_link_libraries(SOF INTERFACE gcc)
endif()

zephyr_library_link_libraries(SOF)
target_link_libraries(SOF INTERFACE zephyr_interface)

Expand Down

0 comments on commit abd5006

Please sign in to comment.