Skip to contentSkip to conversation

package/qt5base: fix building with correct optimization

PATCH New Giulio Benetti 2 participants 6 messages Oct 1, 2019 – Oct 2, 2019 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/qt5base: fix building with correct optimization

On previous patch:
https://git.buildroot.net/buildroot/commit/?id=7c0aa83527e0b0179f9e3f73a3e63df1fdc5a6e6
we didn't take care that QMAKE_CXXFLAGS_RELEASE variable is set to QMAKE_CFLAGS_OPTIMIZE(-O2) inside the same file:
mkspecs/common/gcc-base.conf
So overriding all QMAKE_CFLAGS_OPTIMIZE* variables after gcc.base.conf file doesn't change the content of QMAKE_CXXFLAGS_RELEASE. QMAKE_CXXFLAGS_RELEASE/DEBUG is appended to the end of QMAKE_CXXFLAGS in mkspecs/features/default_post.prf if building with or without debug symbols.

Let's override directly QMAKE_CFLAGS_RELEASE/DEBUG and QMAKE_CXXFLAGS_RELEASE/DEBUG in qmake.conf.in and drop all QMAKE_CFLAGS_OPTIMIZE* variables overriding.

Fixes:
http://autobuild.buildroot.net/results/ada/adaa9b4bcc6f9d2b5e82c479859a07e8abf5cf13/
http://autobuild.buildroot.net/results/a83/a83bdd1f3bf309c07abebe871b017c331ed36e67/

---
 package/qt5/qt5base/qmake.conf.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
package/qt5/qt5base/qmake.conf.in +4 -4
index 2eb564e172..66b80c302a 100644
@@ -15,10 +15,10 @@ QMAKE_CXX               = $${CROSS_COMPILE}g++
 # modifications to gcc-base.conf
 QMAKE_CFLAGS           += $${BR_COMPILER_CFLAGS}
 QMAKE_CXXFLAGS         += $${BR_COMPILER_CXXFLAGS}
-QMAKE_CFLAGS_OPTIMIZE       =
-QMAKE_CFLAGS_OPTIMIZE_DEBUG =
-QMAKE_CFLAGS_OPTIMIZE_FULL  =
-QMAKE_CFLAGS_OPTIMIZE_SIZE  =
+QMAKE_CFLAGS_DEBUG =
+QMAKE_CXXFLAGS_DEBUG =
+QMAKE_CFLAGS_RELEASE =
+QMAKE_CXXFLAGS_RELEASE =
 CONFIG                 += nostrip
 
 QMAKE_LIBS             += -lrt -lpthread -ldl
Signature · 1 line
2.20.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 1/1 package/qt5base: fix building with correct optimization

Re-added buildroot at builroot.org and Julien Corjon to CC (hit the wrong button for reply)...

Regards,
Peter

Quoted 75 lines · Peter Seiderer

Hello Giulio,

Quoted 11 lines · Giulio Benetti

On previous patch:
https://git.buildroot.net/buildroot/commit/?id=7c0aa83527e0b0179f9e3f73a3e63df1fdc5a6e6
we didn't take care that QMAKE_CXXFLAGS_RELEASE variable is set to QMAKE_CFLAGS_OPTIMIZE(-O2) inside the same file:
mkspecs/common/gcc-base.conf
So overriding all QMAKE_CFLAGS_OPTIMIZE* variables after gcc.base.conf file doesn't change the content of QMAKE_CXXFLAGS_RELEASE. QMAKE_CXXFLAGS_RELEASE/DEBUG is appended to the end of QMAKE_CXXFLAGS in mkspecs/features/default_post.prf if building with or without debug symbols.

Quoted 3 lines

Let's override directly QMAKE_CFLAGS_RELEASE/DEBUG and QMAKE_CXXFLAGS_RELEASE/DEBUG in qmake.conf.in and drop all QMAKE_CFLAGS_OPTIMIZE* variables overriding.

What is the difference in the resulting compile flags?

Quoted 4 lines

Fixes:
http://autobuild.buildroot.net/results/ada/adaa9b4bcc6f9d2b5e82c479859a07e8abf5cf13/
http://autobuild.buildroot.net/results/a83/a83bdd1f3bf309c07abebe871b017c331ed36e67/

qgeoaddress.cpp: In function 'QString formattedAddress(const QGeoAddress&, const QString&)':
qgeoaddress.cpp:285:1: error: VOIDmode on an output
}
^
(insn 849 12033 850 87 (parallel [

              (const_int 0 [0])
              (reg:SI 970)
              (mem/v:SI (reg/f:SI 3694 [ D.102094.d ]) [-1  S4 A32])
              (reg:SI 970)
              (reg:SI 3527)
              (const_int 0 [0])
              (const_int 32773 [0x8005])
              (const_int 0 [0])
              (clobber (scratch:SI))
          ]) "/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/microblazeel-buildroot-linux-uclibc/include/c++/7.4.0/bits/atomic_base.h":304 85 {atomic_compare_and_swapsi}
       (nil))

qgeoaddress.cpp:285:1: internal compiler error: in do_output_reload, at reload1.c:7978

And why does it fix in internal compile error?

Regards,
Peter

Quoted 25 lines
---
 package/qt5/qt5base/qmake.conf.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
package/qt5/qt5base/qmake.conf.in +4 -4
index 2eb564e172..66b80c302a 100644
@@ -15,10 +15,10 @@ QMAKE_CXX               = $${CROSS_COMPILE}g++
 # modifications to gcc-base.conf
 QMAKE_CFLAGS           += $${BR_COMPILER_CFLAGS}
 QMAKE_CXXFLAGS         += $${BR_COMPILER_CXXFLAGS}
-QMAKE_CFLAGS_OPTIMIZE       =
-QMAKE_CFLAGS_OPTIMIZE_DEBUG =
-QMAKE_CFLAGS_OPTIMIZE_FULL  =
-QMAKE_CFLAGS_OPTIMIZE_SIZE  =
+QMAKE_CFLAGS_DEBUG =
+QMAKE_CXXFLAGS_DEBUG =
+QMAKE_CFLAGS_RELEASE =
+QMAKE_CXXFLAGS_RELEASE =
 CONFIG                 += nostrip
 
 QMAKE_LIBS             += -lrt -lpthread -ldl
#3 lore raw

PATCH 1/1 package/qt5base: fix building with correct optimization

Hi Peter,

Quoted 27 lines · Peter Seiderer

Re-added buildroot at builroot.org and Julien Corjon to CC (hit the wrong button for reply)...

Regards,
Peter

Quoted 20 lines · Peter Seiderer

Hello Giulio,

Quoted 11 lines · Giulio Benetti

On previous patch:
https://git.buildroot.net/buildroot/commit/?id=7c0aa83527e0b0179f9e3f73a3e63df1fdc5a6e6
we didn't take care that QMAKE_CXXFLAGS_RELEASE variable is set to QMAKE_CFLAGS_OPTIMIZE(-O2) inside the same file:
mkspecs/common/gcc-base.conf
So overriding all QMAKE_CFLAGS_OPTIMIZE* variables after gcc.base.conf file doesn't change the content of QMAKE_CXXFLAGS_RELEASE. QMAKE_CXXFLAGS_RELEASE/DEBUG is appended to the end of QMAKE_CXXFLAGS in mkspecs/features/default_post.prf if building with or without debug symbols.

Quoted 3 lines

Let's override directly QMAKE_CFLAGS_RELEASE/DEBUG and QMAKE_CXXFLAGS_RELEASE/DEBUG in qmake.conf.in and drop all QMAKE_CFLAGS_OPTIMIZE* variables overriding.

What is the difference in the resulting compile flags?

Before QMAKE_CFLAGS_OPTIMIZE(-O2) was appended at the end.

Quoted 23 lines
Quoted 23 lines
Quoted 4 lines

Fixes:
http://autobuild.buildroot.net/results/ada/adaa9b4bcc6f9d2b5e82c479859a07e8abf5cf13/
http://autobuild.buildroot.net/results/a83/a83bdd1f3bf309c07abebe871b017c331ed36e67/

qgeoaddress.cpp: In function 'QString formattedAddress(const QGeoAddress&, const QString&)':
qgeoaddress.cpp:285:1: error: VOIDmode on an output

    }
  ^
   (insn 849 12033 850 87 (parallel [
               (const_int 0 [0])
               (reg:SI 970)
               (mem/v:SI (reg/f:SI 3694 [ D.102094.d ]) [-1  S4 A32])
               (reg:SI 970)
               (reg:SI 3527)
               (const_int 0 [0])
               (const_int 32773 [0x8005])
               (const_int 0 [0])
               (clobber (scratch:SI))
           ]) "/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/microblazeel-buildroot-linux-uclibc/include/c++/7.4.0/bits/atomic_base.h":304 85 {atomic_compare_and_swapsi}
        (nil))

