public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Martin Guy <martinwguy@gmail.com>
To: Anthony Foiani <anthony.foiani@gmail.com>
Cc: gabx <arnaud.gaboury@gmail.com>,
	crossgcc maillist <crossgcc@sourceware.org>
Subject: Re: gcc CXX_FLAGS
Date: Sun, 26 May 2013 12:51:00 -0000	[thread overview]
Message-ID: <CAL4-wQrNnbjMdsv_f0iXrgMxQ7saGtEuaXUBZhE0cDTV5o0Q-g@mail.gmail.com> (raw)
In-Reply-To: <CAOhNY-9KsYNcOFEMk4XUaPgRzbRwk4LAih8e-FX52mU7GdXJuw@mail.gmail.com>

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

  reply	other threads:[~2013-05-26 12:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25 14:01 gabx
2013-05-25 18:43 ` Anthony Foiani
2013-05-25 22:59   ` gabx
2013-05-25 23:07     ` Yann E. MORIN
2013-05-26  1:42     ` Anthony Foiani
2013-05-26 12:51       ` Martin Guy [this message]
2013-05-28 17:31         ` gabx
2013-05-29  7:23           ` Martin Guy
2013-05-29  9:02             ` gabx

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAL4-wQrNnbjMdsv_f0iXrgMxQ7saGtEuaXUBZhE0cDTV5o0Q-g@mail.gmail.com \
    --to=martinwguy@gmail.com \
    --cc=anthony.foiani@gmail.com \
    --cc=arnaud.gaboury@gmail.com \
    --cc=crossgcc@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).