FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Packaging

 
 
LinkBack Thread Tools
 
Old 09-15-2010, 03:02 PM
Sergio Belkin
 
Default Macro %{optflags}

Hi,

Does Makefile flags from the tarball overrides %{optflags} ?

Thanks in advance!
--
--
Sergio Belkin http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
Sergio Belkin -
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 09-15-2010, 03:57 PM
Ralf Corsepius
 
Default Macro %{optflags}

On 09/15/2010 05:02 PM, Sergio Belkin wrote:
> Hi,
>
> Does Makefile flags from the tarball overrides %{optflags} ?

This question can't be answered.

%{optflags} and Makefiles actually are entirely unrelated.

How to communicate %{optflags} to Makefiles can vary largely between
rpm.specs and is part of the job package maintainers are supposed to
take care of.

Ralf
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 09-16-2010, 01:49 PM
Sergio Belkin
 
Default Macro %{optflags}

2010/9/15 Ralf Corsepius <rc040203@freenet.de>:
> On 09/15/2010 05:02 PM, Sergio Belkin wrote:
>>
>> Hi,
>>
>> Does Makefile flags from the tarball overrides %{optflags} ?
>
> This question can't be answered.
>
> %{optflags} and Makefiles actually are entirely unrelated.
>
> How to communicate %{optflags} to Makefiles can vary largely between
> rpm.specs and is part of the job package maintainers are supposed to take
> care of.
>
> Ralf
>

Well I am really newbie packaging,

As rpm command:
rpm --eval "%{optflags}"
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686
-mtune=atom -fasynchronous-unwind-tables

but Makefile contains:

CXXFLAGS=-ansi -Wall -Wno-deprecated

So, what of these flags are commited?

Sorry if my question is somewhat dumb

--
--
Sergio Belkin http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
Sergio Belkin -
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 09-16-2010, 01:59 PM
Andrea Musuruane
 
Default Macro %{optflags}

On Thu, Sep 16, 2010 at 3:49 PM, Sergio Belkin <sebelk@gmail.com> wrote:
> Well I am really newbie packaging,
>
> As rpm command:
> rpm --eval "%{optflags}"
> -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686
> -mtune=atom -fasynchronous-unwind-tables
>
> but Makefile contains:
>
> CXXFLAGS=-ansi *-Wall -Wno-deprecated
>
> So, what of these flags are commited?

Probably the ones in the Makefile. You must always check the output
from make to see what flags are used. It is your duty to communicate
%{optflags} to Makefile. Often patching is required, other times it is
sufficient to set the appropriate flags when calling make.

Bye,

Andrea.
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 09-16-2010, 02:09 PM
Ralf Corsepius
 
Default Macro %{optflags}

On 09/16/2010 03:49 PM, Sergio Belkin wrote:
> 2010/9/15 Ralf Corsepius<rc040203@freenet.de>:
>> On 09/15/2010 05:02 PM, Sergio Belkin wrote:
>>>
>>> Hi,
>>>
>>> Does Makefile flags from the tarball overrides %{optflags} ?
>>
>> This question can't be answered.
>>
>> %{optflags} and Makefiles actually are entirely unrelated.
>>
>> How to communicate %{optflags} to Makefiles can vary largely between
>> rpm.specs and is part of the job package maintainers are supposed to take
>> care of.
>>
>> Ralf
>>
>
> Well I am really newbie packaging,
Everybody is a newbie, somewhere

> As rpm command:
> rpm --eval "%{optflags}"
> -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686
> -mtune=atom -fasynchronous-unwind-tables
>
> but Makefile contains:
>
> CXXFLAGS=-ansi -Wall -Wno-deprecated
>
> So, what of these flags are commited?
To be able to help, you'd have to provide further details about the
package you are trying to package, because there are several way to
communicate %{optflags} to a package's build-system.

E.g.

* Plain simple Makefile:
Override the make-variable to receive %optflags from the environment at
make-time:

make CFLAGS="%{optflags}"

* Modern autotools:
Pass optflags as args at configure-time:
.../configure CFLAGS="%{optflags}"

* Old autotools:
Pass from the environment:
CFLAGS="%{optflags}" .../configure

* Poorly written Makefiles which don't allow overriding from the
environment:
Textual substitution before runming make:

sed -i -e "s,^CFLAGS.*,CFLAGS = %{optflags}," Makefile
make ....

etc. etc.

Also note that the name of the make-variable to take %optflags may vary.
In most cases it's CFLAGS, in c++-projects it's often CXXFLAGS.


Ralf






--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 09-17-2010, 03:05 PM
Sergio Belkin
 
Default Macro %{optflags}

2010/9/16 Ralf Corsepius <rc040203@freenet.de>:
> On 09/16/2010 03:49 PM, Sergio Belkin wrote:
>> 2010/9/15 Ralf Corsepius<rc040203@freenet.de>:
>>> On 09/15/2010 05:02 PM, Sergio Belkin wrote:
>>>>
>>>> Hi,
>>>>
>>>> Does Makefile flags from the tarball overrides %{optflags} ?
>>>
>>> This question can't be answered.
>>>
>>> %{optflags} and Makefiles actually are entirely unrelated.
>>>
>>> How to communicate %{optflags} to Makefiles can vary largely between
>>> rpm.specs and is part of the job package maintainers are supposed to take
>>> care of.
>>>
>>> Ralf
>>>
>>
>> Well I am really newbie packaging,
> Everybody is a newbie, somewhere
>
>> As rpm command:
>> rpm --eval "%{optflags}"
>> -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
>> -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686
>> -mtune=atom -fasynchronous-unwind-tables
>>
>> but Makefile contains:
>>
>> CXXFLAGS=-ansi *-Wall -Wno-deprecated
> *>
>> So, what of these flags are commited?
> To be able to help, you'd have to provide further details about the
> package you are trying to package, because there are several way to
> communicate %{optflags} to a package's build-system.
>
> E.g.
>
> * Plain simple Makefile:
> Override the make-variable to receive %optflags from the environment at
> make-time:
>
> make CFLAGS="%{optflags}"
>
> * Modern autotools:
> Pass optflags as args at configure-time:
> .../configure CFLAGS="%{optflags}"
>
> * Old autotools:
> Pass from the environment:
> CFLAGS="%{optflags}" .../configure
>
> * Poorly written Makefiles which don't allow overriding from the
> environment:
> Textual substitution before runming make:
>
> sed -i -e "s,^CFLAGS.*,CFLAGS = %{optflags}," Makefile
> make ....
>
> etc. etc.
>
> Also note that the name of the make-variable to take %optflags may vary.
> In most cases it's CFLAGS, in c++-projects it's often CXXFLAGS.
>
>
> Ralf
>
>
>
>
>
>
> --
> packaging mailing list
> packaging@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging
>

Thanks!

The package is a development library in C++. It has a plain Makefile.

I verified and in fact make overrides Makefile flags if they are
explicit, I've tested using:

make lib CXXFLAGS="%{optflags}"

in spec file.

I could see that by the ouput. As a matter of fact, I'd want to use
Makefile flags because optflags use things like "-mtune" ... for
exampel I'm building on a netbook and I don't like that it makes atom
optimizations... doesn't it make sense, does it?

TIA
--
--
Sergio Belkin http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
Sergio Belkin -
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 09-18-2010, 02:56 PM
Mattias Ellert
 
Default Macro %{optflags}

fre 2010-09-17 klockan 12:05 -0300 skrev Sergio Belkin:

> I could see that by the output. As a matter of fact, I'd want to use
> Makefile flags because optflags use things like "-mtune" ... for
> example I'm building on a netbook and I don't like that it makes atom
> optimizations... doesn't it make sense, does it?
>
> TIA

$ setarch i686 rpm -E %optflags
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
-fasynchronous-unwind-tables

Using -mtune=atom is the correct flag when building ix86 rpms for the
most recent Fedora releases. The optflags are by design the same on any
ix86 installation - they do not change depending on what hardware is
present on the build machine. That you are building on a netbook does
not influence what %optflags is expanded into.

Mattias

--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 09-18-2010, 06:15 PM
Sergio Belkin
 
Default Macro %{optflags}

