You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "g2gps (via GitHub)" <gi...@apache.org> on 2023/10/23 23:39:56 UTC

[PR] import/mk: Use libm from the export package when defined. [nuttx-apps]

g2gps opened a new pull request, #2151:
URL: https://github.com/apache/nuttx-apps/pull/2151

   ## Summary
   
   Nuttx exports libm.a when `CONFIG_LIBM` is enabled. Adjust the application import makefile to pick this up when linking.
   
   ## Impact
   
   Applications using `CONFIG_BUILD_KERNEL` and `CONIFG_LIBM` can link correctly when needed.
   
   ## Testing
   
   Before this change, when trying to add  `CONFIG_EXAMPLES_CALIB_UDELAY`
   ```
   nuttx/apps/examples/calib_udelay/calib_udelay_main.c:282: undefined reference to `ceil'
   ```
   
   With this change, the `calib_udelay` application links as expected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] import/mk: Use libm from the export package when defined. [nuttx-apps]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #2151:
URL: https://github.com/apache/nuttx-apps/pull/2151


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] import/mk: Use libm from the export package when defined. [nuttx-apps]

Posted by "hitHuang (via GitHub)" <gi...@apache.org>.
hitHuang commented on PR #2151:
URL: https://github.com/apache/nuttx-apps/pull/2151#issuecomment-5150263984

   @g2gps @xiaoxiang781216 
   I came across this PR while debugging a ceil undefined reference in calib_udelay on a BUILD_KERNEL config with CONFIG_LIBM=y (rv-virt:knsh). It turns out the condition else ifneq ($(CONFIG_LIBM_NONE),) is inverted — it adds -lm only when
   CONFIG_LIBM_NONE is set to y, but the intent is the opposite: add -lm for every math library choice except NONE. When CONFIG_LIBM=y, CONFIG_LIBM_NONE is empty so -lm never gets linked. The fix is simply:
   
   -else ifneq ($(CONFIG_LIBM_NONE),)
   +else ifneq ($(CONFIG_LIBM_NONE),y)
   
   Am I missing something here?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] import/mk: Use libm from the export package when defined. [nuttx-apps]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #2151:
URL: https://github.com/apache/nuttx-apps/pull/2151#discussion_r1369652560


##########
import/Make.defs:
##########
@@ -76,6 +76,8 @@ ifneq ($(LIBM),".")
   LDLIBPATH += -L "${shell dirname $(LIBM)}"
   LDLIBS += -lm
 endif
+else

Review Comment:
   ```suggestion
   else ifneq ($(CONFIG_LIBM_NONE,)
   ```
   line 73 nee change to `ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org