Skip to contentSkip to conversation

package/qt5base: fix sparc compilation

PATCH New Yann E. MORIN 5 participants 8 messages May 17, 2017 – Jun 9, 2017

lore
Share & tools
lore
#0 lore raw

v2 cover package/qt5base: fix sparc compilation

Hello All!

This small series aims at fixing the build of qt-5.8 on sparc.

Qt 5.8 needs atomic operations, which on some architectures are compiler builtins, while on other archs they are provided by a helper library, libatomic. For sparc, atomics are in libatomic.

First, we introduce a new qmake config snippet, arch.conf, which is included from our qmake.conf.

By default, that file is empty, except when libatomic is present in the toolchain, in which case it add -latomic to the list of libraries to link with.

Regards,
Yann E. MORIN.

The following changes since commit 19e78e509e5e729437d2188b28aee7655340c67d

oracle-mysql: add patch to fix gcc 6.x build issue (2017-05-17 22:24:14 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 6bdfcdff79478a9835c4c5d0296f8f62d5b64d66

package/qt5base: link with -latomic for sparc (2017-05-17 23:08:55 +0200)

----------------------------------------------------------------
Yann E. MORIN (2):
package/qt5base: install arch-specific configuration package/qt5base: link with -latomic for sparc

 package/qt5/qt5base/qmake.conf |  3 +++
 package/qt5/qt5base/qt5base.mk | 10 ++++++++++
 2 files changed, 13 insertions(+)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v2 1/2 package/qt5base: install arch-specific configuration

For some architectures, it is necessary to link with additional libraries, such as -latomic for sparc.

Add a bit of support to make that easy; actual use will be introduced in the following patch.

Cc Julien Corjon <[email protected]>
Cc Peter Seiderer <[email protected]>

---
Changes v1 -> v2:
- rename macro

---
 package/qt5/qt5base/qmake.conf | 3 +++
 package/qt5/qt5base/qt5base.mk | 3 +++
 2 files changed, 6 insertions(+)
package/qt5/qt5base/qmake.conf +3 -0
index 49cf898316..8b6debe583 100644
@@ -21,5 +21,8 @@ CONFIG                 += nostrip
 QMAKE_LIBS             += -lrt -lpthread -ldl
 QMAKE_CFLAGS_ISYSTEM   =
 
+# Architecturespecific configuration
+include(arch.conf)
+
 include(../common/linux_device_post.conf)
 load(qt_config)
package/qt5/qt5base/qt5base.mk +3 -0
index 0c088350e5..81774b74a6 100644
@@ -214,12 +214,15 @@ define QT5BASE_CONFIGURE_CONFIG_FILE
 endef
 endif
 
+QT5BASE_ARCH_CONFIG_FILE = $(@D)/mkspecs/devices/linux-buildroot-g++/arch.conf
 define QT5BASE_CONFIGURE_CMDS
 	$(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qmake.conf \
 		$(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf
 	$(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qplatformdefs.h \
 		$(@D)/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
 	$(QT5BASE_CONFIGURE_CONFIG_FILE)
+	touch $(QT5BASE_ARCH_CONFIG_FILE)
+	$(QT5BASE_CONFIGURE_ARCH_CONFIG)
 	(cd $(@D); \
 		$(TARGET_MAKE_ENV) \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
Signature · 1 line
2.11.0
#2 lore raw

PATCH v2 1/2 package/qt5base: install arch-specific configuration

Am Wed, 17 May 2017 23:15:28 +0200 schrieb Yann E. MORIN:

Quoted 10 lines

For some architectures, it is necessary to link with additional libraries, such as -latomic for sparc.

Add a bit of support to make that easy; actual use will be introduced in the following patch.

Signed-off-by: "Yann E. MORIN"
<[email protected]> Cc: Julien Corjon
<[email protected]>
Cc: Peter Seiderer <[email protected]>

(compile-tested using http://autobuild.buildroot.net/
results/967/967e7b7b6960ff49afc5c845832abd49d93ed676/ )

This patch series also fixes http://autobuild.buildroot.net/
results/967/967e7b7b6960ff49afc5c845832abd49d93ed676/

#3 lore raw

PATCH v2 2/2 package/qt5base: link with -latomic for sparc

In reply to Yann E. MORIN

Qt 5.8 needs atomic operations, which are provided in libatomic when it exists, ike on sparc with gcc >= 4.8.

Fixes:

    http://autobuild.buildroot.org/results/49b/49bc9345b9849c9c3c53ace290c534ff7bb98683/
    http://autobuild.buildroot.org/results/9f2/9f213406954be51dfcad76ebdce8b73850842180/
Cc Thomas Petazzoni <[email protected]>
Cc Julien Corjon <[email protected]>
Cc Peter Seiderer <[email protected]>

---
Changes v1 -> v2:
- condition is on HAS_LIBATOMIC, not on BR2_sparc (Thomas)

---
 package/qt5/qt5base/qt5base.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/qt5/qt5base/qt5base.mk +7 -0
index 81774b74a6..5944c869bb 100644
@@ -215,6 +215,13 @@ endef
 endif
 
 QT5BASE_ARCH_CONFIG_FILE = $(@D)/mkspecs/devices/linux-buildroot-g++/arch.conf
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC)$(BR2_PACKAGE_QT5_VERSION_LATEST),yy)
+# Qt 5.8 needs atomics, which on sparc are in -latomic
+define QT5BASE_CONFIGURE_ARCH_CONFIG
+	printf 'LIBS += -latomic\n' >$(QT5BASE_ARCH_CONFIG_FILE)
+endef
+endif
+
 define QT5BASE_CONFIGURE_CMDS
 	$(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qmake.conf \
 		$(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf
Signature · 1 line
2.11.0
#4 lore raw

PATCH v2 2/2 package/qt5base: link with -latomic for sparc

Hi Yann,

Quoted 7 lines · Yann E. MORIN

Qt 5.8 needs atomic operations, which are provided in libatomic when it exists, ike on sparc with gcc >= 4.8.

Fixes:

    http://autobuild.buildroot.org/results/49b/49bc9345b9849c9c3c53ace290c534ff7bb98683/
    http://autobuild.buildroot.org/results/9f2/9f213406954be51dfcad76ebdce8b73850842180/
Quoted 8 lines
Cc Thomas Petazzoni <[email protected]>
Cc Julien Corjon <[email protected]>
Cc Peter Seiderer <[email protected]>

---
Changes v1 -> v2:
- condition is on HAS_LIBATOMIC, not on BR2_sparc (Thomas)

The commit subject line should also to match that change.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#5 lore raw

PATCH v2 2/2 package/qt5base: link with -latomic for sparc

In reply to Yann E. MORIN

Am Wed, 17 May 2017 23:15:29 +0200 schrieb Yann E. MORIN:

Quoted 5 lines

Qt 5.8 needs atomic operations, which are provided in libatomic when it exists, ike on sparc with gcc >= 4.8.

Fixes:
http://autobuild.buildroot.org/

results/49b/49bc9345b9849c9c3c53ace290c534ff7bb98683/

Quoted 1 line

http://autobuild.buildroot.org/

results/9f2/9f213406954be51dfcad76ebdce8b73850842180/

Quoted 7 lines

Signed-off-by: "Yann E. MORIN"
<[email protected]>
Cc: Thomas Petazzoni
<[email protected]>
Cc: Julien Corjon <[email protected]>
Cc: Peter Seiderer <[email protected]>

(compile-tested using http://autobuild.buildroot.net/
results/967/967e7b7b6960ff49afc5c845832abd49d93ed676/ )

This patch series also fixes http://autobuild.buildroot.net/
results/967/967e7b7b6960ff49afc5c845832abd49d93ed676/

#6 lore raw

v2 cover package/qt5base: fix sparc compilation

In reply to Yann E. MORIN

Hello,

Quoted 3 lines · Yann E. MORIN

Yann E. MORIN (2):
package/qt5base: install arch-specific configuration package/qt5base: link with -latomic for sparc

Both applied to master. Thanks!

Peter: those are fixing a build issue, but only on Sparc, so I don't know how much we want those patches in the LTS branch.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#7 lore raw

v2 cover package/qt5base: fix sparc compilation

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,
On Wed, 17 May 2017 23:15:23 +0200, Yann E. MORIN wrote:

Quoted 8 lines
Quoted 3 lines

Yann E. MORIN (2):
package/qt5base: install arch-specific configuration package/qt5base: link with -latomic for sparc

Both applied to master. Thanks!

Peter: those are fixing a build issue, but only on Sparc, so I don't know how much we want those patches in the LTS branch.

They seem quite safe and a test build with them applied on the LTS branch succeeded, so committed to 2017.02.x and 2017.05.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard