This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Re: Re: GCC 6.1 Hard-coded C++ header paths and relocation problem on Windows
- From: "lh mouse"<lh_mouse at 126 dot com>
- To: "Andrew Pinski"<pinskia at gmail dot com>, "Brett Neumeier"<bneumeier at gmail dot com>
- Cc: "Jonathan Wakely"<jwakely dot gcc at gmail dot com>, "gcc"<gcc at gcc dot gnu dot org>
- Date: Tue, 10 May 2016 11:39:08 +0800
- Subject: Re: Re: Re: GCC 6.1 Hard-coded C++ header paths and relocation problem on Windows
- Authentication-results: sourceware.org; auth=none
- References: <4bee92a3 dot 11b9f7 dot 154710b7ff9 dot Coremail dot lh_mouse at 126 dot com> <27b92139 dot 11ba0f dot 154710f77eb dot Coremail dot lh_mouse at 126 dot com> <CAH6eHdTkL_L6POiuZzDY61=ESM4ZMbepRXxZVoN5-ZnkcFkwmQ at mail dot gmail dot com> <57e3f960 dot 200a dot 154772301e2 dot Coremail dot lh_mouse at 126 dot com> <CAGSetNuPNq0vPvBVVhKZ7iCJiMZ7Dwy=uxSzPKejyhAOz+4M5g at mail dot gmail dot com><CA+=Sn1nxn+SdBtwgYySCbjKfLw0HXOZQjbZz7dhidcvVhVTYvA at mail dot gmail dot com>
We use neither --with-sysroot nor --with-build-sysroot.
The reason is that, the hard-coded path in GCC repository - that is, the /mingw/ one - does not actually exist.
In order to build GCC for mingw targets, we take either solution:
0) Make a symlink (or rather, a copy, since Windows does not support symlinks) as /mingw/, as mentioned in https://sourceforge.net/p/mingw-w64/wiki2/Native%20Win64%20compiler/
1) Replace the non-existent path with an existent one, as done in https://github.com/lhmouse/MINGW-packages/blob/master/mingw-w64-gcc-git/PKGBUILD#L112
------------------
Best regards,
lh_mouse
2016-05-10
-------------------------------------------------------------
åääïAndrew Pinski <pinskia@gmail.com>
åéææï2016-05-10 05:10
æääïBrett Neumeier
æéïlh_mouse,Jonathan Wakely,gcc
äéïRe: Re: GCC 6.1 Hard-coded C++ header paths and relocation problem on Windows
On Mon, May 9, 2016 at 1:31 PM, Brett Neumeier <bneumeier@gmail.com> wrote:
> On Tue, May 3, 2016 at 10:01 AM, lh_mouse <lh_mouse@126.com> wrote:
>> Should I file a bug report then?
>> We need some Linux testers, though not many people on Linux relocate compilers.
>
> For what it's worth -- I encountered the same problem on a GNU/Linux
> system. In my specific situation, I'm cross-compiling GCC using an
> AMD64-to-mips64el cross-toolchain, and installing the resulting GCC in
> a sysroot directory. When I try to use that GCC on a target device
> where (of course) the sysroot directory becomes "/", the hard-coded
> "/path/to/sysroot" from the host system is still used to find the C++
> headers, resulting in the same ".../include/c++/6.1.1/cstdlib:75:25:
> fatal error: stdlib.h: No such file or directory" error message you
> got.
>
> Changing #include_next to #include in cstdlib and cmath fixed my
> problem -- so, thank you very much for this discussion! It helped at
> least one other person.
>
> Please let me know if there's any other testing I can do to help.
This sounds like a good use of --with-build-sysroot instead of just
--with-sysroot.
I use the following for the candian cross:
--with-sysroot=/ --with-build-sysroot=${SYSROOT}
Thanks,
Andrew
>
> Cheers,
>
> Brett