-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make: newlib: check if newlib nano folder was found #11145
make: newlib: check if newlib nano folder was found #11145
Conversation
I had a similar change there #9384 putting a warning, so was thinking about the same thing. By re-reading the error message mentioning the private So I re-read the file to know the difference and now I question if the global handling of Why do we need the In this file Lines 2 to 4 in db6cb1a
But why then treat not having the header as an error and not just set USE_NEWLIB_NANO = 0 in the same way.
However, in some tests I used So I question if there is any reason justifying having |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. The error message is much more clear now.
@kaspar030 When upgrading the compiler version for ESP32 as a prerequisite for upgrading to the current ESP-IDF version, I encountered a problem with the variable Although Do you have any idea how to solve the problem other than compiling |
I wonder if |
The check introduced with PR RIOT-OS#11145 assumes that a toolchain which provides `newlib-nano` provides both the normal version and the nano version, and therefore has a separate directory for the nano version of `newlib.h`. This is the case for toolchains which allow to use both the normal and the nano version, e.g. for ARM and RISC-V. However, if the toolchain provides `newlib_nano` but only allows the use of the nano version, it will only have the nano version of `newlib.h` and no separate directory for it, e.g. for ESP32. To still be able to use such toolchains with `newlib_nano`, the check is changed so that the setting of the `-isystem` option depends on the existence of the separate directory.
Contribution description
The logic for finding the newlib nano include dir can, if no folder is found, end up with an empty "-I".
This leads to weird error messages, like:
cc1: error: -I/home/kaspar/src/riot/core/include: No such file or directory [-Werror=missing-include-dirs]
followed by many headers that cannot be found.
This is caused by "-I -Icpu/include". I lost a while debugging this, and just yesterday another user on IRC popped up with the same problem.
Underlying is a fedora newlib packaging problem, which seems to not build with nanospecs.
This PR adds a simple check whether NEWLIB_NANO_INCLUDE_DIR is empty despite nanospecs enabled, and outputs an error.
Testing procedure
Move the newlib nano folder (/usr/arm-none-eabi/include/newlib-nano on my arch) out of the way. Compile on master and with this PR.
Issues/PRs references
none