[MacPorts] #46606: qt4-mac "noexceptions" variant

MacPorts noreply at macports.org
Sun Jan 18 05:36:13 PST 2015


#46606: qt4-mac "noexceptions" variant
-------------------------+--------------------------------
 Reporter:  rjvbertin@…  |      Owner:  macports-tickets@…
     Type:  enhancement  |     Status:  new
 Priority:  Normal       |  Milestone:
Component:  ports        |    Version:
 Keywords:  haspatch     |       Port:  qt4-mac
-------------------------+--------------------------------
 This one has already been presented (because included) in my qt4-mac
 concurrent ticket, but a bit of independent exposure might be good.

 When you build Qt4 on OS X (or Linux) using gcc or clang, `configure`
 prints a notice when done about how these compilers will by default
 include the infrastructure required for C++ exceptions, how that adds
 considerable overhead, and that it is possible to build Qt without that
 support, resulting in an ABI-compatible install because exceptions aren't
 used internally.

 That latter part is not 100% true: the resulting installation is only ABI
 compatible for software that doesn't require QtXMLPatterns and the full
 QtConcurrent.

 The variant presented here does result in an installation that should be
 100% ABI compatible by undoing the effect of configure's `-no-exceptions`
 for QtCore (and thus QtConcurrent) and QtXMLPatterns. It would have been
 better if QtConcurrent (and XMLPatterns) could be built *with* exceptions
 and the rest without, but that requires much more invasive hacking of the
 build system.

 I've been using the current patch on OS X and Kubuntu (via
 ppa:rjvbertin/qt4) for weeks no, without ill effects.

 The changes to the portfile (given inline):

 {{{
     variant noexceptions description {build without using exceptions
 internally} {
         # (26) don't build with exceptions, which gives a completely ABI-
 compatible build
         patchfiles-append       disable-exceptions.patch
         configure.args-append   -no-exceptions
     }
 }}}

 and an additional patch in the post-destroot that removes an inappropriate
 section from QtCore/qconfig.h :

 {{{
 post-destroot {
     ...

         if {[variant_isset noexceptions ]} {
             # building with -no-exceptions will add a section to
 QtCore/qconfig.h that has to be removed
             # given that we did NOT build QtCore WITHOUT exceptions...
             exec patch -d ${destroot}${qt_frameworks_dir} -Np0 -i
 ${filespath}/qconfig-remove-EXCEPTIONS.diff
         }
     ...
 }
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/46606>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list