From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30740 invoked by alias); 26 May 2013 12:51:41 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 30730 invoked by uid 89); 26 May 2013 12:51:40 -0000 X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-bk0-f47.google.com (HELO mail-bk0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 26 May 2013 12:51:39 +0000 Received: by mail-bk0-f47.google.com with SMTP id jg1so3184693bkc.20 for ; Sun, 26 May 2013 05:51:37 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.205.114.207 with SMTP id fb15mr11132958bkc.137.1369572696821; Sun, 26 May 2013 05:51:36 -0700 (PDT) Received: by 10.204.171.7 with HTTP; Sun, 26 May 2013 05:51:36 -0700 (PDT) In-Reply-To: References: <1369490491980-233249.post@n7.nabble.com> Date: Sun, 26 May 2013 12:51:00 -0000 Message-ID: Subject: Re: gcc CXX_FLAGS From: Martin Guy To: Anthony Foiani Cc: gabx , crossgcc maillist Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2013-05/txt/msg00053.txt.bz2 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 wrote: > Arnaud -- > > On Sat, May 25, 2013 at 4:59 PM, gabx 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