Skip to Content.
Sympa Menu

sm-sorcery - Re: [SM-Sorcery]compiler flags

sm-sorcery AT lists.ibiblio.org

Subject: Discussion of Sorcery related topics

List archive

Chronological Thread  
  • From: Andrew Stitt <afrayedknot AT thefrayedknot.armory.com>
  • To: sm-sorcery AT lists.ibiblio.org
  • Subject: Re: [SM-Sorcery]compiler flags
  • Date: Sat, 7 Sep 2002 19:41:29 -0700

Im certainly glad you dont plan on using any of their code....wow
as far as whether you should add all those options and what they do,
my point of view is put them in even if they dont seem worthwhile,
because they may be to someone else (who knows) but we're about choice
right?

on the note of letting the user type in options the argument about
putting contradictory options doesnt hold much water because one can
just as easily choose athlon when running a pentium classic and get the
same results, just like if one put in bad options to configure during
a cast, or heck if you type rm -r / as root it was your fault. putting
everything into a menu and thinking everything out for someone is the
way of windows and mac's with their menu's and GUI's, i dont want to
get on a rant but the command line is what makes unix (linux) so great,
you have the ability to do whatever you want instead of hoping someone
has thought of it, or looked into it for you, and if you go blow your
system away cause you're an idiot oh well! what we ought to have is
what the user's already selected as their CFLAGS and then a box to type
in anything else they want to add with a little message of 'if you put
something here that breaks things we arent stopping you'


On Sun, Sep 08, 2002 at 02:38:20AM +0100, Chris Brien wrote:
> From: "Andrew Stitt" <afrayedknot AT thefrayedknot.armory.com>
> > > Perhaps you could list off these options? I don't plan on installing
> > > lunar linux anytime soon to look for myself :)
> > theres too many to type but im attaching their menu code.
>
> I read through optimize.lunar on lunar-linux.org earlier today when I read
> the original post. Suffice to say we will not be including any of their
> code! Enormous case statements, useless options, repeated sections; let me
> give an example:
>
> case $PLATFORM in
> x86) optimize_make $MAKES &&
> optimize_base $BOPT &&
> optimize_cpu $CPU &&
> optimize_speed ${SPD[@]} &&
> optimize_extra $XTRA &&
> optimize_fp $FPM &&
> optimize_ld ${LDF[@]} &&
> optimize_addon
> ;;
> Alpha) optimize_make $MAKES &&
> optimize_base $BOPT &&
> optimize_cpu $CPU &&
> optimize_speed ${SPD[@]} &&
> optimize_extra $XTRA &&
> optimize_fp $FPM &&
> optimize_ld ${LDF[@]} &&
> optimize_addon
> ;;
> PowerPC) optimize_make $MAKES &&
> optimize_base $BOPT &&
> optimize_cpu $CPU &&
> optimize_speed ${SPD[@]} &&
> optimize_extra $XTRA &&
> optimize_fp $FPM &&
> optimize_ld ${LDF[@]} &&
> optimize_addon
> ;;
> SPARC) optimize_make $MAKES &&
> optimize_base $BOPT &&
> optimize_cpu $CPU &&
> optimize_speed ${SPD[@]} &&
> optimize_extra $XTRA &&
> optimize_fp $FPM &&
> optimize_ld ${LDF[@]} &&
> optimize_addon
> ;;
> esac
>
> That's right people, a case statement for four different options which all
> do exactly the same thing!
> Now, a look at lunar's powerpc options:
>
> # Begin PowerPC options
> common) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> rios) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> rios1) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> rsc) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> rios2) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> rs64a) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p403) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p505) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p601) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p602) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p603) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p603e) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p604) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p604e) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p620) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p630) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p740) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p7400) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p7450) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p750) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p801) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p821) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p823) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> p860) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> power) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> power2) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
> powerpc) CFLAGS="$CFLAGS"
> CXXFLAGS="$CXXFLAGS"
> BUILD=""
> ;;
>
> This time, an enormous case statement that is entirely a no-op! (well,
> CFLAGS will be implicitly made into a string, but I'm sure it always is
> anyway.)
>
> There are a few more optimisation options, such
> as -foptimize-sibling-calls, -ffloat-store, -falign-functions and so on, but
> until I investigate exactly what these do, it would be pointless adding menu
> options - do they speed up or slow down code; do they make it smaller or
> bigger; do they allow better cache use? The option of adding your own may be
> useful, but may be more trouble than it's worth, allowing the use of options
> which either don't work together, or don't work on your CPU. The options for
> 3dnow, mmx, altivec etcetera are set seperately in lunar, allowing you to,
> say, try to use sse on an i386, only to find out floating point math doesn't
> work. Except that, because they don't set all the necessary CFLAGS (eg,
> altivec needs -mabi=altivec as well as -maltivec to actually do anything),
> these compiler options aren't actually used!
>
> Sorry for all the exclaimation marks, and sorry for completely berating
> their code, but, as the one who implemented the latest compiler options in
> sorcery, I can say that our code is an order of magnitude better. I will
> admit that the optimisation_menu could do with some more options, but it
> will not be simply added to and added to, in the way that lunar have done
> so.
>
> Chris
> aka zero_the_hero




Archive powered by MHonArc 2.6.24.

Top of Page