Created attachment 208134 [details]
Patch to fix build on i386 and some minor improvements
For some time now, the Poudriere package builder complains about graphics/qgis on i386 (all FreeBSD versions) not able to build.
This happens with all clang versions but 6.x, because newer clang versions (especially 9.x) do have problems with QT5 QMap and the long list in src/core/qgscoordinatereferencesystem_legacy.h.
To circumstance this, the patch introduces a test for ARCH=i386 and then using clang60 instead of clang90.
While here, the patch also removes the shebang for python scripts and the knob for GRASS_FORCE_MAKE_JOBS=no. Both are not necessary any more since the change from python2 to python3 and some improvements in databases/grass7. Many thanks to Loïc Bartoletti for the hints!
The patch is tested on Poudriere (11.3i/a, 12.0i/a, and HEADi/a),
'portlint -AC' seems happy.
I'm not sure whether introducing a dependency on an ancient llvm is a great solution (who knows how long that port will exist for).
I've filed bug 241687 to track why clang is crashing when building this port.
(In reply to Tobias C. Berner from comment #1)
We are now down to 11 ports dependent on llvm60 and it has taken some work to get down that far. I would really hope we can keep getting closer to zero so that we can drop llvm60. The amount of time needed to compile all the required compilers for the whole tree on !amd64 is painful.
For more on this effort, please see:
(In reply to Mark Linimon from comment #3)
I am absolutely with you. The usage of llvm60 for QGIS on i386 is only a workaround, until we (or llvm or qgis community) found a solution for the big waste of memory, when using QT5 QMap with clang.
I wonder if the workaround described in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241687#c5 would be enough for getting the port to build with devel/llvm90 for now.
(In reply to Raphael Kubo da Costa from comment #5)
I just tried with CFLAGS+=-O1 and CXXFLAGS+=O1 in the ports Makefile. It works with clang9 on i386, but build time is about six times longer now than with -O2 (clang9 on the same box, but amd64).
Is there any possibility to limit -O1 to only src/core/qgscoordinatereferencesystem_legacy.* and to build everything else with -O2 ?
I just filed a patch to update graphics/qgis from 3.8.2 to 3.10.1 . After that patch is committed, this bug #241096 should be obsolet.
Closing, this got fixed in bug 242557.