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/21 23:14:55 UTC

[GitHub] [incubator-nuttx-apps] masayuki2009 opened a new pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

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


   ## Summary
   
   - I noticed that the current BUILD_KERNEL for armv7-a sometimes
     does not work correctly with thumb-based libraries.
   - This is a workaround to avoid such a crash.
   
   ## Impact
   
   - CONFIG_BUILD_KERNEL=y only
   
   ## Testing
   
   - Tested with sabre-6quad:netknsh (not merged yet)
   
   


-- 
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] masayuki2009 commented on pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1047330006


   https://github.com/apache/incubator-nuttx/pull/5579
   


-- 
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] pkarashchenko commented on pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1047787912


   Also this change not seems to be isolated for `armv7-a` arch.


-- 
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] masayuki2009 commented on a change in pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

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



##########
File path: import/Make.defs
##########
@@ -66,6 +66,8 @@ LDLIBPATH = $(addprefix -L,$(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs))
 # Link with user libraries
 
 ifeq ($(CONFIG_BUILD_KERNEL),y)
+  # Clear ARCHCPUFLAGS not to link thumb-based libraries to avoid a crash
+  ARCHCPUFLAGS =

Review comment:
       @xiaoxiang781216 
   
   Actually, thumb-based libraries can be linked.
   However, as I commented below, it crashed inside the gcc helper function.




-- 
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 pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1049934507


   Nice!


-- 
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] pkarashchenko edited a comment on pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
pkarashchenko edited a comment on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1048548376


   I think that @masayuki2009 maybe you can try to re-implement `__aeabi_xxx` and link vs re-implemented function that cause troubles instead of clearing `ARCHCPUFLAGS`? Or that is not possible? I mean that clearing `ARCHCPUFLAGS` does not only clear `-thumb` flag, but also things like `-mfloat-abi=hard` or `-mcpu=`


-- 
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] pkarashchenko commented on pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1048548376


   I think that @masayuki2009 maybe you can try to re-implement `__aeabi_xxx` and link vs re-implemented function that cause troubles instead of clearing `ARCHCPUFLAGS`? Or that is not possible. I mean that clearing `ARCHCPUFLAGS` does not only clear `-thumb` flag, but also things like `-mfloat-abi=hard` or `-mcpu=`


-- 
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] masayuki2009 commented on pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1047323192


   Hmm, I think the following error does not relates to this PR
   
   ```
   ====================================================================================
   Configuration/Tool: sim/rust
   ------------------------------------------------------------------------------------
     Cleaning...
     Configuring...
     Building NuttX...
   make[3]: rustc: Command not found
   make[3]: *** [/github/workspace/sources/apps/Application.mk:212: hello_rust_main.rs.github.workspace.sources.apps.examples.hello_rust.o] Error 127
   make[3]: Target 'all' not remade because of errors.
   make[2]: *** [Makefile:42: /github/workspace/sources/apps/examples/hello_rust_all] Error 2
   make[2]: Target '/github/workspace/sources/apps/libapps.a' not remade because of errors.
   make[1]: *** [Makefile:36: all] Error 2
   make: *** [tools/LibTargets.mk:210: /github/workspace/sources/apps/libapps.a] Error 2
   make: Target 'all' not remade because of errors.
   /github/workspace/sources/nuttx/tools/testbuild.sh: line 252: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
     Normalize sim/rust
   ```
   


-- 
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 #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

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



##########
File path: import/Make.defs
##########
@@ -66,6 +66,8 @@ LDLIBPATH = $(addprefix -L,$(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs))
 # Link with user libraries
 
 ifeq ($(CONFIG_BUILD_KERNEL),y)
+  # Clear ARCHCPUFLAGS not to link thumb-based libraries to avoid a crash
+  ARCHCPUFLAGS =

Review comment:
       why can't link the thumb-based library? I think both side should be sync with/without thumb.




-- 
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] masayuki2009 commented on pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1049294129


   @pkarashchenko 
   
   I will reconsider how to fix the issue.
   Let me close this PR.


-- 
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] masayuki2009 commented on pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1049745111


   @pkarashchenko  @xiaoxiang781216 
   
   Finally, I found the root cause of the issue.
   See https://github.com/apache/incubator-nuttx/pull/5600
   


-- 
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] masayuki2009 commented on pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1048310075


   > @masayuki2009 how the crash is reproduced? Maybe we need to create an issue to investigate it?
   
   @pkarashchenko 
   
   The crash can be reproduced with my branch (imx6-netknsh) which is still under testing if it is linked with thumb-based libraries plus arm_elf.c supporting thumb relocation. Actually, it crashed  inside __aeabi_xxx which is a gcc helper function. I'm still not sure why the crash happens. I suspect there still be a potential bug in context switching but this PR is just a workaround to avoid such a crash.
   
   >Also this change not seems to be isolated for armv7-a arch.
   
   OK, it should be isolated for armv7-a.
   


-- 
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] pkarashchenko commented on pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1047783328


   @masayuki2009 how the crash is reproduced? Maybe we need to create an issue to investigate it?


-- 
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 pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022#issuecomment-1048544797


   > > @masayuki2009 how the crash is reproduced? Maybe we need to create an issue to investigate it?
   > 
   > @pkarashchenko
   > 
   > The crash can be reproduced with my branch (imx6-netknsh) which is still under testing if it is linked with thumb-based libraries plus arm_elf.c supporting thumb relocation. Actually, it crashed inside __aeabi_xxx which is a gcc helper function. I'm still not sure why the crash happens. I suspect there still be a potential bug in context switching but this PR is just a workaround to avoid such a crash.
   > 
   
   Should we try to fix the root cause before applying the workaround.
   
   > > Also this change not seems to be isolated for armv7-a arch.
   > 
   > OK, it should be isolated for armv7-a.
   
   


-- 
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] masayuki2009 closed pull request #1022: import: Make.defs: Do not link thumb-based libraries for BUILD_KERNEL

Posted by GitBox <gi...@apache.org>.
masayuki2009 closed pull request #1022:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1022


   


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