Skip to content

Commit a2433e0

Browse files
tejlmandcarlescufi
authored andcommitted
cmake: removing manual linking of libgcc.a
This commit removes the manual lookup and linking of libgcc.a. Linking of C and runtime libraries are the responsibility of the higher level build system which handles the toolchain and building of the executable. Current sidewalk implementation is broken in the sense that it fails to consider the CPU architecture and just looks up any libgcc.a file. For example the code might discover `arm-zephyr-eabi/12.2.0/libgcc.a` when instead `arm-zephyr-eabi/12.2.0/thumb/v8-m.main+fp/hard/libgcc.a` should be used, and thus causiong link errors such as: > error: /.../12.2.0/libgcc.a(_arm_muldf3.o): > conflicting CPU architectures 17/2 and: > error: zephyr/zephyr_pre0.elf uses VFP register arguments, > /.../12.2.0/libgcc.a(_fixunsdfdi.o) does not Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent 5131d3d commit a2433e0

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

lib/cortex-m33/lora_fsk/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66

77
set(SID_LIB_DIR ${ZEPHYR_BASE}/../sidewalk/lib/cortex-m33/lora_fsk)
88

9-
set(GCC_LIB_DIR ${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi/lib/gcc/arm-zephyr-eabi)
10-
find_library(LIB_GCC NAMES gcc libgcc.a HINTS ${GCC_LIB_DIR}/* REQUIRED)
11-
12-
zephyr_library_link_libraries(${SID_LIB_DIR}/libsid_protocol_all.a
13-
${LIB_GCC}
14-
)
9+
zephyr_library_link_libraries(${SID_LIB_DIR}/libsid_protocol_all.a)
1510

1611
zephyr_link_libraries_ifndef(CONFIG_SIDEWALK_PAL_RADIO_SOURCE ${SID_LIB_DIR}/libsid_pal_radio_sx126x_impl.a)

lib/cortex-m4/lora_fsk/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66

77
set(SID_LIB_DIR ${ZEPHYR_BASE}/../sidewalk/lib/cortex-m4/lora_fsk)
88

9-
set(GCC_LIB_DIR ${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi/lib/gcc/arm-zephyr-eabi)
10-
find_library(LIB_GCC NAMES gcc libgcc.a HINTS ${GCC_LIB_DIR}/* REQUIRED)
119

12-
zephyr_library_link_libraries(${SID_LIB_DIR}/libsid_protocol_all.a
13-
${LIB_GCC}
14-
)
10+
zephyr_library_link_libraries(${SID_LIB_DIR}/libsid_protocol_all.a)
1511

1612
zephyr_link_libraries_ifndef(CONFIG_SIDEWALK_PAL_RADIO_SOURCE ${SID_LIB_DIR}/libsid_pal_radio_sx126x_impl.a)

0 commit comments

Comments
 (0)