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

cmake: removing manual linking of libgcc.a #654

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

tejlmand
Copy link
Contributor

@tejlmand tejlmand commented Dec 4, 2024

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

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]>
@tejlmand tejlmand force-pushed the issues/libgcc_linking_main branch from 2e310ad to a5fde13 Compare December 4, 2024 11:34
Copy link

github-actions bot commented Dec 4, 2024

Sample diff used total
nrf54l15dk/nrf54l15/cpuapp:sample.sidewalk.demo RAM 0 B 121.65 KB 0 B
ROM -4 B 456.23 KB 0 B
nrf54l15dk/nrf54l15/cpuapp:sample.sidewalk.demo.ble_only RAM 0 B 106.6 KB 0 B
ROM -4 B 378.48 KB 0 B
nrf54l15dk/nrf54l15/cpuapp:sample.sidewalk.dut RAM 0 B 145.4 KB 0 B
ROM -4 B 522.69 KB 0 B
nrf54l15dk/nrf54l15/cpuapp:sample.sidewalk.dut.ble_only RAM 0 B 130.29 KB 0 B
ROM -4 B 444.41 KB 0 B
nrf54l15dk/nrf54l15/cpuapp:sample.sidewalk.dut.no_secure RAM 0 B 145.38 KB 0 B
ROM -4 B 515 KB 0 B
nrf54l15dk/nrf54l15/cpuapp:sample.sidewalk.hello RAM 0 B 123.09 KB 0 B
ROM -4 B 471.53 KB 0 B
nrf54l15dk/nrf54l15/cpuapp:sample.sidewalk.hello.ble_only RAM 0 B 96.64 KB 0 B
ROM -4 B 376.78 KB 0 B
nrf54l15dk/nrf54l15/cpuapp:sample.sidewalk.hello.ble_only.release RAM 0 B 92.01 KB 0 B
ROM -4 B 305.35 KB 0 B
nrf54l15dk/nrf54l15/cpuapp:sample.sidewalk.hello.release RAM 0 B 107.07 KB 0 B
ROM -4 B 381.23 KB 0 B
nrf54l15dk/nrf54l10/cpuapp:sample.sidewalk.demo RAM 0 B 121.65 KB 0 B
ROM 36 B 456.21 KB 0 B
nrf54l15dk/nrf54l10/cpuapp:sample.sidewalk.demo.ble_only RAM 0 B 106.6 KB 0 B
ROM 36 B 378.45 KB 0 B
nrf54l15dk/nrf54l10/cpuapp:sample.sidewalk.dut RAM 0 B 145.4 KB 0 B
ROM 36 B 522.66 KB 0 B
nrf54l15dk/nrf54l10/cpuapp:sample.sidewalk.dut.ble_only RAM 0 B 130.29 KB 0 B
ROM 36 B 444.38 KB 0 B
nrf54l15dk/nrf54l10/cpuapp:sample.sidewalk.dut.no_secure RAM 0 B 145.38 KB 0 B
ROM 36 B 514.97 KB 0 B
nrf54l15dk/nrf54l10/cpuapp:sample.sidewalk.hello RAM 0 B 123.09 KB 0 B
ROM 36 B 471.49 KB 0 B
nrf54l15dk/nrf54l10/cpuapp:sample.sidewalk.hello.ble_only RAM 0 B 96.64 KB 0 B
ROM 36 B 376.75 KB 0 B
nrf54l15dk/nrf54l10/cpuapp:sample.sidewalk.hello.ble_only.release RAM 0 B 92.01 KB 0 B
ROM 36 B 305.32 KB 0 B
nrf54l15dk/nrf54l10/cpuapp:sample.sidewalk.hello.release RAM 0 B 107.07 KB 0 B
ROM 36 B 381.19 KB 0 B

@carlescufi carlescufi merged commit a2433e0 into nrfconnect:main Dec 4, 2024
56 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sid-lib PR changing Sidewalk libraries source PR changing src files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants