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

util: Remove the inline attribute #2439

Merged
merged 1 commit into from
Feb 10, 2025
Merged

util: Remove the inline attribute #2439

merged 1 commit into from
Feb 10, 2025

Conversation

CiprianRegus
Copy link
Contributor

Adding the inline keyword to a weak function results in the symbol to not actually be defined as weak. Thus, the compilation will fail for platforms which define their own version of those functions (FreeRTOS for example).

attribute((weak)) inline:

arm-none-eabi-nm build/objs/iio_demo_freeRTOS/build/app/noos/util/no_os_semaphore.o 00000000 T no_os_semaphore_give
00000000 T no_os_semaphore_init
00000000 T no_os_semaphore_remove
00000000 T no_os_semaphore_take

attribute((weak)):

arm-none-eabi-nm build/objs/iio_demo_freeRTOS/build/app/noos/util/no_os_mutex.o 00000000 W no_os_mutex_init
00000000 W no_os_mutex_lock
00000000 W no_os_mutex_remove
00000000 W no_os_mutex_unlock
00000000 n wm4.0.2fb1d36208757ad46d380e25c322250d

Pull Request Description

Please replace this with a detailed description and motivation of the changes.
You can tick the checkboxes below with an 'x' between square brackets or just check them after publishing the PR.
If this PR contains a breaking change, list dependent PRs and try to push all related PRs at the same time.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

Adding the inline keyword to a weak function results in the symbol to
not actually be defined as weak. Thus, the compilation will fail for
platforms which define their own version of those functions (FreeRTOS
for example).

__attribute__((weak)) inline:

arm-none-eabi-nm build/objs/iio_demo_freeRTOS/build/app/noos/util/no_os_semaphore.o
00000000 T no_os_semaphore_give
00000000 T no_os_semaphore_init
00000000 T no_os_semaphore_remove
00000000 T no_os_semaphore_take

__attribute__((weak)):

arm-none-eabi-nm build/objs/iio_demo_freeRTOS/build/app/noos/util/no_os_mutex.o
00000000 W no_os_mutex_init
00000000 W no_os_mutex_lock
00000000 W no_os_mutex_remove
00000000 W no_os_mutex_unlock
00000000 n wm4.0.2fb1d36208757ad46d380e25c322250d

Signed-off-by: Ciprian Regus <[email protected]>
@dbogdan dbogdan merged commit b4bd990 into main Feb 10, 2025
11 of 14 checks passed
@dbogdan dbogdan deleted the staging/weak_inline branch February 10, 2025 08:13
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.

4 participants