newlib: include fixes for newlib-nano#9394
Conversation
d1205e2 to
afcfe9b
Compare
|
@miri64 could you also give it a try with your ubuntu box? |
|
doesn't help on macOS |
|
Works for me. |
|
Isn't there some way to get this platform independent? |
yup => CMake or some other meta build system to autoconfigure Makefiles |
|
Even CMake needs to collect this info from somewhere, as it isn't plugged into the OSs package management either. Isn't this information in |
|
Newlib does not normally provide a pkgconfig file and is part of the toolchain for each platform, not part of the host system, so it is not so straightforward to integrate into pkgconfig etc. Especially since we also want to support local installations where the user extracts a pre-built toolchain tarball (usually vendor supplied) into some directory and simply adds it to the PATH environment variable. |
Fun! ;-) |
|
CMake usually requires a toolchain file with all these settings for cross compilations https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling |
873ec2b to
c2715f0
Compare
|
I am now querying gcc for its standard search paths for includes and there I search for newlib and newlib-nano. This seems to work for Arch and Ubuntu. @smlng wanna test on MAC? |
|
@gebart AFAIK you are using gentoo, wanna give it a try there? You can verify with |
in an offline discussion with @smlng we figured that the current proposed diff helps on macOS |
f752c21 to
de53997
Compare
|
I can also confirm it works on macOS (10.13.5). |
|
Works on Ubuntu 18.04. Would be great to have this fix merged soon. |
|
how does this integrate (or interfere) with #9216? |
looking at the diffs, it's a different approach and incompatible. IMO using the proposed autodetection is superior to #9216. I am not sure whether #9216 is doing more then just fixing the includes for newlib-nano (@toonst ?) If so, then we can merge efforts by applying our PRs (either @toonst PRs to mine, or the other way around). |
|
Successful fixes compile error on: With |
|
Hi guys, sorry for the delay. @cgundogan I incorporated your search in the standard include paths of the compiler in #9216 (see this commit: cad68c0). I thought it would be too much work to rebase your work on top of mine, so I just copied some lines. Are you OK with this? I think it is cleaner to use the nano.spec file whenever it is available, which this PR does not do. |
in general yes (: However, AFAIK we wanted to introduce the new features step by step #9216 (comment) The proposed change in this PR is rather small and easy to digest, before we take another step for the |
5db8263 to
db6cb1a
Compare
|
Ok, agreed. This PR seems fine by me then. |
|
Okay, if nobody objects, how about we merge it soonish? |
|
Works for me in OS X. |
|
Everything ok to merge then? |
Contribution description
At least for Ubuntu newlib-nano seems to be in a different location
(
/usr/include/newlib/nano/newlib.h).This PR fixes #9381 by adding
/usr/includeto the newlib includes and searching for bothnewlib-nano(Arch et al.) andnewlib/nano(Ubuntu et al.) explicitly.Tested on Arch and Ubuntu.
EDIT: The major change in this PR is now to autodetect newlib in the compiler's default search paths, using:
Issues/PRs references
#9381