From 45dc968cb26663a5debb51e65efbfee99b31089a Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 29 Jan 2024 14:35:16 +0100 Subject: [PATCH] lmdk: fix building system-service modules System-service modules cannot include Zephyr headers and don't use exported symbols, they link sink_api.c and source_api.c into their images. Disable symbol exporting for them. Signed-off-by: Guennadi Liakhovetski --- src/module/audio/sink_api.c | 10 ++++++++++ src/module/audio/source_api.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/module/audio/sink_api.c b/src/module/audio/sink_api.c index 8bdfc99fc..a454dbb76 100644 --- a/src/module/audio/sink_api.c +++ b/src/module/audio/sink_api.c @@ -5,7 +5,17 @@ #include #include +/* + * When building native system-service modules only exported module headers can + * be included, autoconf.h isn't included either. To identify such a build we + * need any symbol that is guaranteed to be defined with any SOF build. + * CONFIG_CORE_COUNT is such a symbol, it is always defined to an integer number + */ +#ifndef CONFIG_CORE_COUNT +#define EXPORT_SYMBOL(...) +#else #include +#endif /* This file contains public sink API functions that were too large to mark is as inline. */ diff --git a/src/module/audio/source_api.c b/src/module/audio/source_api.c index e36dbdf8a..33e62fc6a 100644 --- a/src/module/audio/source_api.c +++ b/src/module/audio/source_api.c @@ -3,10 +3,19 @@ * Copyright(c) 2023 Intel Corporation. All rights reserved. */ - #include #include +/* + * When building native system-service modules only exported module headers can + * be included, autoconf.h isn't included either. To identify such a build we + * need any symbol that is guaranteed to be defined with any SOF build. + * CONFIG_CORE_COUNT is such a symbol, it is always defined to an integer number + */ +#ifndef CONFIG_CORE_COUNT +#define EXPORT_SYMBOL(...) +#else #include +#endif /* This file contains public source API functions that were too large to mark is as inline. */