All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/1] remove optimize by default while using qmake
@ 2020-01-07 12:32 Mehmet Sami Tok
  2020-01-07 12:32 ` [Buildroot] [PATCH 1/1] package/qt5: remove optimize by default on debug builds made with qmake Mehmet Sami Tok
  0 siblings, 1 reply; 5+ messages in thread
From: Mehmet Sami Tok @ 2020-01-07 12:32 UTC (permalink / raw)
  To: buildroot

When building qt projects with debug configuration on a host computer,
applications build with optimization even if not configured to.

Optimization flags in TARGET_CFLAGS are passed as default build
arguments of qt build commands. If they are not overriden or removed
manually from build arguments, any project build with optimization
level of root file system by default.

So I filtered optimization flags which are passed to "config.opt"
first, then made into "mkspecs/qdevice.pri".

Signed-off-by: Mehmet Sami TOK <mehmetsamitok@gmail.com>

Mehmet Sami Tok (1):
  package/qt5: remove optimize by default on debug builds made with
    qmake

 package/qt5/qt5base/qt5base.mk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

-- 
2.17.1

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

* [Buildroot] [PATCH 1/1] package/qt5: remove optimize by default on debug builds made with qmake
  2020-01-07 12:32 [Buildroot] [PATCH 0/1] remove optimize by default while using qmake Mehmet Sami Tok
@ 2020-01-07 12:32 ` Mehmet Sami Tok
  2021-08-05 20:03   ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Mehmet Sami Tok @ 2020-01-07 12:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Mehmet Sami Tok <mehmetsamitok@gmail.com>
---
 package/qt5/qt5base/qt5base.mk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 774c771bc9..3415172fcb 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -34,8 +34,12 @@ ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
 QT5BASE_CONFIGURE_OPTS += -no-optimize-debug
 endif
 
-QT5BASE_CFLAGS = $(TARGET_CFLAGS)
-QT5BASE_CXXFLAGS = $(TARGET_CXXFLAGS)
+# Passing optimization flags directly to CFLAGS or CXXFLAGS makes qmake
+# builds optimized by default. Decision of optimization while developing
+# with qmake should be leaved to configuration of the project.
+FILTERED_ITEMS = -O%
+QT5BASE_CFLAGS = $(filter-out $(FILTERED_ITEMS),$(TARGET_CFLAGS))
+QT5BASE_CXXFLAGS = $(filter-out $(FILTERED_ITEMS),$(TARGET_CXXFLAGS))
 
 ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
 QT5BASE_CFLAGS += -O0
-- 
2.17.1

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

* Re: [Buildroot] [PATCH 1/1] package/qt5: remove optimize by default on debug builds made with qmake
  2020-01-07 12:32 ` [Buildroot] [PATCH 1/1] package/qt5: remove optimize by default on debug builds made with qmake Mehmet Sami Tok
@ 2021-08-05 20:03   ` Thomas Petazzoni
  2021-08-06 11:39     ` Mehmet Sami Tok
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2021-08-05 20:03 UTC (permalink / raw)
  To: Mehmet Sami Tok; +Cc: Peter Seiderer, Julien Corjon, buildroot

Hello Mehmet,

On Tue,  7 Jan 2020 15:32:09 +0300
Mehmet Sami Tok <mehmetsamitok@gmail.com> wrote:

> diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
> index 774c771bc9..3415172fcb 100644
> --- a/package/qt5/qt5base/qt5base.mk
> +++ b/package/qt5/qt5base/qt5base.mk
> @@ -34,8 +34,12 @@ ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
>  QT5BASE_CONFIGURE_OPTS += -no-optimize-debug
>  endif
>  
> -QT5BASE_CFLAGS = $(TARGET_CFLAGS)
> -QT5BASE_CXXFLAGS = $(TARGET_CXXFLAGS)
> +# Passing optimization flags directly to CFLAGS or CXXFLAGS makes qmake
> +# builds optimized by default. Decision of optimization while developing
> +# with qmake should be leaved to configuration of the project.
> +FILTERED_ITEMS = -O%
> +QT5BASE_CFLAGS = $(filter-out $(FILTERED_ITEMS),$(TARGET_CFLAGS))
> +QT5BASE_CXXFLAGS = $(filter-out $(FILTERED_ITEMS),$(TARGET_CXXFLAGS))

Thanks for your patch, and sorry for the long delay in providing
feedback to you and your patch. However, what the code currently does
it what we want: we want the optimization level defined at the
Buildroot configuration level to apply to all packages. We certainly do
not want individual packages to pick and chose their own optimization
level. So basically, your proposal unfortunately goes against the
very principle of Buildroot. For this reason, I'm afraid we have to
reject your patch.

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/qt5: remove optimize by default on debug builds made with qmake
  2021-08-05 20:03   ` Thomas Petazzoni
