bugGNUstep - Bugs: bug #27222, By default binaries should be...

Group
 
 

bug #27222: By default binaries should be built with '-g -O2'

Submitter:  Yavor Doganov <yavor>
Submitted:  Mon 10 Aug 2009 09:02:16 PM UTC
   
 
Category:  Makefiles Severity:  3 - Normal
Item Group:  Change Request Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 15 Aug 2009 09:32:54 PM UTC, comment #3: 

Thanks Yavor

I made the change.  It seems to work for me - let me know if it works for you. :-)

Thanks

Nicola Pero <nico>
Group Member
Tue 11 Aug 2009 11:15:51 AM UTC, comment #2: 

I think there are still plenty of bugs on some targets with -O3 and higher, so this seems risky.

I think this is most natural:

  • debug=yes (default): -g -O2
  • debug=no: -O2


If a developer/user wants unoptimized build for better debugging, `make OPTFLAG=-O0' is the way to go, just like in a typical autoconfiscated package one would do `./configure CFLAGS=-g'.

Yavor Doganov <yavor>
Tue 11 Aug 2009 10:34:28 AM UTC, comment #1: 

We can certainly change the default flags to be -g -O2.  Sounds like a good idea.

If we get some agreement on what the flags should be, we can easily implement them.  I guess you were thinking of

  • debug=yes (default): -g -O2


  • debug=no: -O3


Thanks

Nicola Pero <nico>
Group Member
Mon 10 Aug 2009 09:02:16 PM UTC, original submission:  

This change

2006-09-20  Nicola Pero <nicola.pero@meta-innovation.com>

        By default compile everything with debug=yes.  To get the
        traditional behaviour, please use 'make debug=no'.
        * common.make (debug): Turn on debug by default.

and the resulting comment and behavior:

# Enable debug by default.  This is according to the GNU Coding
# Standards.
ifneq ($(debug), no)
  debug = yes
endif

ifeq ($(debug), yes)
  # This is filtered out as it compromised debugging
  OPTFLAG := $(filter-out -O%, $(OPTFLAG))
...

is wrong.  The GNU Coding Standards require that packages should be built with debugging symbols (-g) by default, but does not go so far in agressively removing any optimization.  For example, '(standards)Configuration' says:

`VARIABLE=VALUE'
   ...
   For example, the user could issue `configure CFLAGS=-g
   CXXFLAGS=-g' to build with debugging information and
   without the default optimization.

For any package that uses the GNU Build System, if CFLAGS/CXXFLAGS/OBJCFLAGS/etc are not specified by the user, they are set to '-g -O2'.  This is a long time tradition, and GNUstep Make behaved this way until the above change.

This is causing us grief in Debian as the Debian Policy requires all binaries to be built with -O2 (unless there is a good reason for -O3); unoptimized builds are considered a bug so we have lots of "buggy" GNUstep packages now (from a Policy perspective, at least).

Yavor Doganov <yavor>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nico (Posted a comment)
  • -email is unavailable- added by yavor (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-08-15 nico Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code