Opened 6 years ago

Closed 6 years ago

#55932 closed defect (fixed)

qt4-mac: does not build with clang 5

Reported by: devernay (Frédéric Devernay) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: kencu (Ken)
Port: qt4-mac

Description

Thanks Michael for updating the qt4-mac port.

There is stil an error when building with clang-5:

text/qfontengine_coretext.mm:889:20: error: qualified reference to 'QFixed' is a constructor name rather than a type in this
      context
    return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
                   ^

patch: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/qt-4.x/4.8/clang-5-darwin.patch

BTW, there may be other interesting patches in that repo, such as: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch

Attachments (1)

qt4-mac.tar.bz2 (67.5 KB) - added by michaelld (Michael Dickens) 6 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 6 years ago by devernay (Frédéric Devernay)

note that the same patch is already there for qt5: browser:macports-ports/aqua/qt5/files/patch-qualified_reference.diff

Last edited 6 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:2 Changed 6 years ago by mf2k (Frank Schima)

Cc: michaelld removed
Keywords: haspatch removed
Owner: set to michaelld
Status: newassigned

comment:3 Changed 6 years ago by michaelld (Michael Dickens)

You're welcome! Thanks for pushing this info on patches to me. I'll take a look & see what I can get in place. I thought I used MacPorts Clang 5 to build the updated qt4-mac & it was clean; maybe I'm mistaken. I build so many ports with so many compilers, to test / verify clean builds ... it's hard to keep track of which is used for which!

comment:4 Changed 6 years ago by michaelld (Michael Dickens)

Cc: kencu added

@kencu: do you encounter this issue building with Clang 5? I'm pretty sure I didn't; no idea why or why not.

I'm parsing through the NixOS Qt4 patches to see what's what.

comment:5 Changed 6 years ago by kencu (Ken)

I may not have tried clang-5 on this. My 10.6.8 box usually uses clang-3.9 as it seems the right combo of capable yet forgiving of older code...

comment:6 Changed 6 years ago by michaelld (Michael Dickens)

OK after checking my qt4-mac build was using the Xcode provided Clang, whatever version that was. I'll try using clang 5 & see how it goes.

comment:7 Changed 6 years ago by michaelld (Michael Dickens)

Summary: qt4-mac: does no build with clang 5qt4-mac: does not build with clang 5

comment:8 Changed 6 years ago by michaelld (Michael Dickens)

OK I see this error too building with MacPorts Clang 5 port (latest revision / up to date). I'll get at least that patch in place, after I've tested it on newer macOS to verify that it works there too.

Last edited 6 years ago by michaelld (Michael Dickens) (previous) (diff)

comment:9 Changed 6 years ago by michaelld (Michael Dickens)

So the patches that seem the most relevant from the NiXos list to me are: clang-5-darwin.patch, qsettings-recursive-global-mutex.patch, parallel-configure.patch, libressl.patch, and qt-4.8.7-unixmake-darwin.patch. I'll look at getting those integrated.

The dlopen-* patches aren't clear to me that they are applicable or useful. Maybe the OP knows what they are for (beyond somehow setting the absolute path to various files; what is the rationale for doing this)?

patch-qthread-stacksize.diff is already integrated; qt-musl-iconv-no-bom.patch and qt-musl.patch are Linux only; the other files are for NiXos.

Changed 6 years ago by michaelld (Michael Dickens)

Attachment: qt4-mac.tar.bz2 added

comment:10 Changed 6 years ago by michaelld (Michael Dickens)

I'm testing the updated qt4-mac directory I just attached here on 10.8, 10.12, and 10.13 right now. Patches are clean (enough), and builds are looking good. I added in the patch to set the number of jobs for building qmake (which is during configuration), so that will help speed things up a little for that stage. Please test / verify on your Mac OS X systems.

comment:11 Changed 6 years ago by michaelld (Michael Dickens)

So all builds are clean using default compilers. I'm now testing using MacPorts' Clang 5.0 (on 10.8 and 10.12).

comment:12 Changed 6 years ago by michaelld (Michael Dickens)

On 10.12 using Clang 5, the build errors out strangely (see below). I don't feel like messing with the TBD cruft & since the default works nicely there's really no need to.

shared/qaudioinput_mac_p.o .obj/release-shared/qaudio_mac.o .obj/release-shared/qabstractvideobuffer.o .obj/release-shared/qabstractvideosurface.o .obj/release-shared/qimagevideobuffer.o .obj/release-shared/qmemoryvideobuffer.o .obj/release-shared/qvideoframe.o .obj/release-shared/qvideosurfaceformat.o .obj/release-shared/moc_qaudioinput.o .obj/release-shared/moc_qaudiooutput.o .obj/release-shared/moc_qaudioengineplugin.o .obj/release-shared/moc_qaudioengine.o .obj/release-shared/moc_qaudioinput_mac_p.o .obj/release-shared/moc_qaudiooutput_mac_p.o .obj/release-shared/moc_qabstractvideosurface.o  -F/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/Library/Frameworks -F/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/lib  -framework ApplicationServices -framework CoreAudio -framework AudioUnit -framework AudioToolbox -F/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/Library/Frameworks -F/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/lib -L/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/lib -framework QtGui -F/opt/local/Library/Frameworks -framework QtCore  
:info:build ld: warning: directory not found for option '-F/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/Library/Frameworks'
:info:build ld: warning: directory not found for option '-F/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_aqua_qt4-mac/qt4-mac/work/qt-everywhere-opensource-src-4.8.7/Library/Frameworks'
:info:build ld: unexpected token: !tapi-tbd-v2 file '/System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd' for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[1]: *** [../../lib/QtMultimedia.framework/QtMultimedia] Error 1

comment:13 Changed 6 years ago by michaelld (Michael Dickens)

On 10.12 using Clang 6, there are all sorts of fun errors. I might investigate a little further if/as I have time since some look like authentic type-casting issues.

The build worked for ma on 10.8 using Clang 5.

I'll give folks through the weekend to test, then commit on Monday.

comment:14 Changed 6 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

In e60744bf4b2421b8065e51631bab67f852a01e47/macports-ports:

qt4-mac: Fix building using MacPorts Clang 5.0 compiler

Also add other patches from NiXos archive.

Closes: #55932

Note: See TracTickets for help on using tickets.