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/01/31 06:24:31 UTC

[GitHub] [incubator-nuttx-apps] yamt opened a new pull request #992: Application.mk: Link the compiler runtime for ELF modules

yamt opened a new pull request #992:
URL: https://github.com/apache/incubator-nuttx-apps/pull/992


   ## Summary
   
   An alternative is to have symbols like __udivdi3 in
   the symbol table explicitly when loading the module.
   But I feel it's too cumbersome to maintain.
   
   ## Impact
   
   ## Testing
   
   


-- 
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



[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #992: Application.mk: Link the compiler runtime for ELF modules

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #992:
URL: https://github.com/apache/incubator-nuttx-apps/pull/992#discussion_r796522111



##########
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:
       What's different?




-- 
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



[GitHub] [incubator-nuttx-apps] yamt commented on a change in pull request #992: Application.mk: Link the compiler runtime for ELF modules

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #992:
URL: https://github.com/apache/incubator-nuttx-apps/pull/992#discussion_r795401698



##########
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:
       iirc EXTRA_LIBS is to build the nuttx image and contains other things like proprietary drivers for esp32.
   
   




-- 
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



[GitHub] [incubator-nuttx-apps] yamt commented on a change in pull request #992: Application.mk: Link the compiler runtime for ELF modules

Posted by GitBox <gi...@apache.org>.
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 arch 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



[GitHub] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #992: Application.mk: Link the compiler runtime for ELF modules

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #992:
URL: https://github.com/apache/incubator-nuttx-apps/pull/992


   


-- 
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



[GitHub] [incubator-nuttx-apps] yamt commented on a change in pull request #992: Application.mk: Link the compiler runtime for ELF modules

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #992:
URL: https://github.com/apache/incubator-nuttx-apps/pull/992#discussion_r797095174



##########
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:
       COMPILER_RT_LIBS would not have things like proprietary drivers.




-- 
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



[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #992: Application.mk: Link the compiler runtime for ELF modules

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #992:
URL: https://github.com/apache/incubator-nuttx-apps/pull/992#discussion_r797421658



##########
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:
       I am fine with either.




-- 
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



[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #992: Application.mk: Link the compiler runtime for ELF modules

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #992:
URL: https://github.com/apache/incubator-nuttx-apps/pull/992#discussion_r795395020



##########
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:
       should we add EXTRA_LIB to the link in case of build module?




-- 
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



[GitHub] [incubator-nuttx-apps] yamt commented on a change in pull request #992: Application.mk: Link the compiler runtime for ELF modules

Posted by GitBox <gi...@apache.org>.
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