ptka commented on pull request #5452: URL: https://github.com/apache/incubator-nuttx/pull/5452#issuecomment-1034557983
> > Native compiler on MacOS doesn't have objcopy installed. I assume, you have additional software installed on your MacOS which (maybe as a side-effect) installs objcopy. Can you check your system regarding this point, please. If current MacOS/X86 is designed to use clang, then the option is most likely not needed, as it was just introduced for backward compatibility. > > yes, it requires objcopy from binutils. see #1817 maybe we forgot to document it. at that point, the llvm version of objcopy didn't work well. > > can you explain why objcopy is not necessary for clang? Afaik: objcopy is used to hide the NuttX world from the HOST world to avoid, that the wrong functions are called. Before linking the final host executable, objcopy renames a list of NuttX symbols. Overall this is a kind of a workaround as in principle is should work in a different way: Compiling code with "-fvisibility=hidden" should mark functions as hidden. Hidden means, they are not exported from any 'ld' created object file. All symbols, which needs to exported, can overwrite the visibility in the code itself. This way 'main()' and 'up_doirq()' gets visible in the HOST world although they are defined in the NuTTX world. On MacOS/clang the compiler/linker behaves exactly that way and objcopy is thus not needed. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