qgeoaddress.cpp:285:1: internal compiler error: in do_output_reload, at reload1.c:7978

Quoted 1 line
Quoted 1 line

And why does it fix in internal compile error?

Oops right,
it fixes the ICE by *not* overriding -O0 with QMAKE_CFLAGS_OPTIMIZE(-O2) appended.

Do I reword the patch?

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
#4 lore raw

PATCH 1/1 package/qt5base: fix building with correct optimization

Hello Giulio,

Quoted 25 lines · Giulio Benetti

Hi Peter,

Quoted 22 lines · Peter Seiderer

Re-added buildroot at builroot.org and Julien Corjon to CC (hit the wrong button for reply)...

Regards,
Peter

Quoted 15 lines · Peter Seiderer

Hello Giulio,

Quoted 11 lines · Giulio Benetti

On previous patch:
https://git.buildroot.net/buildroot/commit/?id=7c0aa83527e0b0179f9e3f73a3e63df1fdc5a6e6
we didn't take care that QMAKE_CXXFLAGS_RELEASE variable is set to QMAKE_CFLAGS_OPTIMIZE(-O2) inside the same file:
mkspecs/common/gcc-base.conf
So overriding all QMAKE_CFLAGS_OPTIMIZE* variables after gcc.base.conf file doesn't change the content of QMAKE_CXXFLAGS_RELEASE. QMAKE_CXXFLAGS_RELEASE/DEBUG is appended to the end of QMAKE_CXXFLAGS in mkspecs/features/default_post.prf if building with or without debug symbols.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

Let's override directly QMAKE_CFLAGS_RELEASE/DEBUG and QMAKE_CXXFLAGS_RELEASE/DEBUG in qmake.conf.in and drop all QMAKE_CFLAGS_OPTIMIZE* variables overriding.

What is the difference in the resulting compile flags?

Before QMAKE_CFLAGS_OPTIMIZE(-O2) was appended at the end.

I see the following in the logfiles:

	/home/test/autobuild/run/instance-0/output-1/host/bin/microblazeel-linux-g++ -c -pipe \
		-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -O0 \
		--sysroot=/home/test/autobuild/run/instance-0/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot \
		-O2 -std=c++1z ...

- '-Os' is from BR2_OPTIMIZE_S=y?
- '-O0' is from?
- '-O2' is fixed/removed with your patch?

Do your have an compiler command line example with your patch applied (did not yet find enough time to test the patch locally)?

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 5 lines

Fixes:
http://autobuild.buildroot.net/results/ada/adaa9b4bcc6f9d2b5e82c479859a07e8abf5cf13/
http://autobuild.buildroot.net/results/a83/a83bdd1f3bf309c07abebe871b017c331ed36e67/

qgeoaddress.cpp: In function 'QString formattedAddress(const QGeoAddress&, const QString&)':
qgeoaddress.cpp:285:1: error: VOIDmode on an output

    }
  ^
   (insn 849 12033 850 87 (parallel [
               (const_int 0 [0])
               (reg:SI 970)
               (mem/v:SI (reg/f:SI 3694 [ D.102094.d ]) [-1  S4 A32])
               (reg:SI 970)
               (reg:SI 3527)
               (const_int 0 [0])
               (const_int 32773 [0x8005])
               (const_int 0 [0])
               (clobber (scratch:SI))
           ]) "/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/microblazeel-buildroot-linux-uclibc/include/c++/7.4.0/bits/atomic_base.h":304 85 {atomic_compare_and_swapsi}
        (nil))

qgeoaddress.cpp:285:1: internal compiler error: in do_output_reload, at reload1.c:7978

Quoted 7 lines
Quoted 1 line
Quoted 1 line

And why does it fix in internal compile error?

Oops right,
it fixes the ICE by *not* overriding -O0 with QMAKE_CFLAGS_OPTIMIZE(-O2) appended.

Do I reword the patch?

Suggestion (or something similar):

Avoids the internal compiler error by avoiding the '-O2' optimization and applying the '-Os' buildroot default.

Regards,
Peter

Quoted 2 lines

Best regards

#5 lore raw

PATCH 1/1 package/qt5base: fix building with correct optimization

Hello Giulio,

Quoted 39 lines · Peter Seiderer

Hello Giulio,

Quoted 25 lines · Giulio Benetti

Hi Peter,

Quoted 22 lines · Peter Seiderer

Re-added buildroot at builroot.org and Julien Corjon to CC (hit the wrong button for reply)...

Regards,
Peter

