apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.62k stars 1.11k forks source link

[HELP] prompts "undefined referenc to `_impure_prt`" #12907

Open superxyxiao opened 1 month ago

superxyxiao commented 1 month ago

Description

I have to use nuttx version 8.2. Using libm in newlibc, the link prompts an "undefined referenc to _impure_prt" error when using the lagmma function. How can I solve this?

Verification

acassis commented 1 month ago

@superxyxiao it seems something used by newlibc reentrancy, see: https://embdev.net/topic/what-is-_impure_ptr lagmma is not part of NuttX libc yet

xiaoxiang781216 commented 1 month ago

mainline already fix this problem: https://github.com/apache/nuttx/blob/master/libs/libc/misc/lib_impure.c 8.2 is very very old release, I would suggest you upgrade to the new release.

superxyxiao commented 1 month ago

Thank you very much.

When calling log2() in protected build mode, the User.map file does not have log2() symbols and cannot compile the elf file. But log2() works fine in app.bin, How can I solve this?

gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded Processors 7-2018-q2-update)

xiaoxiang781216 commented 1 month ago

which libm library are use using?

superxyxiao commented 1 month ago

Using libm from newlib

xiaoxiang781216 commented 1 month ago

do you add libm to the ld command line when you build user space bin?