[csw-maintainers] Debugging with Sun Studio and mGAR

Sebastian Kayser skayser at opencsw.org
Wed Jul 8 19:28:56 CEST 2009


Mike Watters wrote:
> Maciej (Matchek) Blizinski wrote:
>> On Wed, Jun 24, 2009 at 8:36 PM, Sebastian Kayser<skayser at opencsw.org>
>> wrote:
>>> I guess it doesn't fully cover your answer, but regarding GAR, you can
>>> set
>>> GARFLAVOR to DBG if you want your binaries built with debugging
>>> symbols.
>>> This will also skip the step where GAR strips all the binaries. See
>>> [1].
>>
>> cups makefiles do honor CFLAGS, so GARFLAVOR = DBG, I can see that the
>> flag -g is present in compiler invocations.
>>
>> Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -I/usr/include/kerberosv5
>> -I/export/home/blizinski/build.5.10-i386/opt/csw/include
>> -I/opt/csw/include -I/usr/include/kerberosv5 -g
>> -I/export/home/blizinski/build.5.10-i386/opt/csw/include
>> -I/opt/csw/include  -DOPENSSL_DISABLE_OLD_DES_SUPPORT
>> -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
>> -D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
>> Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -I/usr/include/kerberosv5
>> -I/export/home/blizinski/build.5.10-i386/opt/csw/include
>> -I/opt/csw/include -g
>> -I/export/home/blizinski/build.5.10-i386/opt/csw/include
>> -I/opt/csw/include -DOPENSSL_DISABLE_OLD_DES_SUPPORT
>> -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
>> -D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
>> Using LDFLAGS=-L../cups -L../filter
>> -L/export/home/blizinski/build.5.10-i386/opt/csw/lib -L/opt/csw/lib
>> -R/opt/csw/lib   -w -KPIC -xO2
>                              ^^^
> the -xO2 is the optimization flag here... remove it and you should remove
> the
> optimization.

And just for the sake of completeness: GAR doesn't add such optimization
flags when you set GARFLAVOR=DBG. Just give

  GARFLAVOR=DBG gmake modenv

a try and GAR will tell you what flags it will use. This doesn't mean that
GAR will filter out such flags for you when you have set them manually
elsewhere, but it won't produce them on its own.

Sebastian



More information about the maintainers mailing list