Skip to content

Commit 7d0e1e0

Browse files
committed
Use GCC -mno-direct-extern-access when building an x86/x86_64 coda_qt executable
...so that it wouldn't provide and export _ZN16QCoreApplication4selfE@Qt_6 when it would mention any use of e.g. the qApp macro, which could cause coda_qt to terminate with a SIGSEGV at start (cf. 9c8e658 "avoid Crash on startup of CODA-Q"). See the mailing list thread starting at <https://lists.qt-project.org/pipermail/development/2025-December/046791.html> "[Development] QT_FEATURE_reduce_relocations breaking executables that mention qApp?" for details. (Not entirely clear to me whether we would need -mno-direct-extern-access also on any shared libraries (that link against Qt), if we would build any, but lets restrict this to the CXXFLAGS of the coda_qt executable for now.) Signed-off-by: Stephan Bergmann <[email protected]> Change-Id: Iee5bcf0e1507692a8a4d3f2753f75c362fe9777e
1 parent e5a2273 commit 7d0e1e0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ AC_DEFINE_UNQUOTED([COOLWSD_BUILDCONFIG],[["$ac_configure_args"]],[Options passe
6666
# don't include config_unused.h anywhere!
6767
AC_CONFIG_HEADERS([config_unused.h])
6868

69+
AM_CONDITIONAL([X86], [test "$host_cpu" = x86 || test "$host_cpu" = x86_64])
70+
6971
# Checks for programs.
7072
AC_PROG_CXX
7173
AC_PROG_CC

qt/Makefile.am

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ DBusService.moc.cpp: DBusService.hpp
7474

7575
CLEANFILES = $(BUILT_SOURCES)
7676

77+
coda_qt_CXXFLAGS = $(AM_CXXFLAGS)
78+
if X86
79+
coda_qt_CXXFLAGS += -mno-direct-extern-access
80+
endif
81+
7782
coda_qt_SOURCES = coda-qt.cpp WebView.cpp DBusService.cpp RecentDocuments.cpp $(BUILT_SOURCES) $(cmake_list)
7883

7984
metainfodir = $(datadir)/metainfo

0 commit comments

Comments
 (0)