building i386.rpm packages from src.rpm with -O0 instead -O2

Todd Zullinger tmz at pobox.com
Sat Jan 13 19:42:38 UTC 2007


Pawel wrote:
> Could You tell me whether is there any generic way to build RPM
> package (together with its *-debuginfo package) that would be
> compiled with -O0 instead of (usual) -02.

I can think of a few ways you could do this.  I'm not sure which way
is best in general or for your particular needs.

You could set the CFLAGS environmental variable to -O0 or you could
set the __global_cflags or optflags definition in your rpm config (or
in the spec file or on the command line).

If you use 'CFLAGS="-O0" rpmbuild -bb package.spec' it will work,
though you won't get some of the other flags that are defined in the
%optflags and %__global_cflags by rpm.  You can see what those things
default to by using 'rpm --showrc'.  My i386 FC6 install has these:

optflags: %{__global_cflags} -m32 -march=i686 -mtune=generic -fasynchronous-unwind-tables
__global_cflags: -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4

Hope that gets you started in the right direction (and/or prompts
someone else here to chime in with additions and corrections :).

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
======================================================================
Money can't buy happiness, but it sure makes living in misery easier.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20070113/2c7a8aba/attachment-0002.bin 


More information about the users mailing list