All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] cmake Release build overwrites Os
@ 2016-08-07 16:40 Waldemar Brodkorb
  2016-08-07 17:06 ` Samuel Martin
  2016-08-07 20:32 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Waldemar Brodkorb @ 2016-08-07 16:40 UTC (permalink / raw)
  To: buildroot

Hi,

while doing the m68k patch for assimp, I realized that following is
used to configure cmake based packages:
package/pkg-cmake.mk:           -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),RelWithDebInfo,Release)

This means that Cmake adds -O3 to the CFLAGS/CXXFLAGS _after_ -Os
and so get used.

Is this the correct behaviour or do I missed something?

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] cmake Release build overwrites Os
  2016-08-07 16:40 [Buildroot] cmake Release build overwrites Os Waldemar Brodkorb
@ 2016-08-07 17:06 ` Samuel Martin
  2016-08-07 20:32 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Martin @ 2016-08-07 17:06 UTC (permalink / raw)
  To: buildroot

Hi Waldemar, all,

On Sun, Aug 7, 2016 at 6:40 PM, Waldemar Brodkorb <wbx@openadk.org> wrote:
> Hi,
>
> while doing the m68k patch for assimp, I realized that following is
> used to configure cmake based packages:
> package/pkg-cmake.mk:           -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),RelWithDebInfo,Release)
>
> This means that Cmake adds -O3 to the CFLAGS/CXXFLAGS _after_ -Os
> and so get used.
>
> Is this the correct behaviour or do I missed something?
>
Hum... IMHO, the current behavior is not right :-/

It should be something like (not tested at all):
-DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),RelWithDebInfo,$$(if
$$(BR2_OPTIMIZE_S),MinSizeRel,Release))

Regards,

> best regards
>  Waldemar
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
Samuel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] cmake Release build overwrites Os
  2016-08-07 16:40 [Buildroot] cmake Release build overwrites Os Waldemar Brodkorb
  2016-08-07 17:06 ` Samuel Martin
@ 2016-08-07 20:32 ` Thomas Petazzoni
  2016-08-08 21:47   ` Khem Raj
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2016-08-07 20:32 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 7 Aug 2016 18:40:32 +0200, Waldemar Brodkorb wrote:

> while doing the m68k patch for assimp, I realized that following is
> used to configure cmake based packages:
> package/pkg-cmake.mk:           -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),RelWithDebInfo,Release)
> 
> This means that Cmake adds -O3 to the CFLAGS/CXXFLAGS _after_ -Os
> and so get used.
> 
> Is this the correct behaviour or do I missed something?

There are unfortunately lots and lots of packages whose build system
enforce some -O<xyz> option, regardless of what Buildroot defines. I'm
not sure how hard we want to work against those packages.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] cmake Release build overwrites Os
  2016-08-07 20:32 ` Thomas Petazzoni
@ 2016-08-08 21:47   ` Khem Raj
  0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2016-08-08 21:47 UTC (permalink / raw)
  To: buildroot


> On Aug 7, 2016, at 1:32 PM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> 
> Hello,
> 
> On Sun, 7 Aug 2016 18:40:32 +0200, Waldemar Brodkorb wrote:
> 
>> while doing the m68k patch for assimp, I realized that following is
>> used to configure cmake based packages:
>> package/pkg-cmake.mk:           -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),RelWithDebInfo,Release)
>> 
>> This means that Cmake adds -O3 to the CFLAGS/CXXFLAGS _after_ -Os
>> and so get used.
>> 
>> Is this the correct behaviour or do I missed something?
> 
> There are unfortunately lots and lots of packages whose build system
> enforce some -O<xyz> option, regardless of what Buildroot defines. I'm
> not sure how hard we want to work against those packages.
> 

Perhaps taking a inclusive approach is best case here. Where you define a global opt level
and let the _rogue_ packages override it. This will not make whole system follow your intended
opt level, but it might be middle ground. In some cases, apps override the opt levels because
other opt levels aren?t tested. So its better to not insert your own opt level and wake up
those heinous bugs.

> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160808/ce69140f/attachment.asc>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-08 21:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-07 16:40 [Buildroot] cmake Release build overwrites Os Waldemar Brodkorb
2016-08-07 17:06 ` Samuel Martin
2016-08-07 20:32 ` Thomas Petazzoni
2016-08-08 21:47   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.