Skip to content

Commit 45dc968

Browse files
lyakhkv2019i
authored andcommitted
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 <guennadi.liakhovetski@linux.intel.com>
1 parent a5bdcce commit 45dc968

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/module/audio/sink_api.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@
55

66
#include <module/audio/sink_api.h>
77
#include <module/audio/audio_stream.h>
8+
/*
9+
* When building native system-service modules only exported module headers can
10+
* be included, autoconf.h isn't included either. To identify such a build we
11+
* need any symbol that is guaranteed to be defined with any SOF build.
12+
* CONFIG_CORE_COUNT is such a symbol, it is always defined to an integer number
13+
*/
14+
#ifndef CONFIG_CORE_COUNT
15+
#define EXPORT_SYMBOL(...)
16+
#else
817
#include <rtos/symbol.h>
18+
#endif
919

1020
/* This file contains public sink API functions that were too large to mark is as inline. */
1121

src/module/audio/source_api.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
* Copyright(c) 2023 Intel Corporation. All rights reserved.
44
*/
55

6-
76
#include <module/audio/source_api.h>
87
#include <module/audio/audio_stream.h>
8+
/*
9+
* When building native system-service modules only exported module headers can
10+
* be included, autoconf.h isn't included either. To identify such a build we
11+
* need any symbol that is guaranteed to be defined with any SOF build.
12+
* CONFIG_CORE_COUNT is such a symbol, it is always defined to an integer number
13+
*/
14+
#ifndef CONFIG_CORE_COUNT
15+
#define EXPORT_SYMBOL(...)
16+
#else
917
#include <rtos/symbol.h>
18+
#endif
1019

1120
/* This file contains public source API functions that were too large to mark is as inline. */
1221

0 commit comments

Comments
 (0)