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 2020/09/17 07:42:33 UTC

[GitHub] [incubator-nuttx] GUIDINGLI opened a new pull request #1817: SIM in MacOS: make MacOS link process same with Linux

GUIDINGLI opened a new pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817


   
   
   ## Summary
   
   SIM in MacOS: make MacOS link process same with Linux
   
   ## Impact
   
   1. There is difference about symbol replace on nuttx-names.in
      between MacOS & Linux
   2. For MacOS, if open '-fvisibility=hidden' and adjust nuttx-names.in,
      it will meet symbol link-back-to-nuttx error.
   3. Make the MacOS replace behaviour, same with Linux
   
   Note:
   MacOS should install objcopy with command:
   $ brew install binutils
   $ export PATH=$PATH:/usr/local/opt/binutils/bin
   
   already check in to cibuild.sh
   
   ## 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.

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



[GitHub] [incubator-nuttx] TA1DB edited a comment on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
TA1DB edited a comment on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-716383890


   @yamt thanks for your help.
   My binutils info is similar to your's except that my info has some explanations about the path. (I did these recommendations previously).
   
   There may be a corruption in developer tools because I did many trials to resolve this issue for instance I installed crosstools-ng acoording to [this paper](https://pigiuz.wordpress.com/2013/09/12/resolving-symbols-conflict-between-libraries-on-osx-with-objcopy/) and installed (removed afterwards) the prerequisites - recommended tools [here](https://nuttx-companion.readthedocs.io/en/latest/user/install.html)  
   
   For instance my system has gobjcopy as well and it has exact same version with the objcopy ?
   `apple-mbp:~ murat$ gobjcopy --version
   GNU objcopy (GNU Binutils) 2.35.1
   Copyright (C) 2020 Free Software Foundation, Inc.
   This program is free software; you may redistribute it under the terms of
   the GNU General Public License version 3 or (at your option) any later version.
   This program has absolutely no warranty.`
   
   Binutils info:
   `apple-mbp:~ murat$ brew info binutils
   binutils: stable 2.35.1 (bottled) [keg-only]
   GNU binary tools for native development
   https://www.gnu.org/software/binutils/binutils.html
   /usr/local/Cellar/binutils/2.35.1 (139 files, 169.4MB)
     Poured from bottle on 2020-10-25 at 14:18:41
   From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/binutils.rb
   License: GPL-2.0
   ==> Caveats
   binutils is keg-only, which means it was not symlinked into /usr/local,
   because Apple's CLT provides the same tools.
   
   If you need to have binutils first in your PATH run:
     echo 'export PATH="/usr/local/opt/binutils/bin:$PATH"' >> /Users/murat/.bash_profile
   
   For compilers to find binutils you may need to set:
     export LDFLAGS="-L/usr/local/opt/binutils/lib"
     export CPPFLAGS="-I/usr/local/opt/binutils/include"
   
   ==> Analytics
   install: 5,218 (30 days), 17,930 (90 days), 65,640 (365 days)
   install-on-request: 4,406 (30 days), 15,304 (90 days), 56,600 (365 days)
   build-error: 0 (30 days)
   apple-mbp:~ murat$ `


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

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



[GitHub] [incubator-nuttx] TA1DB edited a comment on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
TA1DB edited a comment on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-716383890


   @yamt thanks for your help.
   My binutils info is similar to your's except that my info has some explanations about the path. (I did these recommendations previously).
   
   There may be a corruption in developer tools because I did many trials to resolve this issue for instance I installed crosstools-ng acoording to [this paper](https://pigiuz.wordpress.com/2013/09/12/resolving-symbols-conflict-between-libraries-on-osx-with-objcopy/) and installed (removed afterwards) the prerequisites - recommended tools [here](https://nuttx-companion.readthedocs.io/en/latest/user/install.html)   
   
   `apple-mbp:~ murat$ brew info binutils
   binutils: stable 2.35.1 (bottled) [keg-only]
   GNU binary tools for native development
   https://www.gnu.org/software/binutils/binutils.html
   /usr/local/Cellar/binutils/2.35.1 (139 files, 169.4MB)
     Poured from bottle on 2020-10-25 at 14:18:41
   From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/binutils.rb
   License: GPL-2.0
   ==> Caveats
   binutils is keg-only, which means it was not symlinked into /usr/local,
   because Apple's CLT provides the same tools.
   
   If you need to have binutils first in your PATH run:
     echo 'export PATH="/usr/local/opt/binutils/bin:$PATH"' >> /Users/murat/.bash_profile
   
   For compilers to find binutils you may need to set:
     export LDFLAGS="-L/usr/local/opt/binutils/lib"
     export CPPFLAGS="-I/usr/local/opt/binutils/include"
   
   ==> Analytics
   install: 5,218 (30 days), 17,930 (90 days), 65,640 (365 days)
   install-on-request: 4,406 (30 days), 15,304 (90 days), 56,600 (365 days)
   build-error: 0 (30 days)
   apple-mbp:~ murat$ `


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

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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

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


   @TA1DB do you modify PATH like this:
   export PATH=$PATH:/usr/local/opt/binutils/bin


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

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



[GitHub] [incubator-nuttx] GUIDINGLI commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-694087850


   @yamt try again


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

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



[GitHub] [incubator-nuttx] TA1DB commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
TA1DB commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-716192273


   > @TA1DB do you modify PATH like this:
   > export PATH=$PATH:/usr/local/opt/binutils/bin
   
   @xiaoxiang781216 thanks for your kind answer. I did, but I understand that my path was wrong, with the exact path you've given my build pass the objcopy but now I get undefined symbol error like this:
   ...
   Undefined symbols for architecture x86_64:
     "NXsyslog", referenced from:
         _up_assert in nuttx.rel
     "_nx_start", referenced from:
         _main in nuttx.rel
     "_up_doirq", referenced from:
         _up_handle_irq in up_hostirq.o
   ld: symbol(s) not found for architecture x86_64
   clang: error: linker command failed with exit code 1 (use -v to see invocation)
   make[1]: *** [nuttx] Error 1
   make: *** [nuttx] Error 2


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

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



[GitHub] [incubator-nuttx] yamt commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
yamt commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-694649607


   @xiaoxiang781216 it's on my todo list.


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

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



[GitHub] [incubator-nuttx] TA1DB commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
TA1DB commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-716383890


   @yamt thanks for your help.
   My binutils info is similar to your's except that my info has some explanations about the path. (I did these recommendations previously).
   
   There may be a corruption in developer tools because I did many trials to resolve this issue for instance I installed crosstools-ng acoording to [this paper](https://pigiuz.wordpress.com/2013/09/12/resolving-symbols-conflict-between-libraries-on-osx-with-objcopy/) and installed (removed afterwards) the prerequisites - recommended tools [here](Installing — NuttX Companion 0.1.6 documentation) 
   
   `apple-mbp:~ murat$ brew info binutils
   binutils: stable 2.35.1 (bottled) [keg-only]
   GNU binary tools for native development
   https://www.gnu.org/software/binutils/binutils.html
   /usr/local/Cellar/binutils/2.35.1 (139 files, 169.4MB)
     Poured from bottle on 2020-10-25 at 14:18:41
   From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/binutils.rb
   License: GPL-2.0
   ==> Caveats
   binutils is keg-only, which means it was not symlinked into /usr/local,
   because Apple's CLT provides the same tools.
   
   If you need to have binutils first in your PATH run:
     echo 'export PATH="/usr/local/opt/binutils/bin:$PATH"' >> /Users/murat/.bash_profile
   
   For compilers to find binutils you may need to set:
     export LDFLAGS="-L/usr/local/opt/binutils/lib"
     export CPPFLAGS="-I/usr/local/opt/binutils/include"
   
   ==> Analytics
   install: 5,218 (30 days), 17,930 (90 days), 65,640 (365 days)
   install-on-request: 4,406 (30 days), 15,304 (90 days), 56,600 (365 days)
   build-error: 0 (30 days)
   apple-mbp:~ murat$ `


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

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



[GitHub] [incubator-nuttx] TA1DB edited a comment on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
TA1DB edited a comment on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-716140269


   I think something has to be resolved; Building Nuttx for sim on Osx (High Sierra 10.13.6) stops with the errors shown below. Installing binutils together with path adjustment as recommended somewhre in this repo doesn't help.
   ....`
   CC:  sim/up_hosttime.c
   
   CC:  sim/up_simuart.c
   
   CPP:  nuttx-names.in-> nuttx-names.dat
   
   LD:  nuttx
   
   make[1]: objcopy: No such file or directory
   
   make[1]: *** [nuttx] Error 1
   
   make: *** [nuttx] Error 2`
   


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

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



[GitHub] [incubator-nuttx] yamt commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
yamt commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-716222637


   @TA1DB which version of objcopy are you using?
   
   i'm using:
   ```
   spacetanuki% brew info binutils
   binutils: stable 2.35.1 (bottled) [keg-only]
   GNU binary tools for native development
   https://www.gnu.org/software/binutils/binutils.html
   /usr/local/Cellar/binutils/2.33.1 (134 files, 167.6MB)
     Poured from bottle on 2020-01-29 at 00:27:01
   From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/binutils.rb
   License: GPL-2.0
   ==> Caveats
   binutils is keg-only, which means it was not symlinked into /usr/local,
   because Apple's CLT provides the same tools.
   
   ==> Analytics
   install: 5,423 (30 days), 18,456 (90 days), 65,599 (365 days)
   install-on-request: 4,587 (30 days), 15,771 (90 days), 56,580 (365 days)
   build-error: 0 (30 days)
   spacetanuki% 
   ```
   
   it might be version-sensitive because this is the first version i've seen working ok.
   when i tried an earlier verion before, it produced a broken binary.
   (that was why macOS port has been done 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.

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



[GitHub] [incubator-nuttx] TA1DB commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
TA1DB commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-716140269


   I think something has to be resolved; Building Nuttx for sim on Osx (High Sierra 10.13.6) stops with the errors shown below. Installing binutils together with path adjustment as recommended somewhre in this repo doesn't help.
   ....`
   CC:  sim/up_hosttime.c
   CC:  sim/up_simuart.c
   CPP:  nuttx-names.in-> nuttx-names.dat
   LD:  nuttx
   make[1]: objcopy: No such file or directory
   make[1]: *** [nuttx] Error 1
   make: *** [nuttx] Error 2`


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

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



[GitHub] [incubator-nuttx] GUIDINGLI edited a comment on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
GUIDINGLI edited a comment on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-694714243


   @yamt 
   I have add the objcopy PATH to env.sh at:
   https://github.com/apache/incubator-nuttx-testing/pull/64
   
   ln -s /usr/local/opt/binutils/bin/objcopy /Users/runner/work/incubator-nuttx-testing/incubator-nuttx-testing/prebuilt/bintools/bin/objcopy
   add_path /Users/runner/work/incubator-nuttx-testing/incubator-nuttx-testing/prebuilt/bintools/bin
   
   then I have seen PATH will be write to env.sh
   
   But how to use env.sh ?
   
   This I have seen your history commit on generated env.sh, but can't see where to use it.
   This will caused https://github.com/apache/incubator-nuttx/pull/1817 compile failed.
   


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

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



[GitHub] [incubator-nuttx] yamt commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
yamt commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-694777721


   @GUIDINGLI 
   env.sh is to be sourced to set up PATH to prebuilt binaries.
   like:
   
       . $prebuilt/env.sh
   
   as far as i know, it isn't used for the ci.
   


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

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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

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


   @yamt could you try the update?


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

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



[GitHub] [incubator-nuttx] GUIDINGLI commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-694106453


   @yamt 
   
   this patch will take place of :
   https://github.com/apache/incubator-nuttx/pull/1813
   
   If you test pass, 
   then first check in https://github.com/apache/incubator-nuttx-testing/pull/63
   thus, this will compile pass on MacOS


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

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



[GitHub] [incubator-nuttx] yamt commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
yamt commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-716387178


   @TA1DB 
   one thing you can try is to copy the objcopy binary into a dedicated directory (eg. ~/bin) and tweak your PATH to look at there, instead of /usr/local/opt/binutils/bin.
   brew binutils package has too many things which might conflict with the host toolchain. it's better to ensure that only objcopy is used from binutils.


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

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



[GitHub] [incubator-nuttx] yamt merged pull request #1817: SIM in MacOS: make MacOS link process same with Linux

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


   


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

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



[GitHub] [incubator-nuttx] GUIDINGLI commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-694714243


   @yamt 
   I have add the objcopy PATH to env.sh at:
   https://github.com/apache/incubator-nuttx-testing/pull/64
   
   But how to use env.sh ?
   
   This I have seen your history commit on generated env.sh, but can't see where to use it.
   This will caused https://github.com/apache/incubator-nuttx/pull/1817 compile failed.
   


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

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



[GitHub] [incubator-nuttx] TA1DB commented on pull request #1817: SIM in MacOS: make MacOS link process same with Linux

Posted by GitBox <gi...@apache.org>.
TA1DB commented on pull request #1817:
URL: https://github.com/apache/incubator-nuttx/pull/1817#issuecomment-716389584


   > @TA1DB
   > one thing you can try is to copy the objcopy binary into a dedicated directory (eg. ~/bin) and tweak your PATH to look at there, instead of /usr/local/opt/binutils/bin.
   > brew binutils package has too many things which might conflict with the host toolchain. it's better to ensure that only objcopy is used from binutils.
   
   Thanks, I will try.


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

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