[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Some questions about build options and toolchain

From: Russ Allbery
Subject: Re: [Bug-gnubg] Some questions about build options and toolchain
Date: Sat, 17 Jan 2015 17:23:13 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Philippe Michel <address@hidden> writes:

> Second question, for those who make binary packages for various
> distributions :

> With gnubg, the -O3 compilation flag brings a significant speed
> improvement. -ffast-math helps as well.

> What is your policy about such flags in upstream sources ? Do you follow
> them ? Override them ?

In general, in Debian, we set some default CFLAGS to use -O2 and a bunch
of security flags.  The security flags we just do across the board without
trying to figure out whether or not a given package necessarily benefits
from them.

I can pretty easily override that, though, and would tend to follow your
recommended flags (although I'd probably add the security flags in because
we have various audits to check for that, and even though it's mostly
pointless for gnubg, it's easier to standardize).  Debian normally doesn't
use -O3 because, for a lot of packages, -O3 is actually slower than -O2
because more aggressive loop unrolling blows the CPU instruction cache,
but that can vary by package.

The only caveat is that we build everything for a bunch of architectures,
and sometimes it's been necessary to back off on gcc optimization flags to
avoid bugs on some platforms.  But that's fairly rare.

> Finally, would it cause trouble to someone if gnubg was build as C99
> code (-std=gnu99 really, since it would have to cater with embedded
> asm).

Would be fine here, although I'm surprised it would make much difference.
For C, it normally doesn't.  Are you thinking about doing that just to get
better compiler warnings?

Russ Allbery (address@hidden)              <http://www.eyrie.org/~eagle/>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]