Opened 15 years ago

Closed 15 years ago

#2414 closed task (fixed)

Evaluate Optimization hint

Reported by: gerard@… Owned by: lfs-book@…
Priority: normal Milestone: 7.0
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

Chapter 6 - Introduction mentions the "Optimization" hint which was last updated in 2003. We need to evaluate to see if it's still relevant.

Attachments (1)

optimization.patch (6.8 KB ) - added by gerard@… 15 years ago.
Candicate patch to the hint itself to update a couple of things.

Download all attachments as: .zip

Change History (6)

comment:1 by bdubbs@…, 15 years ago

Milestone: 7.0

by gerard@…, 15 years ago

Attachment: optimization.patch added

Candicate patch to the hint itself to update a couple of things.

comment:2 by bdubbs@…, 15 years ago

I took a look at this hint with the patch and think a few things are left out.

First, it does not mention that if you set CFLAGS or CXXFLAGS, it may override some other optimizations that the original package developer pot it. For example, looking at the parted package, the developer has:

CFLAGS = -g -O2 -Werror

If you override this, you will lose the -Werror option. This isn't too bad, but you may also lose some needed options in some packages like -fPIC or other code generation options.

The hint should strongly recommend setting the CFLAGS and CXXFLAGS for individual packages and *not* leave then set generically.

Second, since LFS now supports a 'pure 64-bit' build, the hint does not mention some important architectures that are directly supported such as core2 or i686.

Overall, the issue of optimization is very complex. It is far more complex than this short hint implies. I think as it stands now, the hint will get more users into trouble than it will help.

comment:3 by Matthew Burgess, 15 years ago

Also note that GCC, in general, usually produces better/faster code in each release (although it usually takes longer to do so due to going through more passes). In addition, the default passes that are run under -O2 & -O3 will change from release to release which may render particular recommendations out of date quite frequently. I'm leaning towards us removing mention of this hint in the book.

comment:4 by bdubbs@…, 15 years ago

If you do remove it, note that it is referenced in two places in Chapter 6: Introduction and About Debugging.

comment:5 by bdubbs@…, 15 years ago

Resolution: fixed
Status: newclosed

Deleted the reference to the optimization hint at r9067.

Note: See TracTickets for help on using tickets.