Re: Compiling source code with my own flags

2010-06-29 Thread Tzafrir Cohen
On Mon, Jun 28, 2010 at 03:07:53PM -0400, Tomasz Maluszycki wrote:
> I would like to compile packages for my laptop by myself, and I'm
> tired of changing options in makefile by hand. Maybe is there way to
> add them by these configure scripts? If I remember correctly packages
> are built against i386 architecture, and for me it is waste of my CPU
> capabilities;
> 
> for example: instead of ' -g -O ' I would like to have ' -O3
> -std-gnu99 -m128bit-long-double -m64 -mssse3 -mfpmath=sse -march=core2
> '

  ./configure CFLAGS="whatever"

Or:

  CFLAGS="whatever" ./configure

See: ./configure --help

-- 
Tzafrir Cohen | tzaf...@jabber.org | VIM is
http://tzafrir.org.il || a Mutt's
tzaf...@cohens.org.il ||  best
tzaf...@debian.org|| friend


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100629085537.gn17...@pear.tzafrir.org.il



Re: Compiling source code with my own flags

2010-06-29 Thread Andre Majorel
On 2010-06-28 21:32 +0200, Sven Joachim wrote:
> On 2010-06-28 21:07 +0200, Tomasz Maluszycki wrote:

> > (for me -O3 is stable... I didn't had any problem with it)
> 
> Depends on the program, I think.  In general, -O3 produces bigger
> binaries (than -O2) that may or may not run faster.  Mozilla even
> builds with -Os by default.

You'd be surprised at the optimisations that GCC misses on i386.
I've seen it needlessly reload registers on every iteration on a
tight loop. Neither -O2 nor -O3 changed that. The only way to make
it generate sane code was -Os.

These days, it's not safe to assume that -O3 produces the fastest
binaries. Always benchmark it against -Os.

-- 
André Majorel 
bugs.debian.org, your one-stop shop for email addresses.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100629071142.ga14...@aym.net2.nerim.net



Re: Compiling source code with my own flags

2010-06-28 Thread Tomasz Maluszycki
2010/6/28 Sven Joachim :
> On 2010-06-28 21:07 +0200, Tomasz Maluszycki wrote:
>
>> I would like to compile packages for my laptop by myself, and I'm
>> tired of changing options in makefile by hand. Maybe is there way to
>> add them by these configure scripts? If I remember correctly packages
>> are built against i386 architecture, and for me it is waste of my CPU
>> capabilities;
>>
>> for example: instead of ' -g -O ' I would like to have ' -O3
>> -std-gnu99 -m128bit-long-double -m64 -mssse3 -mfpmath=sse -march=core2
>> '
>
> You don't want -m64 on i386.  Why don't you switch to the amd64
> architecture, where you get at least some of these optimizations by default?

I'm using AMD64 ;P And i don't want some of these optimizations by default,
I would like to have most of them

>
>> (for me -O3 is stable... I didn't had any problem with it)
>
> Depends on the program, I think.  In general, -O3 produces bigger
> binaries (than -O2) that may or may not run faster.  Mozilla even
> builds with -Os by default.
>

Yeah, but linkers and compilers have big workload, and they can profit from -O3
Mozilla(or Xulrunner?) could too use -O2 at least

>> is there simple way to do this?
>
> With recent dpkg versions (1.15.7 and newer) have a look at
> dpkg-buildflags(1).

After looking it seems that I can't find way to use this, and I can't
find any example file...

> Sven

Thanks for nice info :)

-- 
darkestkhan
--
jid: darkestk...@gmail.com


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/aanlktinl1v1wai9nhbc-ywghhn08_e8co4vklkwlh...@mail.gmail.com



Re: Compiling source code with my own flags

2010-06-28 Thread Sven Joachim
On 2010-06-28 21:07 +0200, Tomasz Maluszycki wrote:

> I would like to compile packages for my laptop by myself, and I'm
> tired of changing options in makefile by hand. Maybe is there way to
> add them by these configure scripts? If I remember correctly packages
> are built against i386 architecture, and for me it is waste of my CPU
> capabilities;
>
> for example: instead of ' -g -O ' I would like to have ' -O3
> -std-gnu99 -m128bit-long-double -m64 -mssse3 -mfpmath=sse -march=core2
> '

You don't want -m64 on i386.  Why don't you switch to the amd64
architecture, where you get at least some of these optimizations by default?

> (for me -O3 is stable... I didn't had any problem with it)

Depends on the program, I think.  In general, -O3 produces bigger
binaries (than -O2) that may or may not run faster.  Mozilla even
builds with -Os by default.

> is there simple way to do this?

With recent dpkg versions (1.15.7 and newer) have a look at
dpkg-buildflags(1).

Sven


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87vd93hs1k@turtle.gmx.de