You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/02/01 00:50:51 UTC
[GitHub] [incubator-nuttx-apps] yamt commented on a change in pull request #992: Application.mk: Link the compiler runtime for ELF modules
yamt commented on a change in pull request #992:
URL: https://github.com/apache/incubator-nuttx-apps/pull/992#discussion_r796186573
##########
File path: Application.mk
##########
@@ -69,6 +69,18 @@ ifneq ($(CONFIG_BUILD_KERNEL),y)
endif
endif
+# When building a module, link with the compiler runtime.
+# This should be linked after libapps. Consider that mbedtls in libapps
+# uses __udivdi3.
+ifeq ($(BUILD_MODULE),y)
+ # Revisit: This only works for gcc and clang.
+ # Do other compilers have similar?
+ COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)
+ ifneq ($(COMPILER_RT_LIB),)
+ LDLIBS += $(COMPILER_RT_LIB)
Review comment:
maybe we can make make.defs do
```
COMPILER_RT_LIBS += libgcc
EXTRA_LIBS += $(COMPILER_RT_LIBS)
```
instead of
```
EXTRA_LIBS += libgcc
```
how do you think?
--
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