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

Decrease compile time with nanostack-libservice #379

Conversation

ccli8
Copy link

@ccli8 ccli8 commented Nov 4, 2024

Summary of changes

nanostack-libservice involves two parts: common (e.g. libip4string) and nanostack-specific (e.g. nvmHelper). For nanostack-specific, it needs to link nanostack hal and will pull in 200+ nanostack files for compile. This is unnecessary for common only application e.g. lwipstack. To fix this, the following strategy is applied for nanostack-libservice cmake listfile:

  1. For compiling nanostack-specific, it doesn't rely on nanostack hal because its needed header file has placed underneath (mbed-client-libservice/platform).
  2. For application needing the nanostack-specific, the nanostack cmake listfile shall specify the link dependency.

This actually rolls back #378 on this line


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

nanostack-libservice involves two parts: common (e.g. libip4string) and
nanostack-specific (e.g. nvmHelper). For nanostack-specific, it needs to
link nanostack hal and will pull in 200+ nanostack files for compile.
This is unnecessary for common only application e.g. lwipstack. To fix this,
the following strategy is applied for nanostack-libservice cmake listfile:
1.  For compiling nanostack-specific, it doesn't rely on nanostack hal
    because its needed header file has placed underneath
    (mbed-client-libservice/platform).
2.  For application needing the nanostack-specific, the nanostack cmake
    listfile shall specify the link dependency.
@ccli8 ccli8 force-pushed the nanostack-libservice_decrease_compile_time branch from 354dd7f to 63c0db7 Compare November 4, 2024 05:47
@multiplemonomials
Copy link
Collaborator

Ah yeah. I believe I added this dependency because mbed-nanostack-libservice contains arm_hal_interrupt.h, but the corresponding functions are actually implemented in arm_hal_interrupt.c which is part of mbed-nanostack-hal_mbed_cmsis_rtos. So, you get an undefined reference if you just use those functions without also linking mbed-nanostack-hal_mbed_cmsis_rtos, which feels gross. But still, you're right that this pulls in a large dependency which I did not mean to do -- nice catch! Since it built OK, I am alright to merge this for now, though I still wonder if there's a better way to set this up.

@multiplemonomials multiplemonomials merged commit 0a36502 into mbed-ce:master Nov 14, 2024
52 checks passed
@ccli8 ccli8 deleted the nanostack-libservice_decrease_compile_time branch November 14, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants