Skip to contentSkip to conversation

package/qt5base: fix uclibc/musl compile with libexecinfo enabled

PATCH Applied Peter Seiderer 2 participants 2 messages Jan 31, 2022 – Feb 12, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/qt5base: fix uclibc/musl compile with libexecinfo enabled

- depend and link against libexecinfo if enabled to fix linking failure in case execinfo.h is detected for qlogging:

qt5base-5.15.2/src/corelib/global/qlogging.cpp:110 - __has_include(<execinfo.h>)

- libexecinfo already depends on !BR2_TOOLCHAIN_USES_GLIBC

- rename plain QT5BASE_CONFIGURE_ARCH_CONFIG to QT5BASE_CONFIGURE_ARCH_CONFIG_LIBATOMIC

Fixes:

- http://autobuild.buildroot.net/results/e7c685744b1f1bebb7fec9835bda534a72b7b7c2

.../riscv64-buildroot-linux-musl/bin/ld: .../build/qt5base-5.15.2/src/corelib/global/qlogging.cpp:1398: undefined reference to `backtrace_symbols'

---
 package/qt5/qt5base/qt5base.mk | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
package/qt5/qt5base/qt5base.mk +11 -2
index 4ef3759566..59c423c49c 100644
@@ -234,6 +234,14 @@ QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_QT5BASE_ICU),icu)
 
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_EXAMPLES),-make,-nomake) examples
 
+# see qt5base-5.15.2/src/corelib/global/qlogging.cpp:110 - __has_include(<execinfo.h>)
+ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
+QT5BASE_DEPENDENCIES += libexecinfo
+define QT5BASE_CONFIGURE_ARCH_CONFIG_LIBEXECINFO
+	printf '!host_build { \n LIBS += -lexecinfo\n }' >$(QT5BASE_ARCH_CONFIG_FILE)
+endef
+endif
+
 ifeq ($(BR2_PACKAGE_LIBINPUT),y)
 QT5BASE_CONFIGURE_OPTS += -libinput
 QT5BASE_DEPENDENCIES += libinput
@@ -282,7 +290,7 @@ endif
 QT5BASE_ARCH_CONFIG_FILE = $(@D)/mkspecs/devices/linux-buildroot-g++/arch.conf
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 # Qt 5.8 needs atomics, which on various architectures are in -latomic
-define QT5BASE_CONFIGURE_ARCH_CONFIG
+define QT5BASE_CONFIGURE_ARCH_CONFIG_LIBATOMIC
 	printf '!host_build { \n LIBS += -latomic\n }' >$(QT5BASE_ARCH_CONFIG_FILE)
 endef
 endif
@@ -305,7 +313,8 @@ define QT5BASE_CONFIGURE_CMDS
 		$(@D)/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
 	$(QT5BASE_CONFIGURE_CONFIG_FILE)
 	touch $(QT5BASE_ARCH_CONFIG_FILE)
-	$(QT5BASE_CONFIGURE_ARCH_CONFIG)
+	$(QT5BASE_CONFIGURE_ARCH_CONFIG_LIBATOMIC)
+	$(QT5BASE_CONFIGURE_ARCH_CONFIG_LIBEXECINFO)
 	$(QT5BASE_CONFIGURE_HOSTCC)
 	(cd $(@D); \
 		$(TARGET_MAKE_ENV) \
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 9 lines · Peter Seiderer

- depend and link against libexecinfo if enabled to fix linking failure in case execinfo.h is detected for qlogging:

   qt5base-5.15.2/src/corelib/global/qlogging.cpp:110 - __has_include(<execinfo.h>)

- libexecinfo already depends on !BR2_TOOLCHAIN_USES_GLIBC

- rename plain QT5BASE_CONFIGURE_ARCH_CONFIG to QT5BASE_CONFIGURE_ARCH_CONFIG_LIBATOMIC

Quoted 7 lines

Fixes:

- http://autobuild.buildroot.net/results/e7c685744b1f1bebb7fec9835bda534a72b7b7c2

   .../riscv64-buildroot-linux-musl/bin/ld: .../build/qt5base-5.15.2/src/corelib/global/qlogging.cpp:1398: undefined reference to `backtrace_symbols'

Applied to master, thanks.

Regards,
Arnout

Quoted 33 lines
---
  package/qt5/qt5base/qt5base.mk | 13 +++++++++++--
  1 file changed, 11 insertions(+), 2 deletions(-)
package/qt5/qt5base/qt5base.mk +9 -1
index 4ef3759566..59c423c49c 100644
@@ -234,6 +234,14 @@ QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_QT5BASE_ICU),icu)
 
  QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_EXAMPLES),-make,-nomake) examples
 
+# see qt5base-5.15.2/src/corelib/global/qlogging.cpp:110 - __has_include(<execinfo.h>)
+ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
+QT5BASE_DEPENDENCIES += libexecinfo
+define QT5BASE_CONFIGURE_ARCH_CONFIG_LIBEXECINFO
+	printf '!host_build { \n LIBS += -lexecinfo\n }' >$(QT5BASE_ARCH_CONFIG_FILE)
+endef
+endif
+
  ifeq ($(BR2_PACKAGE_LIBINPUT),y)
  QT5BASE_CONFIGURE_OPTS += -libinput
  QT5BASE_DEPENDENCIES += libinput
@@ -282,7 +290,7 @@ endif
  QT5BASE_ARCH_CONFIG_FILE = $(@D)/mkspecs/devices/linux-buildroot-g++/arch.conf
  ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  # Qt 5.8 needs atomics, which on various architectures are in -latomic
-define QT5BASE_CONFIGURE_ARCH_CONFIG
+define QT5BASE_CONFIGURE_ARCH_CONFIG_LIBATOMIC
  	printf '!host_build { \n LIBS += -latomic\n }' >$(QT5BASE_ARCH_CONFIG_FILE)
  endef
  endif

package/qt5/qt5base/qt5base.mk define QT5BASE_CONFIGURE_CMDS · line 320

Quoted 9 lines
package/qt5/qt5base/qt5base.mk +2 -1
@@ -305,7 +313,8 @@ define QT5BASE_CONFIGURE_CMDS
  		$(@D)/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
  	$(QT5BASE_CONFIGURE_CONFIG_FILE)
  	touch $(QT5BASE_ARCH_CONFIG_FILE)
-	$(QT5BASE_CONFIGURE_ARCH_CONFIG)
+	$(QT5BASE_CONFIGURE_ARCH_CONFIG_LIBATOMIC)
+	$(QT5BASE_CONFIGURE_ARCH_CONFIG_LIBEXECINFO)
  	$(QT5BASE_CONFIGURE_HOSTCC)
  	(cd $(@D); \
  		$(TARGET_MAKE_ENV) \

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot