Opened 2 years ago

Closed 2 years ago

#61316 closed defect (fixed)

poppler doesn't use MacPorts flags on 10.10 and earlier

Reported by: ryandesign (Ryan Schmidt) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc: michaelld (Michael Dickens)
Port: poppler

Description

poppler does not use the MacPorts-specified flags on 10.10 and earlier. On some systems, like 10.5, this causes a build failure. This was discussed on the mailing list but I'll file a ticket so you can track the fix properly.

For example, here's the log of the build on 10.10 (with MacPorts clang) showing that MacPorts flags like -Os are being set by MacPorts but are not being used by the build.

https://build.macports.org/builders/ports-10.10_x86_64-builder/builds/122524/steps/install-port/logs/stdio

But here's the build on 10.11 (with Xcode clang) showing the flags being used:

https://build.macports.org/builders/ports-10.11_x86_64-builder/builds/120909/steps/install-port/logs/stdio

In cmake/modules/PopplerMacros.cmake there is a block that takes effect only if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") (which would only be when the compiler is MacPorts clang, not Xcode clang). If I change STREQUAL to MATCHES then the problem affects Xcode clang as well. A patch should be added to make this change so that everyone gets the same flags. This change should be sent upstream for inclusion in their code.

The last change to this code block claims to preserve user-supplied flags, but only implements this for standard cmake build types like "Debug", "Release", "RelWithDebInfo", etc. The cmake 1.1 portgroup defaults to the nonstandard build type "MacPorts" (I do not know why it does this) hence flags are not preserved. The fix would be to have the portfile set cmake.build_type Release. Since this will change the flags the port builds with on some systems (for example adding an optimization flag where previously there was none) the port's revision should be increased when making this change, or combine it with a version update.

P.S: The line configure.cxxflags-append -std=c++14 could be removed from the portfile since the build system now adds this automatically. The line compiler.c_standard 1999 could be added. The lines PortGroup compiler_blacklist_versions 1.0 and compiler.blacklist-append {clang < 800.0.38} could be replaced by the line compiler.thread_local_storage yes.

Change History (3)

comment:1 Changed 2 years ago by michaelld (Michael Dickens)

Cc: michaelld added

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

Resolution: fixed
Status: assignedclosed

In a7bb7220d55fb1c5385b88cce11deb6b1a249ea1/macports-ports (master):

poppler: various fixes for better macOS / MacPorts building

Closes: #58574
Closes: #61316

Note: See TracTickets for help on using tickets.