Skip to contentSkip to conversation

package/qt5base: fix sparc compilation

PATCH Superseded Yann E. MORIN 2 participants 4 messages May 16, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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 on sparc, where it add -latomic to the list of libraries to link with.

Regards,
Yann E. MORIN.

The following changes since commit 4e00f9daa04e9a84f5191f479d7236dea72fbf35

gcc: drop unused legacy arc-2016.09 patch (2017-05-16 21:24:02 +0200)

are available in the git repository at:

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

for you to fetch changes up to 628b089124e34bcc2f6cd9be57c65d567872ef1f

package/qt5base: link with -latomic for sparc (2017-05-16 23:11:23 +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 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]>
---
 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..65320cbe04 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_ARCH_CONFIG)
 	(cd $(@D); \
 		$(TARGET_MAKE_ENV) \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
Signature · 1 line
2.11.0
#2 lore raw

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

In reply to Yann E. MORIN

Qt 5.8 needs atomic operations, which on sparc are provided with -latomic.

Fixes:

    http://autobuild.buildroot.org/results/49b/49bc9345b9849c9c3c53ace290c534ff7bb98683/
    http://autobuild.buildroot.org/results/9f2/9f213406954be51dfcad76ebdce8b73850842180/
Cc Julien Corjon <[email protected]>
Cc Peter Seiderer <[email protected]>
---
 package/qt5/qt5base/qt5base.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/qt5/qt5base/qt5base.mk +7 -0
index 65320cbe04..7c9ed0b4e3 100644
@@ -215,6 +215,13 @@ endef
 endif
 
 QT5BASE_ARCH_CONFIG_FILE = $(@D)/mkspecs/devices/linux-buildroot-g++/arch.conf
+ifeq ($(BR2_sparc)$(BR2_PACKAGE_QT5_VERSION_LATEST),yy)
+# Qt 5.8 needs atomics, which on sparc are in -latomic
+define QT5BASE_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
#3 lore raw

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

Hello,

Quoted 2 lines · Yann E. MORIN

QT5BASE_ARCH_CONFIG_FILE = $(@D)/mkspecs/devices/linux-buildroot-g++/arch.conf
+ifeq ($(BR2_sparc)$(BR2_PACKAGE_QT5_VERSION_LATEST),yy)

You shouldn't use BR2_sparc here, but BR2_TOOLCHAIN_HAS_LIBATOMIC

Thomas

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