mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Carsten Schlote <carsten.schlote@gmx.net>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 4/5] [compiler] Added OPTIMIZE options to enable GCC optimizer
Date: Fri, 15 Oct 2010 12:34:58 +0200	[thread overview]
Message-ID: <20101015103458.GB28242@pengutronix.de> (raw)
In-Reply-To: <1287054406-31713-4-git-send-email-carsten.schlote@gmx.net>

On Thu, Oct 14, 2010 at 01:06:45PM +0200, Carsten Schlote wrote:
> From: Carsten Schlote <c.schlote@konzeptpark.de>
> 
> With GCC 4.5.x the default option -Os causes problems on powerpc as it
> tries to move common code to libgcc2, which isn't correctly linked later.
> 
> With optimizer turned off, code compiles fine.
> 
> So I added some options to turn on/off optimization for all architectures
> and to choose between -Os and -O option.
> 
> In case your compiler produces broken code or refuses to link, just try
> without optimization. As it's an option no hack in the Makefile is required
> anymore.
>

Working around weird compiler behaviours is not a good argument for
selling this patch. Anyway, this can still be useful in several
situations like for example getting assembler code which is easier
to debug.

How about making this a choice?

choice
	prompt "compiler optimization"
	default CC_OPTIMIZE_FOR_SIZE

config CC_OPTIMIZE_FOR_SIZE
	bool "optimize for size"

config CC_OPTIMIZE_NONE
	bool "no optimization"

config CC_OPTIMIZE_SPEED
	bool "optimize for speed"

endchoice

This would simplify the ifdefs in the Makefiles. Also, size
optimization should be kept default.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2010-10-15 10:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 11:06 [PATCH 1/5] [ppc/mpc5xxx] Fixed typo in cpu_init.c Carsten Schlote
2010-10-14 11:06 ` [PATCH 2/5] [ppc/mpc5xxx] Small text cleanups and ADDECR to output Carsten Schlote
2010-10-14 11:06   ` [PATCH 3/5] [kp-mcb2] Added board files and configs for konzeptpark mcb2 Carsten Schlote
2010-10-14 11:06     ` [PATCH 4/5] [compiler] Added OPTIMIZE options to enable GCC optimizer Carsten Schlote
2010-10-14 11:06       ` [PATCH 5/5] [drivers/nor] Fixed mismatch in prototype Carsten Schlote
2010-10-15 10:34       ` Sascha Hauer [this message]
2010-10-15 10:22     ` [PATCH 3/5] [kp-mcb2] Added board files and configs for konzeptpark mcb2 Sascha Hauer

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=20101015103458.GB28242@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=carsten.schlote@gmx.net \
    /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