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

libc/string: replace __builtin_ffsl with inline function #12263

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

Gary-Hobson
Copy link
Contributor

Summary

In the gcc-riscv compiler, __builtin_ffs will call ffs, and calling __builtin_ffs in ffs will cause recursion

__builtin_ffs --> ffs --> ffs --> ffs

Change ffs to an inline function, and compile ffs implemented by nuttx by default. Only call the implementation of nuttx when the compiler cannot provide an ffs implementation.

Impact

Testing

arm/riscv

In the gcc-riscv compiler, __builtin_ffs will call ffs, and calling __builtin_ffs in ffs will cause recursion

Change ffs to an inline function, and compile ffs implemented by nuttx by default.
Only call the implementation of nuttx when the compiler cannot provide an ffs implementation.

Signed-off-by: yinshengkai <[email protected]>
@xiaoxiang781216 xiaoxiang781216 linked an issue Apr 30, 2024 that may be closed by this pull request
@xiaoxiang781216
Copy link
Contributor

@yf13 please try this patch.

@xiaoxiang781216 xiaoxiang781216 merged commit b87804c into apache:master Apr 30, 2024
26 checks passed
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.

TLSF usage issue on rv-virt target
4 participants