[Freemint-list] When cross compiling native gcc, 'include-fixed' contains stuff from /usr

Vincent Rivière vincent.riviere at freesbee.fr
Sun Sep 24 11:53:40 MSD 2017


On 24/09/2017 à 04:19, Miro Kropáček wrote:
> My native gcc archive now contains a lot of crap in
> $PREFIX/lib/gcc/m68k-atari-mint/7.2.0/include-fixed, like SDL2, KDE,
> xorg headers... any idea how to avoid it and yet have the /usr
> "destination" ?
If I understand well, you mean that, when running configure, all the 
contents of /usr/include are copied to 
/usr/lib/gcc/m68k-atari-mint/7.2.0/include-fixed. Am I right? Anyway, this 
looks very wrong.

The first question is:
What is the purpose of fixincludes?
As far as I understand, it was introduced to handle the following situation. 
Let's take an old UNIX operating system like HP-UX or Solaris. The system 
already has its own proprietary C compiler, and associated includes. Then 
you want to install GCC on that machine. GCC will reuse the old headers, but 
unfortunately they might contain some code incompatible with GCC. So 
fixincludes tries to make those old includes compatible with GCC, and put 
the result into include-fixed.
Of course this is legitimate for system includes, but this should not happen 
with third-party includes (?).

I'm not familiar with that fixinclude stuff, so here are only a few 
considerations which might help to progress.

- What happens on Linux, when compiling native GCC for Linux? If /usr is 
copied as you describe for MiNT, include-fixed should become full of mess, 
while I'm pretty sure it does not happen.

- I'm pretty sure that fixincludes is not used at all on Linux. Because 
fixincludes is only required when GCC uses the includes of an old compiler. 
While on Linux, GCC is the only compiler, and by design the headers in 
/usr/include are already compatible with GCC.
And it should be the same on MiNT.

- Originally, I did't enable fixincludes for the m68k-atari-mint target. 
But, as Alan pointed me, <syslimits.h> was not properly installed. So I 
enabled fixincludes for MiNT. See there:
https://github.com/freemint/m68k-atari-mint-gcc/commit/9835ac6ff1955daf699008cc5f8d70bd17286346
That commit is a bit messy, only the bottom part about 
gcc/config/m68k/t-mint is relevant.

- So my advice would be to disable fixincludes, and make the whole GCC 
compilation work fine without that. That might require some fixes in the 
MiNTLib headers.

- On the other hand, maybe the solution is just to use --with-headers, with 
the contents of the missing mintlib-headers package. I'm not sure how that 
combines with the fixincludes stuff.

Well, all the above are just ideas from my memory. Maybe just total rubbish. 
Take that as starting points, I hope that will help you to go forward.

-- 
Vincent Rivière


More information about the Freemint-list mailing list