[Mesa-dev] [PATCH] scons: Fix Haiku binary compatibility

Alexander von Gluck kallisti5 at unixzen.com
Tue Jun 12 00:05:48 CEST 2012


On 11.06.2012 14:32, Alexander von Gluck wrote:
> On 11.06.2012 14:04, Jose Fonseca wrote:
>> ----- Original Message -----
>>> From 44fa55d3f49884c824306504943ca2a1382601f0 Mon Sep 17 00:00:00
>>> 2001
>>>
>>> * Our binary compatibility is targeted to Pentimum or higher,
>>>   these changes ensure we keep proper optimizations
>>> * Fixes strange if statement
>>>   '! windows or debug or True'
>>> ---
>>>  scons/gallium.py |    9 ++++++++-
>>>  1 files changed, 8 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/scons/gallium.py b/scons/gallium.py
>>> index 2fa80db..f60c2d4 100755
>>> --- a/scons/gallium.py
>>> +++ b/scons/gallium.py
>>> @@ -327,7 +327,7 @@ def generate(env):
>>>                  #'-march=pentium4',
>>>              ]
>>>              if distutils.version.LooseVersion(ccversion) >=
>>>              distutils.version.LooseVersion('4.2') \
>>> -               and (platform != 'windows' or env['build'] == 'debug'
>>> or True):
>>> +               and platform not in ['windows', 'haiku']:
>>
>> This doesn't look correct. I don't remember the story of True here, but 
>> to avoid chaning windows behavior, it should
>> be
>>                   and platform != 'haiku'
>
> Good point. The problem is I thought that solution was messy so I decided 
> the more correct way would be to clean it
> up.
>
> Does anyone remember why the True was there? Looks like it may of been an 
> accident (or just bad logic)

Eh, I'll just change it to "and platform != 'haiku'" as you said to be safe.
Someone more knowledgeable of the Windows build can fix it later if it is a 
typo.

>>>                  # NOTE: We need to ensure stack is realigned given
>>>                  that we
>>>                  # produce shared objects, and have no control over
>>>                  the stack
>>>                  # alignment policy of the application. Therefore we
>>>                  need
>>> @@ -346,6 +346,13 @@ def generate(env):
>>>              if platform in ['windows', 'darwin']:
>>>                  # Workaround
>>>                  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216
>>>                  ccflags += ['-fno-common']
>>> +            if platform in ['haiku']:
>>> +                ccflags += [
>>> +                    '-mstackrealign', # ensure stack is aligned
>>> +                    '-march=i586', # Haiku target is Pentium
>>> +                    '-mtune=i686', # Use i686 where we can
>>> +                    '-mmmx', # Use mmx math where we can
>>
>> Any reason not to set -msse and -msse2 ?
>
> Haiku targets code to run on Pentimum and above. SSE was introduced on 
> Pentimum III :)

Cough. *Pentium*. Not sure where the mum came from.

  Thanks!
   -- Alex



More information about the mesa-dev mailing list