Quoted 15 lines · Peter Seiderer

Hello Giulio,

Quoted 11 lines · Giulio Benetti

On previous patch:
https://git.buildroot.net/buildroot/commit/?id=7c0aa83527e0b0179f9e3f73a3e63df1fdc5a6e6
we didn't take care that QMAKE_CXXFLAGS_RELEASE variable is set to QMAKE_CFLAGS_OPTIMIZE(-O2) inside the same file:
mkspecs/common/gcc-base.conf
So overriding all QMAKE_CFLAGS_OPTIMIZE* variables after gcc.base.conf file doesn't change the content of QMAKE_CXXFLAGS_RELEASE. QMAKE_CXXFLAGS_RELEASE/DEBUG is appended to the end of QMAKE_CXXFLAGS in mkspecs/features/default_post.prf if building with or without debug symbols.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

Let's override directly QMAKE_CFLAGS_RELEASE/DEBUG and QMAKE_CXXFLAGS_RELEASE/DEBUG in qmake.conf.in and drop all QMAKE_CFLAGS_OPTIMIZE* variables overriding.

What is the difference in the resulting compile flags?

Before QMAKE_CFLAGS_OPTIMIZE(-O2) was appended at the end.

I see the following in the logfiles:

Quoted 7 lines
	/home/test/autobuild/run/instance-0/output-1/host/bin/microblazeel-linux-g++ -c -pipe \
		-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -O0 \
		--sysroot=/home/test/autobuild/run/instance-0/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot \
		-O2 -std=c++1z ...

- '-Os' is from BR2_OPTIMIZE_S=y?
- '-O0' is from?

This one is from 'BR2_TOOLCHAIN_HAS_GCC_BUG_90620=y' and package/qt5/qt5base/qt5base.mk:

40 ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
41 QT5BASE_CFLAGS += -O0
42 QT5BASE_CXXFLAGS += -O0
43 endif

Quoted 35 lines

- '-O2' is fixed/removed with your patch?

Do your have an compiler command line example with your patch applied (did not yet find enough time to test the patch locally)?

Quoted 30 lines
Quoted 24 lines
Quoted 24 lines
Quoted 5 lines

Fixes:
http://autobuild.buildroot.net/results/ada/adaa9b4bcc6f9d2b5e82c479859a07e8abf5cf13/
http://autobuild.buildroot.net/results/a83/a83bdd1f3bf309c07abebe871b017c331ed36e67/

qgeoaddress.cpp: In function 'QString formattedAddress(const QGeoAddress&, const QString&)':
qgeoaddress.cpp:285:1: error: VOIDmode on an output

    }
  ^
   (insn 849 12033 850 87 (parallel [
               (const_int 0 [0])
               (reg:SI 970)
               (mem/v:SI (reg/f:SI 3694 [ D.102094.d ]) [-1  S4 A32])
               (reg:SI 970)
               (reg:SI 3527)
               (const_int 0 [0])
               (const_int 32773 [0x8005])
               (const_int 0 [0])
               (clobber (scratch:SI))
           ]) "/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/microblazeel-buildroot-linux-uclibc/include/c++/7.4.0/bits/atomic_base.h":304 85 {atomic_compare_and_swapsi}
        (nil))

qgeoaddress.cpp:285:1: internal compiler error: in do_output_reload, at reload1.c:7978

Quoted 1 line
Quoted 1 line

And why does it fix in internal compile error?

Oops right,
it fixes the ICE by *not* overriding -O0 with QMAKE_CFLAGS_OPTIMIZE(-O2) appended.

Quoted 6 lines
Quoted 1 line

Do I reword the patch?

Suggestion (or something similar):

Avoids the internal compiler error by avoiding the '-O2' optimization and applying the '-Os' buildroot default.

With the above 'BR2_TOOLCHAIN_HAS_GCC_BUG_90620=y' point it is a real fix of the internal compile error (by respecting the intentional '-Os -O0' -> '-O0')...

Regards,
Peter

Quoted 11 lines

Regards,
Peter

Quoted 2 lines

Best regards

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

#6 lore raw

PATCH 1/1 package/qt5base: fix building with correct optimization

Hello Peter,

Quoted 49 lines · Peter Seiderer

Hello Giulio,

Quoted 45 lines · Peter Seiderer

Hello Giulio,

Quoted 25 lines · Giulio Benetti

Hi Peter,

Quoted 22 lines · Peter Seiderer

Re-added buildroot at builroot.org and Julien Corjon to CC (hit the wrong button for reply)...

