This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See crosstool-NG for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc CXX_FLAGS


In my efforts to do a similar thing, the most effective way to set
default flags in GCCturned out to be to create your own fake gcc
wrapper, a tiny shell script called "gcc" (maybe also "gcc-4.8",
"g++", "g++4.8") that calls the real gcc prefixing the supplied
arguments with "-Ox" as described towards the end of
martinwguy.co.uk/crunch/#UsingIt

To override -O settings specified by makefiles and similar, (since
most of them specify a -O flag) you may be able to get away with
passing your "-O" flag last in the wrapper instead of first. If this
doesn't work, you'll need to write a wrapper that loops through all
the supplied gcc options eliminating those that begin with -O.

   M

On 26/05/2013, Anthony Foiani <anthony.foiani@gmail.com> wrote:
> Arnaud --
>
> On Sat, May 25, 2013 at 4:59 PM, gabx <arnaud.gaboury@gmail.com> wrote:
>
>> Now I am still wondering if I need to pass again the flags when I build
>> the
>> android ROM or Kernel.
>
> Generally, yes.
>
> As Yann explained, the CT_CC_... variables are only used to build gcc
> itself; they are not set when you use the built gcc to build other
> projects.
>
> The "export ..." method should work, although you might want to try it
> with the defaults first -- the Linux kernel, at least, should be
> pretty smart about picking the right flags for the various hardware
> targets.  Picking other flags could very well lead to instability.
> (There was an issue with "-Os" on some platforms for quite a while,
> and that's even a fairly standard Linux kernel config option.)
>
> Also note that having a toolchain, or even a toolchain and a kernel,
> is only a small part of building a fully distribution that can run on
> a given platform.  It's been covered here before, e.g.;
>
> http://sourceware.org/ml/crossgcc/2013-03/msg00008.html
>
> If this level of indirection makes you uncomfortable, you might see if
> one of the "distribution building" tools (yocto, etc) has your
> platform as a target.
>
> Either way, good luck!
>
> Best regards,
> Anthony Foiani
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>
>

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]