Opened 8 weeks ago

Last modified 8 weeks ago

#62051 assigned defect

qt5*-qtbase: error: redefinition of '__bsrd' as different kind of symbol

Reported by: chrstphrchvz (Christopher Chavez) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc:
Port: phantomjs-qt-qtbase qt57-qtbase qt56-qtbase qt55-qtbase


The fix for #59364 does not also work for Xcode 11.4 and newer (example error log):

In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_aqua_qt57/qt57-qtbase/work/qtbase-opensource-src-5.7.1/src/corelib/codecs/qutfcodec.cpp:46:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_aqua_qt57/qt57-qtbase/work/qtbase-opensource-src-5.7.1/include/QtCore/5.7.1/QtCore/private/qsimd_p.h:1:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_aqua_qt57/qt57-qtbase/work/qtbase-opensource-src-5.7.1/include/QtCore/5.7.1/QtCore/private/../../../../../src/corelib/tools/qsimd_p.h:469:33: error: redefinition of '__bsrd' as different kind of symbol
static Q_ALWAYS_INLINE unsigned _bit_scan_reverse(unsigned val)
/Applications/ note: expanded from macro '_bit_scan_reverse'
#define _bit_scan_reverse(A) __bsrd((A))
/Applications/ note: previous definition is here
__bsrd(int __A) {

The fix tried to use Q_CC_CLANG to detect clang 9.0 and newer, but qcompilerdetection.h lacks mapping of more recent Xcode versions to upstream clang, so Q_CC_CLANG is defined too low of a value. It should be possible to update qcompilerdetection.h with the needed mapping (i.e. that Xcode 11.4 and newer are based on LLVM clang 9.0 and newer). Alternatives might be to test for intrinsics directly with #if defined(); or backport qtbase commit e70324f8dd, as done by fink for Qt 5.7.

(I personally do not need older Qt5 versions, but allowing them to build on more recent OSes may help with fixing build problems affecting all OSes, e.g. #60889.)

Change History (4)

comment:1 Changed 8 weeks ago by chrstphrchvz (Christopher Chavez)

Port: phantomjs-qt-qtbase added

comment:2 Changed 8 weeks ago by chrstphrchvz (Christopher Chavez)

Port: qt53-qtbase removed

qt53-qtbase is not affected as it does not build on macOS 10.15 or later, but for consistency I would still apply the fix for this issue to it.

comment:3 Changed 8 weeks ago by chrstphrchvz (Christopher Chavez)

PR opened using macro check approach:

comment:4 Changed 8 weeks ago by kencu (Ken)

as building the older versions of qt5 is mainly relevant to the systems that need them, we'll have to confirm this patch works on the oldest and newest systems affected, and then we can infer the rest.

Please let us know if you need any help with that.

Note: See TracTickets for help on using tickets.