nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

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

Open superxyxiao opened this issue 1 year ago • 6 comments

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

  • [x] I have verified before submitting the report.

superxyxiao avatar Aug 14 '24 06:08 superxyxiao

@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

acassis avatar Aug 14 '24 13:08 acassis

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.

xiaoxiang781216 avatar Aug 14 '24 14:08 xiaoxiang781216

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)

superxyxiao avatar Aug 15 '24 03:08 superxyxiao

which libm library are use using?

xiaoxiang781216 avatar Aug 15 '24 05:08 xiaoxiang781216

Using libm from newlib

superxyxiao avatar Aug 15 '24 05:08 superxyxiao

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

xiaoxiang781216 avatar Aug 15 '24 07:08 xiaoxiang781216