Conversation
When using newlib_nano and a nano.specs file is present and the compiler supports it, we use this file for letting the linker find the right include paths. If not, we manually try to find the right newlib (nano) paths. When testing for the nano.specs file, we add -Werror so compilers which don't support .specs files give the correct output. When deriving the newlib include path from predefined directories or from the compiler include path, we print a warning. When none of the paths contain newlib.h, compilation fails. When using newlib_nano is specified, and we can not find a newlib nano directory, we print a warning that the regular newlib is used instead.
cef4189 to
c1795e5
Compare
cgundogan
left a comment
There was a problem hiding this comment.
Works fine for me. After applying this patch, my INCLUDES does not contain any path to newlib-nano, but LINKFLAGS and CFLAGS do contain specs=nano.specs. The binary size for default with samr21-xpro stays the same. I really want @smlng to check this for OSX before we merge, though.
|
we probably can get rid of the predefined search paths (in the near future). I don't think they are necessary anymore.. |
|
FYI: works on macOS |
cladmi
left a comment
There was a problem hiding this comment.
For me this PR still does too many things at once, with some things that still need discussions and even more in the same commit.
- add support for nano.specs
- error if NEWLIB_INCLUDE_DIR is not found even if NEWLIB_NANO is not used
- fix the NEWLIB_INCLUDE_DIR missing trailing slash
- moves "NEWLIB_INCLUDES" out of the
llvmconditional - Fix llvm + newlib nano not finding nano headers
You should add nano.specs alone, either the other changes which need a lot review will block the PR.
You can keep a global work in progress PR with "all I would like to have" and to split PRs for things easier to merge and review alone.
|
I added the "API Change" label for the side effects. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
I'm still unsure about the following points:
Issues/PRs references
Based on @cgundogan 's #9394
Cleanup of #9216