2010/9/18 Mattias Ellert <mattias.ellert@fysast.uu.se>:
> fre 2010-09-17 klockan 12:05 -0300 skrev Sergio Belkin:
>
>> I could see that by the output. As a matter of fact, I'd want to use
>> Makefile flags because optflags use things like "-mtune" ... for
>> example I'm building on a netbook and I don't like that it makes atom
>> optimizations... doesn't it make sense, does it?
>>
>> TIA
>
> $ setarch i686 rpm -E %optflags
> -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
> -fasynchronous-unwind-tables
>
> Using -mtune=atom is the correct flag when building ix86 rpms for the
> most recent Fedora releases. The optflags are by design the same on any
> ix86 installation - they do not change depending on what hardware is
> present on the build machine. That you are building on a netbook does
> not influence what %optflags is expanded into.
>
> * * * *Mattias
>
>

Mmm... Now I am a bit confused. So... Isn't "-mtune" an optimization
flag for a specific target arch. ?


Please correct me if I'am wrong
--
--
Sergio Belkin http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
Sergio Belkin -
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 09-18-2010, 06:27 PM
Garrett Holmstrom
 
Default Macro %{optflags}

On 9/18/2010 13:15, Sergio Belkin wrote:
> 2010/9/18 Mattias Ellert<mattias.ellert@fysast.uu.se>:
>> Using -mtune=atom is the correct flag when building ix86 rpms for the
>> most recent Fedora releases. The optflags are by design the same on any
>> ix86 installation - they do not change depending on what hardware is
>> present on the build machine. That you are building on a netbook does
>> not influence what %optflags is expanded into.
>>
>> Mattias
>>
>>
>
> Mmm... Now I am a bit confused. So... Isn't "-mtune" an optimization
> flag for a specific target arch. ?
>
>
> Please correct me if I'am wrong

You are mostly right, but it is "-march" that defines the instruction
set to be used. "-mtune" chooses which CPU the compiler will try to
optimize for within the limits of the chosen instruction set. Fedora
uses "atom" for this value, but that does not make it incompatible with
other hardware.
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 01-23-2011, 07:45 PM
Sergio Belkin
 
Default Macro %{optflags}

2010/9/16 Ralf Corsepius <rc040203@freenet.de>:
> On 09/16/2010 03:49 PM, Sergio Belkin wrote:
>> 2010/9/15 Ralf Corsepius<rc040203@freenet.de>:
>>> On 09/15/2010 05:02 PM, Sergio Belkin wrote:
>>>>
>>>> Hi,
>>>>
>>>> Does Makefile flags from the tarball overrides %{optflags} ?
>>>
>>> This question can't be answered.
>>>
>>> %{optflags} and Makefiles actually are entirely unrelated.
>>>
>>> How to communicate %{optflags} to Makefiles can vary largely between
>>> rpm.specs and is part of the job package maintainers are supposed to take
>>> care of.
>>>
>>> Ralf
>>>
>>
>> Well I am really newbie packaging,
> Everybody is a newbie, somewhere
>
>> As rpm command:
>> rpm --eval "%{optflags}"
>> -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
>> -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686
>> -mtune=atom -fasynchronous-unwind-tables
>>
>> but Makefile contains:
>>
>> CXXFLAGS=-ansi *-Wall -Wno-deprecated
> *>
>> So, what of these flags are commited?
> To be able to help, you'd have to provide further details about the
> package you are trying to package, because there are several way to
> communicate %{optflags} to a package's build-system.
>
> E.g.
>
> * Plain simple Makefile:
> Override the make-variable to receive %optflags from the environment at
> make-time:
>
> make CFLAGS="%{optflags}"

It doesn't work.

>
> * Modern autotools:
> Pass optflags as args at configure-time:
> .../configure CFLAGS="%{optflags}"

It doesn't work either.

>
> * Old autotools:
> Pass from the environment:
> CFLAGS="%{optflags}" .../configure

Id above. No way.

I've tried even:

%configure CXXFLAGS="-ansi"

and

make CXXFLAGS="-ansi"


It's weird, if I do the same with the tarballs with autotools, always
prevail those flags submitted by the user at configure&&make time.

and the problem stays here: I mean default flags always go after my
custom ones. Is that deliberately from Fedora packaging system?



> Ralf

--
--
Sergio Belkin *http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
LPIC-2 Certified
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 

Thread Tools




All times are GMT. The time now is 01:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org