couple jhalfs-X thoughts (long.. sorry.)

Jeremy Byron rjjbyron at shaw.ca
Sat Apr 29 16:35:28 PDT 2006


M.Canales.es wrote:
><snip>
> I'm working in integrate your code inside jhalfs. Look like the changes will 
> be not very intrusives.

Cool; thanks. :)

> Some comments:
> 
> - I think that the temporary tools don't need to be optimized. If I'm wrong 
> send me a cluebat.

Likely not, and I don't usually, but I figured it wouldn't hurt
anything; that is unless it takes significantly longer to build, but I
don't believe so. I'll run a comparison soon.

People with little HDD space might want to optimize them with "-s" to
keep the file sizes smaller.  (Rather than running strip at the end when
they may reach their limit before getting that far.)

Perhaps add CH5_OPT=1/0 and CH6_OPT=1/0 to common/opt_config and wrap a
conditional around the master.sh:wrt_optimize() calls?  (I was just
looking over my initial proposal and this was there.. forgot about it. lol)

That won't help people who might want different optimizations in ch5 and
ch6 (such as just "-s" in ch5 and "-O3 -march=athlon-fx -s" in ch6) but
that'd be a little more annoying to implement.

Anyhow, I won't lose any sleep over having ch5 optimized or not.

> - The book say that CFLAGS and CXXFLAGS must be unset when building GRUB. Have 
> you tried to run an optimized GRUB? That could to mean that GRUB must be 
> added to def_opt_override.

Doh.  I should have gone through the book and noted any optimization
warnings.  Forgot all about grub; yes it should be added to the override
list.  It builds successfully but fails when loading stage files into
the boot sector as a couple files are built larger than allowable IIRC.
 I haven't actually tried running an optimized grub in quite some time
though.

> - Also, the book say that if using CFLAGS you must to add "-fPIC" when 
> building Zlib and remove it afterwards. That could to mean that Zlib will 
> need a separate  LEVEL and be added to def_opt_override to use that level.

Yup.  Perhaps simply:
echo "zlib fPIC" >> common/def_opt_override

Then define C{,XX}FLAGS_fPIC in common/opt_config as "-fPIC" with a
comment that the "-fPIC" flag must be retained if other flags are added
to the section.  I think LDFLAGS can simply be "" here.

Makes it kinda descriptive; I'm not sure why I kept the numbers anyhow,
except that I had the test levels in mind at the time.

I got to thinking recently that the levels in the
common/def_opt_override file could be additive.  For example, given a
default optimization level of 'def' and zlib needs "-FPIC":
echo "zlib def,fPIC" >> common/def_opt_override
This way, when the script grabs the override level "def,fPIC" it can
concatenate both {C{,XX},LD}FLAGS_def and {C{,XX},LD}FLAGS_fPIC into
{C{,XX},LD}FLAGS.

Not sure how useful this would be, but it might save on some duplication
in the files.

Oh.. and I didn't add definitions for OTHER_{C{,XX},LD}FLAGS (and any
other flags there may be for optimizing that I don't know of).  Do folks
use these much/at all?

Anyhow, thanks much for the feedback and working this into jhalfs.
Jeremy.



More information about the alfs-discuss mailing list