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/08/07 02:12:30 UTC

[GitHub] [incubator-nuttx] rm5248 opened a new pull request, #6800: Use GCC for LD on MIPS processors

rm5248 opened a new pull request, #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800

   ## Summary
   I built GCC 11.2 with crosstool-ng and found that the linking process failed.  This led me to issue #3826, which is the same issue but for ARM.  I applied effectively the same patch as #3836 in order to get it to compile
   
   ## Impact
   Seems to be minimal.  Other compilers may have issues.
   
   ## Testing
   Nuttx now compiles with newer versions of GCC.  This shouldn't have any effect on the actual compiled code.  I have not tested with other compilers apart from the one crosstool-ng built one.
   


-- 
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] acassis commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
acassis commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1207437468

   > @acassis Based off of [this mailing list post](https://lists.apache.org/thread/193jmh192zm157sk6pmsglrkf6b3kvpw), I just started with the mips-unknown-elf toolchain and modified it slightly to build for the PIC32
   
   What did you do after "ct-ng build" ?


-- 
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] acassis commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
acassis commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1207437310

   > > @xiaoxiang781216 I did notice an error and fixed it, it should be good now. The build still seems to be failing, but that appears to be a different issue with the compiler.
   > 
   > Look like that the endian of compiled generated code is different from the expectation of link script. Please try the different value of OUTPUT_FORMAT in the link script.
   
   Yes, the mips-unknown-elf toolchain is big-endian by default, I needed to change it to little-endian


-- 
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] rm5248 commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
rm5248 commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1207422848

   @acassis Based off of [this mailing list post](https://lists.apache.org/thread/193jmh192zm157sk6pmsglrkf6b3kvpw), I just started with the mips-unknown-elf toolchain and modified it slightly to build for the PIC32


-- 
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] acassis commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
acassis commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1208009917

   Thank you @rm5248 !! @xiaoxiang781216 maybe the issue is caused by incompatibility with pinguino after this change. But since Robert is also using little endian, but issue could be specific of pinguino


-- 
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] rm5248 commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
rm5248 commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1207440024

   > > @acassis Based off of [this mailing list post](https://lists.apache.org/thread/193jmh192zm157sk6pmsglrkf6b3kvpw), I just started with the mips-unknown-elf toolchain and modified it slightly to build for the PIC32
   > 
   > What did you do after "ct-ng build" ?
   
   Added it to the PATH and set CROSSDEV:
   
   ```
   export CROSSDEV=mipsel-elf-
   export PATH=/home/robert/x-tools/mipsel-elf/bin:$PATH
   ```
   
   Here's the output from `ct-ng savedefconfig`:
   ```
   CT_CONFIG_VERSION="4"
   CT_ARCH_MIPS=y
   CT_OMIT_TARGET_VENDOR=y
   CT_ARCH_LE=y
   CT_ARCH_FLOAT_SW=y
   CT_STATIC_TOOLCHAIN=y
   CT_LIBC_NONE=y
   CT_CC_GCC_mips_plt=y
   CT_CC_LANG_CXX=y
   CT_DEBUG_GDB=y
   CT_ZLIB_NEEDED=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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#discussion_r941971775


##########
arch/mips/src/mips32/Toolchain.defs:
##########
@@ -245,14 +245,14 @@ endif
 # Optimization of unused sections
 
 ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
-  LDFLAGS          += --gc-sections
+  LDFLAGS          += -Wl,--gc-sections

Review Comment:
   Yes, @rm5248 you can reference how arm support link with gcc and ld at the same time.



-- 
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] rm5248 closed pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
rm5248 closed pull request #6800: Use GCC for LD on MIPS processors
URL: https://github.com/apache/incubator-nuttx/pull/6800


-- 
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] xiaoxiang781216 commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1207339362

   @rm5248 there are some compile errors. Please reference the last arm Toolchain.defs too.


-- 
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] rm5248 commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
rm5248 commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1208824454

   As far as I am aware, all of the PIC32 processors are always little-endian, so it seems that if there is a problem with the big vs. little endian that is a problem with the compiler that is used and/or the configuration of nuttx.


-- 
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] xiaoxiang781216 commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1207432307

   > @xiaoxiang781216 I did notice an error and fixed it, it should be good now. The build still seems to be failing, but that appears to be a different issue with the compiler.
   
   Look like the endian of compiled generated code is different from the expectation of link script. Please try the different value of OUTPUT_FORMAT in the link script.


-- 
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] rm5248 commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
rm5248 commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1214178534

   after looking at this more, everything builds fine for me with the current master branch.  I think I was in some weird state where I had either tried to use two different compilers and/or I had leftover data from something old.
   
   Closing as this is not an issue.


-- 
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] pkarashchenko commented on a diff in pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#discussion_r941713824


##########
arch/mips/src/mips32/Toolchain.defs:
##########
@@ -245,14 +245,14 @@ endif
 # Optimization of unused sections
 
 ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
-  LDFLAGS          += --gc-sections
+  LDFLAGS          += -Wl,--gc-sections

Review Comment:
   I think there was an automated way of adding -Wl in case if gcc is used for linking in case of ARM. Maybe the same approach can be used



-- 
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] rm5248 commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
rm5248 commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1207422402

   @xiaoxiang781216 I did notice an error and fixed it, it should be good now.  The build still seems to be failing, but that appears to be a different issue with the compiler.


-- 
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] rm5248 commented on a diff in pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
rm5248 commented on code in PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#discussion_r943052396


##########
arch/mips/src/mips32/Toolchain.defs:
##########
@@ -245,14 +245,14 @@ endif
 # Optimization of unused sections
 
 ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
-  LDFLAGS          += --gc-sections
+  LDFLAGS          += -Wl,--gc-sections

Review Comment:
   It looks like the commit that I was basing this off of was reverted at some point, so I will configure this differently.



-- 
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] btashton commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
btashton commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1208847975

   At least a while back I ran some testing under qemu. But looks like you might have also been on that thread. 
   
   https://lists.apache.org/thread/hk8gdtr495qbl2fg4yx1gfotm319npmy


-- 
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] acassis commented on pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
acassis commented on PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#issuecomment-1207394461

   @rm5248 very nice!!! What board did you use for test? How did you generate the toolchain? I tried this way https://acassis.wordpress.com/2022/08/06/using-crosstool-ng-to-create-mips-toolchain/ but it didn't create a mips-unknown-elf-gcc! My goal is to get NuttX running on Dmitry visit card: https://dmitry.gr/?r=05.Projects&proj=33.%20LinuxCard and on this uMIPS emulador.


-- 
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] xiaoxiang781216 commented on a diff in pull request #6800: Use GCC for LD on MIPS processors

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6800:
URL: https://github.com/apache/incubator-nuttx/pull/6800#discussion_r943056373


##########
arch/mips/src/mips32/Toolchain.defs:
##########
@@ -245,14 +245,14 @@ endif
 # Optimization of unused sections
 
 ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
-  LDFLAGS          += --gc-sections
+  LDFLAGS          += -Wl,--gc-sections

Review Comment:
   Yes, you need check the last code.



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