@ 2021-08-06 11:39     ` Mehmet Sami Tok
  2021-08-06 12:47       ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Mehmet Sami Tok @ 2021-08-06 11:39 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Peter Seiderer, Julien Corjon, buildroot


[-- Attachment #1.1: Type: text/plain, Size: 2413 bytes --]

Hi Thomas,
Thanks for the response. This is an old patch and I don't know if the
problem is still there. But the main point of this patch was not changing
flags of Qt package build.
When you want to use gcc toolchain and qmake generated by buildroot, It was
affecting your application builds. These flags directly passed to qt
toolchain and even if you want to build a debug build of any application,
it is built with -o2. So the problem is not occuring when root file system
is created, it appears when you want to build something else with toolchain
generated by buildroot.

Best Regards,
Mehmet Sami Tok

Thomas Petazzoni <thomas.petazzoni@bootlin.com>, 5 Ağu 2021 Per, 23:03
tarihinde şunu yazdı:

> Hello Mehmet,
>
> On Tue,  7 Jan 2020 15:32:09 +0300
> Mehmet Sami Tok <mehmetsamitok@gmail.com> wrote:
>
> > diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/
> qt5base.mk
> > index 774c771bc9..3415172fcb 100644
> > --- a/package/qt5/qt5base/qt5base.mk
> > +++ b/package/qt5/qt5base/qt5base.mk
> > @@ -34,8 +34,12 @@ ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
> >  QT5BASE_CONFIGURE_OPTS += -no-optimize-debug
> >  endif
> >
> > -QT5BASE_CFLAGS = $(TARGET_CFLAGS)
> > -QT5BASE_CXXFLAGS = $(TARGET_CXXFLAGS)
> > +# Passing optimization flags directly to CFLAGS or CXXFLAGS makes qmake
> > +# builds optimized by default. Decision of optimization while developing
> > +# with qmake should be leaved to configuration of the project.
> > +FILTERED_ITEMS = -O%
> > +QT5BASE_CFLAGS = $(filter-out $(FILTERED_ITEMS),$(TARGET_CFLAGS))
> > +QT5BASE_CXXFLAGS = $(filter-out $(FILTERED_ITEMS),$(TARGET_CXXFLAGS))
>
> Thanks for your patch, and sorry for the long delay in providing
> feedback to you and your patch. However, what the code currently does
> it what we want: we want the optimization level defined at the
> Buildroot configuration level to apply to all packages. We certainly do
> not want individual packages to pick and chose their own optimization
> level. So basically, your proposal unfortunately goes against the
> very principle of Buildroot. For this reason, I'm afraid we have to
> reject your patch.
>
> Best regards,
>
> Thomas Petazzoni
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>


-- 
Best Regards,
İyi Günler Dilerim,
Mehmet Sami Tok

[-- Attachment #1.2: Type: text/html, Size: 3440 bytes --]

[-- Attachment #2: Type: text/plain, Size: 145 bytes --]

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/qt5: remove optimize by default on debug builds made with qmake
  2021-08-06 11:39     ` Mehmet Sami Tok
@ 2021-08-06 12:47       ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2021-08-06 12:47 UTC (permalink / raw)
  To: Mehmet Sami Tok; +Cc: Peter Seiderer, Julien Corjon, buildroot

Hello Mehmet,

On Fri, 6 Aug 2021 14:39:07 +0300
Mehmet Sami Tok <mehmetsamitok@gmail.com> wrote:

> Thanks for the response. This is an old patch and I don't know if the
> problem is still there. But the main point of this patch was not changing
> flags of Qt package build.
> When you want to use gcc toolchain and qmake generated by buildroot, It was
> affecting your application builds. These flags directly passed to qt
> toolchain and even if you want to build a debug build of any application,
> it is built with -o2. So the problem is not occuring when root file system
> is created, it appears when you want to build something else with toolchain
> generated by buildroot.

I see. Indeed in this case we might consider that we should obey to the
particular flags you specify rather than the ones from the Buildroot
configuration.

However, unless I misread your patch, it removed optimization flags
even for qmake packages built within Buildroot, which is not what we
want.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

end of thread, other threads:[~2021-08-06 12:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 12:32 [Buildroot] [PATCH 0/1] remove optimize by default while using qmake Mehmet Sami Tok
2020-01-07 12:32 ` [Buildroot] [PATCH 1/1] package/qt5: remove optimize by default on debug builds made with qmake Mehmet Sami Tok
2021-08-05 20:03   ` Thomas Petazzoni
2021-08-06 11:39     ` Mehmet Sami Tok
2021-08-06 12:47       ` Thomas Petazzoni

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.