Regards,
Peter

Quoted 15 lines · Peter Seiderer

Hello Giulio,

Quoted 11 lines · Giulio Benetti

On previous patch:
https://git.buildroot.net/buildroot/commit/?id=7c0aa83527e0b0179f9e3f73a3e63df1fdc5a6e6
we didn't take care that QMAKE_CXXFLAGS_RELEASE variable is set to QMAKE_CFLAGS_OPTIMIZE(-O2) inside the same file:
mkspecs/common/gcc-base.conf
So overriding all QMAKE_CFLAGS_OPTIMIZE* variables after gcc.base.conf file doesn't change the content of QMAKE_CXXFLAGS_RELEASE. QMAKE_CXXFLAGS_RELEASE/DEBUG is appended to the end of QMAKE_CXXFLAGS in mkspecs/features/default_post.prf if building with or without debug symbols.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

Let's override directly QMAKE_CFLAGS_RELEASE/DEBUG and QMAKE_CXXFLAGS_RELEASE/DEBUG in qmake.conf.in and drop all QMAKE_CFLAGS_OPTIMIZE* variables overriding.

What is the difference in the resulting compile flags?

Before QMAKE_CFLAGS_OPTIMIZE(-O2) was appended at the end.

I see the following in the logfiles:

	/home/test/autobuild/run/instance-0/output-1/host/bin/microblazeel-linux-g++ -c -pipe \
		-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -O0 \
		--sysroot=/home/test/autobuild/run/instance-0/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot \
		-O2 -std=c++1z ...

- '-Os' is from BR2_OPTIMIZE_S=y?

This comes from Buildroot CXXFLAGS.

Quoted 8 lines
Quoted 1 line

- '-O0' is from?

This one is from 'BR2_TOOLCHAIN_HAS_GCC_BUG_90620=y' and package/qt5/qt5base/qt5base.mk:

  40 ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
  41 QT5BASE_CFLAGS += -O0
  42 QT5BASE_CXXFLAGS += -O0
  43 endif

Exactly from this ^^^

Quoted 1 line
Quoted 1 line

- '-O2' is fixed/removed with your patch?

This comes from QMAKE_CXXFLAGS_RELEASE that is set to QMAKE_CFLAGS_OPTIMIZE(-O2) in mkspecs/features/default_post.prf

Quoted 35 lines
Quoted 35 lines

Do your have an compiler command line example with your patch applied (did not yet find enough time to test the patch locally)?

Quoted 31 lines
Quoted 24 lines
Quoted 24 lines
Quoted 5 lines

Fixes:
http://autobuild.buildroot.net/results/ada/adaa9b4bcc6f9d2b5e82c479859a07e8abf5cf13/
http://autobuild.buildroot.net/results/a83/a83bdd1f3bf309c07abebe871b017c331ed36e67/

qgeoaddress.cpp: In function 'QString formattedAddress(const QGeoAddress&, const QString&)':
qgeoaddress.cpp:285:1: error: VOIDmode on an output
}
^

    (insn 849 12033 850 87 (parallel [
                (const_int 0 [0])
                (reg:SI 970)
                (mem/v:SI (reg/f:SI 3694 [ D.102094.d ]) [-1  S4 A32])
                (reg:SI 970)
                (reg:SI 3527)
                (const_int 0 [0])
                (const_int 32773 [0x8005])
                (const_int 0 [0])
                (clobber (scratch:SI))
            ]) "/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/microblazeel-buildroot-linux-uclibc/include/c++/7.4.0/bits/atomic_base.h":304 85 {atomic_compare_and_swapsi}
         (nil))
    qgeoaddress.cpp:285:1: internal compiler error: in do_output_reload, at reload1.c:7978
Quoted 1 line
Quoted 1 line

And why does it fix in internal compile error?

Oops right,
it fixes the ICE by *not* overriding -O0 with QMAKE_CFLAGS_OPTIMIZE(-O2) appended.

Do I reword the patch?

Quoted 7 lines
Quoted 4 lines

Suggestion (or something similar):

Avoids the internal compiler error by avoiding the '-O2' optimization and applying the '-Os' buildroot default.

With the above 'BR2_TOOLCHAIN_HAS_GCC_BUG_90620=y' point it is a real fix of the internal compile error (by respecting the intentional '-Os -O0' -> '-O0')...

Yes, thank you, it is very long and not simple to write this commit log. I try again with your suggestion as a v2 patch.

Thanks for reviewing!
Kind regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas