[haiku-development] Re: gcc on haiku

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 28 Oct 2007 16:54:14 +0100

On 2007-10-28 at 11:50:10 [+0100], Oliver Tappe <zooey@xxxxxxxxxxxxxxx> wrote:
> [discussion redirected to this list as input from others would be nice]
> 
> Hi Pier Luigi (and everyone else on this list),
> 
> On 2007-10-26 at 08:51:29 [+0200], Pier Luigi Fiorini
> <pierluigi.fiorini@xxxxxxxxx> wrote:
> > > On 2007-10-25 at 21:04:56 [+0200], Pier Luigi Fiorini
> > > <pierluigi.fiorini@xxxxxxxxx> wrote:
> > >> i tried replacing /boot/develop/headers with the haiku headers but they
> > >> are
> > >> incompatible with your gcc port on beos so i thoght it would be better 
> > >> to
> > >> build gcc on haiku. have you ever considered building it on haiku?
> > >
> > > What exactly do you mean by the haiku headers are incompatible with my 
> > > gcc
> > > port? What did you try to do and what happens instead?
> > 
> > I tried to compile some programs on Haiku (the Haikuware VMware image).
> > Perl was the first one, but it requires some sockets-related headers. 
> > Those
> > headers was not provided in /boot/develop/headers in BeOS R5, so I 
> > replaced
> > /boot/develop/headers with the Haiku headers folder.
> 
> Yes, and I think this should work (at least in theory) as haiku should be
> compatible with R5.
> 
> > Unfortunately some headers in
> > /boot/develop/tools/gnupro/i586-pc-beos/include requires headers like
> > be_setup.h, _G_config.h which was available on R5 but not in Haiku.
> 
> I have checked myself and indeed there are references to these files. While 
> I
> don't know about be_setup.h, I think _G_config.h is indeed required to be
> provided by haiku, as it contains the glibc-setup of the system.

Yep, _G_config.h is required and it is a public header. In Haiku's repository 
it lives in headers/glibc. When "installing" the headers one can e.g. copy it 
to posix/ for sake of simplicity.

Regarding be_setup.h, we don't have it and we don't really need it. When 
using the gcc built for BeOS, you probably have to copy it from BeOS, though.

> > Something tells me that is better to recompile gcc 2.95.3 on Haiku instead
> > of using the old gcc for BeOS.
> > Or is there another way to build applications which requires the Haiku
> > headers with the BeOS gcc?
> 
> Actually, I don't really know yet. Guys, do we have a plan here?

I think the main (maybe only?) difference between a gcc 2.95.3 built for BeOS 
and one built for Haiku are the headers. Part of gcc's build process 
(fixincludes, IIRC) is to analyze the target platform's standard C headers 
(stdlib.h, stdio.h, etc.), and, if they have potential issues, process them 
and put modified (i.e. "fixed") copies into gcc's include directory. Those 
copies shadow the original headers, when using the compiler to build 
something. So in effect when using BeOS' gcc under Haiku you partially 
compile sources with BeOS headers. This may or may not be a problem 
(apparently it is at least regarding the non-existing be_setup.h). Replacing 
BeOS gcc's include directory with that of a Haiku gcc might already solve the 
problem for good. In the end, building a native Haiku gcc is probably the 
safer choice, though.

CU, Ingo

Other related posts: