[haiku-development] Re: Haiku Mesa3D status (mmlr gcc2 magic)

  • From: Alexander von Gluck <kallisti5@xxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Sun, 08 Jan 2012 01:06:16 -0600

On 07.01.2012 12:46, Alexander von Gluck wrote:
On 07.01.2012 08:48, Ingo Weinhold wrote:
On 2012-01-07 at 14:07:53 [+0100], Oliver Tappe <zooey@xxxxxxxxxxxxxxx> wrote:
On 2012-01-07 at 02:06:35 [+0100], Alexander von Gluck
<kallisti5@xxxxxxxxxxx> wrote:
> mmlr figured out a way to put the gcc4 compiled mesa into the gcc2 haiku
> build process and come out with a libGL.so consisting of:
>
> <Haiku gcc2 opengl kit> + <Mesa gcc4 binaries> + <haiku gcc4 libstd +
> libstdc++>
>
>
> This process works for gcc2 builds. You can try it here:
> http://pub.haikufire.com/mesa/haiku-mesa-gcc2.image.gz
>
> Here is the general process:
>   - We build a gcc4 mesa optional package
>   - We extract c++ symbols that the haiku build gcc2 linking was
>   complaining
> about from the gcc4 libstd + libstdc++ and create a mini gcc4 standard
> static library.

I hate to spoil the party, but I'm not so sure that getting this setup past
the linking stage means that it will actually work reliably. The problem
here
is that not only there is a difference in symbol mangling between gcc2 and gcc4, but there's also a completely rewritten libstdc++ being used by gcc4. Maybe it does work (to some extent), but I suppose that'd be by coincidence
rather than by purpose.

Agreed. Please let's avoid this kind of hack. We've started avoiding to mix
gcc 2 and gcc 4 C only libraries (by building a version for each gcc)
although it could (and seems to) work in most instances, because verifying
that it really does work correctly is virtually impossible. There are all
kinds of subtle errors that can be caused and that's a truly bad situation
for a complex system.

Yeah, I agree.
...
   b) just before glsl was introduced.

 Cough.  I just compiled Mesa 7.8.2 under gcc2. 7.8.2 looks to be the last
version of Mesa Haiku gcc2 will be able to compile.

As-of right now the plan is to call different functions/etc within the gallium
software driver based on which GCC version is compiling it.

(eg, __GNUC__ > 2, define NEW_MESA)

Then post R1 when we *finally* can leave gcc2 in he dust it will be easy enough
to strip out the !NEW_MESA code. (not really code blocks, mostly a function
here and a function there that will need the ifdef)

 -- Alex

Other related posts: