Bug 241687 - devel/llvm90: Crash when building graphics/qgis on i386
Summary: devel/llvm90: Crash when building graphics/qgis on i386
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-03 11:27 UTC by Raphael Kubo da Costa
Modified: 2019-11-06 19:22 UTC (History)
4 users (show)

See Also:


Attachments
qgscoordinatereferencesystem-8a0c03.{cpp,sh} (795.07 KB, application/x-xz)
2019-11-03 11:27 UTC, Raphael Kubo da Costa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Kubo da Costa freebsd_committer 2019-11-03 11:27:58 UTC
Created attachment 208816 [details]
qgscoordinatereferencesystem-8a0c03.{cpp,sh}

Spun off bug 241096.

graphics/qgis is currently failing to build on i386 due to a crash in clang++90. CC'ing dim@ in case this also affects current -- I haven't tried clang++ in an i386 HEAD, only in a Poudriere jail running 12.0-RELEASE-p11.

The bug above says devel/llvm60 is fine (I've tried 12.0-RELEASE's clang 6 and it also works), but llvm70 and llvm80 are also broken.

[  1%] Building CXX object src/core/CMakeFiles/qgis_core.dir/qgscoordinatereferencesystem.cpp.o
cd /wrkdirs/usr/ports/graphics/qgis/work/.build/src/core && /usr/local/bin/clang++90  -DPROJ_VERSION_MAJOR=6 -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_POSITIONING_LIB -DQT_PRINTSUPPORT_LIB -DQT_SERIALPORT_LIB -DQT_SQL_LIB -DQT_SVG_LIB -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DSIP_VERSION=0x041313 -DTEST_DATA_DIR=\"/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/tests/testdata\" -DWITH_BINDINGS -DWITH_QTWEBKIT -D_HAVE_PTHREAD_ -Dqgis_core_EXPORTS -I/wrkdirs/usr/ports/graphics/qgis/work/.build -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core -I/wrkdirs/usr/ports/graphics/qgis/work/.build/src/core -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/3d -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/annotations -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/auth -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/dxf -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/effects -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/expression -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/fieldformatter -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/geometry -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/geocms -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/geocms/geonode -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/layertree -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/layout -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/locator -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/metadata -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/pal -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/processing -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/processing/models -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/providers -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/providers/memory -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/raster -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/renderer -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/scalebar -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/symbology -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/mesh -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/validity -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/external -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/external/kdbush/include -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/external/nmea -I/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/external/poly2tri -isystem /usr/local/include -isystem /usr/local/include/Qca-qt5/QtCrypto -isystem /usr/local/include/qt5keychain -isystem /usr/local/include/qt5 -isystem /usr/local/include/qt5/QtSerialPort -isystem /usr/local/include/qt5/QtCore -isystem /usr/local/lib/qt5/mkspecs/freebsd-clang -isystem /usr/local/include/qt5/QtXml -isystem /usr/local/include/qt5/QtGui -isystem /usr/local/include/qt5/QtWidgets -isystem /usr/local/include/qt5/QtSvg -isystem /usr/local/include/qt5/QtPrintSupport -isystem /usr/local/include/qt5/QtNetwork -isystem /usr/local/include/qt5/QtWebKitWidgets -isystem /usr/local/include/qt5/QtWebKit -isystem /usr/local/include/qt5/QtSql -isystem /usr/local/include/qt5/QtConcurrent -isystem /usr/local/include/qt5/QtPositioning  -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing -Wno-return-type-c-linkage -Wno-overloaded-virtual -Wimplicit-fallthrough -Qunused-arguments -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -fvisibility=hidden   -fPIC -std=gnu++11 -o CMakeFiles/qgis_core.dir/qgscoordinatereferencesystem.cpp.o -c /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/qgscoordinatereferencesystem.cpp
/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/qgscoordinatereferencesystem.cpp:1451:15: warning: unused variable 'errNo' [-Wunused-variable]
    const int errNo = proj_context_errno( ctx );
              ^
/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/qgscoordinatereferencesystem.cpp:2410:81: warning: unused parameter 'message' [-Wunused-parameter]
static void sync_db_proj_logger( void * /* user_data */, int level, const char *message )
                                                                                ^
Stack dump:
0.      Program arguments: /usr/local/llvm90/bin/clang-9 -cc1 -triple i386-portbld-freebsd12.0 -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name qgscoordinatereferencesystem.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu i586 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /wrkdirs/usr/ports/graphics/qgis/work/.build/src/core/CMakeFiles/qgis_core.dir/qgscoordinatereferencesystem.cpp.gcno -resource-dir /usr/local/llvm90/lib/clang/9.0.0 -isystem /usr/local/include -isystem /usr/local/include/Qca-qt5/QtCrypto -isystem /usr/local/include/qt5keychain -isystem /usr/local/include/qt5 -isystem /usr/local/include/qt5/QtSerialPort -isystem /usr/local/include/qt5/QtCore -isystem /usr/local/lib/qt5/mkspecs/freebsd-clang -isystem /usr/local/include/qt5/QtXml -isystem /usr/local/include/qt5/QtGui -isystem /usr/local/include/qt5/QtWidgets -isystem /usr/local/include/qt5/QtSvg -isystem /usr/local/include/qt5/QtPrintSupport -isystem /usr/local/include/qt5/QtNetwork -isystem /usr/local/include/qt5/QtWebKitWidgets -isystem /usr/local/include/qt5/QtWebKit -isystem /usr/local/include/qt5/QtSql -isystem /usr/local/include/qt5/QtConcurrent -isystem /usr/local/include/qt5/QtPositioning -D PROJ_VERSION_MAJOR=6 -D QT_CONCURRENT_LIB -D QT_CORE_LIB -D QT_DISABLE_DEPRECATED_BEFORE=0 -D QT_GUI_LIB -D QT_NETWORK_LIB -D QT_NO_CAST_TO_ASCII -D QT_NO_DEBUG -D QT_NO_FOREACH -D QT_POSITIONING_LIB -D QT_PRINTSUPPORT_LIB -D QT_SERIALPORT_LIB -D QT_SQL_LIB -D QT_SVG_LIB -D QT_WEBKITWIDGETS_LIB -D QT_WEBKIT_LIB -D QT_WIDGETS_LIB -D QT_XML_LIB -D SIP_VERSION=0x041313 -D TEST_DATA_DIR="/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/tests/testdata" -D WITH_BINDINGS -D WITH_QTWEBKIT -D _HAVE_PTHREAD_ -D qgis_core_EXPORTS -I /wrkdirs/usr/ports/graphics/qgis/work/.build -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core -I /wrkdirs/usr/ports/graphics/qgis/work/.build/src/core -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/3d -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/annotations -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/auth -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/dxf -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/effects -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/expression -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/fieldformatter -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/geometry -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/geocms -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/geocms/geonode -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/layertree -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/layout -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/locator -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/metadata -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/pal -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/processing -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/processing/models -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/providers -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/providers/memory -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/raster -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/renderer -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/scalebar -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/symbology -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/mesh -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/validity -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/external -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/external/kdbush/include -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/external/nmea -I /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/external/poly2tri -internal-isystem /usr/include/c++/v1 -O2 -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing -Wno-return-type-c-linkage -Wno-overloaded-virtual -Wimplicit-fallthrough -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir /wrkdirs/usr/ports/graphics/qgis/work/.build/src/core -ferror-limit 19 -fmessage-length 190 -fvisibility hidden -stack-protector 2 -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o CMakeFiles/qgis_core.dir/qgscoordinatereferencesystem.cpp.o -x c++ /wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/qgscoordinatereferencesystem.cpp
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module '/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/qgscoordinatereferencesystem.cpp'.
4.      Running pass 'clang-9: error: unable to execute command: Segmentation fault
clang-9: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 9.0.0 (tags/RELEASE_900/final)
Target: i386-portbld-freebsd12.0
Thread model: posix
InstalledDir: /usr/local/llvm90/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-9: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/qgscoordinatereferencesystem-8a0c03.cpp
clang-9: note: diagnostic msg: /tmp/qgscoordinatereferencesystem-8a0c03.sh
clang-9: note: diagnostic msg:

********************
Comment 1 Raphael Kubo da Costa freebsd_committer 2019-11-03 11:31:01 UTC
> The bug above says devel/llvm60 is fine (I've tried 12.0-RELEASE's clang 6 and it also works), but llvm70 and llvm80 are also broken.

Actually, the patch in bug 241096 says clang 7 and 8 are broken on amd64.
Comment 2 Dimitry Andric freebsd_committer 2019-11-03 12:26:29 UTC
I also tried with clang 9, but it's simply running out of RAM:

pid 1144 (clang), jid 0, uid 1000, was killed: out of swap space

This is on a VM with 6G RAM and 8G swap.  I can attempt to increase RAM to see if I can get it to build, to see what the maximum memory usage is.
Comment 3 Raphael Kubo da Costa freebsd_committer 2019-11-03 12:30:08 UTC
For the record, I've been using a VM with a lot more RAM than that, and even when it works (on amd64, for example) it still takes a long time to build that file.
Comment 4 Dimitry Andric freebsd_committer 2019-11-03 12:46:13 UTC
See also upstream bug https://bugs.llvm.org/show_bug.cgi?id=42515, and a Qt bug report: https://bugreports.qt.io/browse/QTBUG-57672
Comment 5 Dimitry Andric freebsd_committer 2019-11-03 12:59:34 UTC
Ok, it takes about 150 seconds and 10 GiB of RAM:

$ /usr/bin/time -l clang -cc1 -triple i386-portbld-freebsd12.0 -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name qgscoordinatereferencesystem.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu i586 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /wrkdirs/usr/ports/graphics/qgis/work/.build/src/core/CMakeFiles/qgis_core.dir/qgscoordinatereferencesystem.cpp.gcno -D PROJ_VERSION_MAJOR=6 -D QT_CONCURRENT_LIB -D QT_CORE_LIB -D QT_DISABLE_DEPRECATED_BEFORE=0 -D QT_GUI_LIB -D QT_NETWORK_LIB -D QT_NO_CAST_TO_ASCII -D QT_NO_DEBUG -D QT_NO_FOREACH -D QT_POSITIONING_LIB -D QT_PRINTSUPPORT_LIB -D QT_SERIALPORT_LIB -D QT_SQL_LIB -D QT_SVG_LIB -D QT_WEBKITWIDGETS_LIB -D QT_WEBKIT_LIB -D QT_WIDGETS_LIB -D QT_XML_LIB -D SIP_VERSION=0x041313 -D TEST_DATA_DIR=\"/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/tests/testdata\" -D WITH_BINDINGS -D WITH_QTWEBKIT -D _HAVE_PTHREAD_ -D qgis_core_EXPORTS -O2 -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing -Wno-return-type-c-linkage -Wno-overloaded-virtual -Wimplicit-fallthrough -std=gnu++11 -fdeprecated-macro -ferror-limit 19 -fmessage-length 190 -fvisibility hidden -stack-protector 2 -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -x c++ qgscoordinatereferencesystem-8a0c03.cpp
/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/qgscoordinatereferencesystem.cpp:1451:15: warning: unused variable 'errNo' [-Wunused-variable]
    const int errNo = proj_context_errno( ctx );
              ^
/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/qgscoordinatereferencesystem.cpp:2410:81: warning: unused parameter 'message' [-Wunused-parameter]
static void sync_db_proj_logger( void * /* user_data */, int level, const char *message )
                                                                                ^
2 warnings generated.
      153.92 real       146.75 user         7.09 sys
  10587924  maximum resident set size
     51645  average shared memory size
       299  average unshared data size
       858  average unshared stack size
   3153690  page reclaims
         2  page faults
         0  swaps
         2  block input operations
         9  block output operations
         0  messages sent
         0  messages received
         0  signals received
         6  voluntary context switches
      3495  involuntary context switches

That is indeed quite a lot.  It looks like lowering the optimization level to -O1 saves quite a bit, it then compiles in ~46 seconds, and using ~3.4 GiB RAM instead:

$ /usr/bin/time -l clang -cc1 -triple i386-portbld-freebsd12.0 -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name qgscoordinatereferencesystem.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu i586 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /wrkdirs/usr/ports/graphics/qgis/work/.build/src/core/CMakeFiles/qgis_core.dir/qgscoordinatereferencesystem.cpp.gcno -D PROJ_VERSION_MAJOR=6 -D QT_CONCURRENT_LIB -D QT_CORE_LIB -D QT_DISABLE_DEPRECATED_BEFORE=0 -D QT_GUI_LIB -D QT_NETWORK_LIB -D QT_NO_CAST_TO_ASCII -D QT_NO_DEBUG -D QT_NO_FOREACH -D QT_POSITIONING_LIB -D QT_PRINTSUPPORT_LIB -D QT_SERIALPORT_LIB -D QT_SQL_LIB -D QT_SVG_LIB -D QT_WEBKITWIDGETS_LIB -D QT_WEBKIT_LIB -D QT_WIDGETS_LIB -D QT_XML_LIB -D SIP_VERSION=0x041313 -D TEST_DATA_DIR=\"/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/tests/testdata\" -D WITH_BINDINGS -D WITH_QTWEBKIT -D _HAVE_PTHREAD_ -D qgis_core_EXPORTS -O1 -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing -Wno-return-type-c-linkage -Wno-overloaded-virtual -Wimplicit-fallthrough -std=gnu++11 -fdeprecated-macro -ferror-limit 19 -fmessage-length 190 -fvisibility hidden -stack-protector 2 -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -x c++ qgscoordinatereferencesystem-8a0c03.cpp
/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/qgscoordinatereferencesystem.cpp:1451:15: warning: unused variable 'errNo' [-Wunused-variable]
    const int errNo = proj_context_errno( ctx );
              ^
/wrkdirs/usr/ports/graphics/qgis/work/QGIS-final-3_8_2/src/core/qgscoordinatereferencesystem.cpp:2410:81: warning: unused parameter 'message' [-Wunused-parameter]
static void sync_db_proj_logger( void * /* user_data */, int level, const char *message )
                                                                                ^
2 warnings generated.
       46.02 real        43.95 user         2.07 sys
   3582316  maximum resident set size
     51602  average shared memory size
       299  average unshared data size
       660  average unshared stack size
    960286  page reclaims
         0  page faults
         0  swaps
         0  block input operations
        13  block output operations
         0  messages sent
         0  messages received
         0  signals received
         4  voluntary context switches
       830  involuntary context switches

So maybe this can be used as a workaround for now.
Comment 6 Loïc Bartoletti 2019-11-03 14:36:27 UTC
For reference, we have also a discussion on the QGIS Developper ML:
https://www.mail-archive.com/qgis-developer@lists.osgeo.org/msg47062.html

Thank you.
Comment 7 Loïc Bartoletti 2019-11-06 07:19:19 UTC
Rainer, Raphael, Dimitry,

Can you try to build it with this option for qgscoordinatereferencesystem "-mllvm -inline-threshold=128"

The patch on OpenBSD: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/geo/qgis/patches/patch-src_core_CMakeLists_txt?rev=1.22&content-type=text/x-cvsweb-markup&hideattic=1
Comment 8 Raphael Kubo da Costa freebsd_committer 2019-11-06 10:48:30 UTC
The OpenBSD patch did not solve the crash here. However, replacing "-mllvm -inline-threshold=128" with "-O1" is essentially dim's suggestion from comment #5 and Rainer's question from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241096#c6. Doing so has allowed me to build the port on my 12-i386 jail with no issues.
Comment 9 Loïc Bartoletti 2019-11-06 17:26:51 UTC
(In reply to Raphael Kubo da Costa from comment #8)

OK. Tested on my local machine with:
SET_SOURCE_FILES_PROPERTIES(qgscoordinatereferencesystem.cpp PROPERTIES COMPILE_FLAGS "-01")

added in src/core/CMakeLists.txt and it works for me too.

If it's ok also for you. I can upstream the patch.
Comment 10 Rainer Hurling 2019-11-06 18:20:57 UTC
Sorry for the delayed response. I first had to build a new jail 12.1 ie86 on Poudriere.

There I just tried the original method from the OpenBSD port and it also builds and installs with clang90! This is the patch I used for it:


# cat files/patch-src_core_CMakeLists.txt 
--- src/core/CMakeLists.txt.orig	2019-10-28 04:34:30 UTC
+++ src/core/CMakeLists.txt
@@ -889,6 +889,7 @@ ELSE(MSVC)
   SET_SOURCE_FILES_PROPERTIES(${QGIS_CORE_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
   IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND (CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
     SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp PROPERTIES COMPILE_FLAGS "-O1")
+    SET_SOURCE_FILES_PROPERTIES(qgscoordinatereferencesystem.cpp PROPERTIES COMPILE_FLAGS "-mllvm -inline-threshold=128")
   ENDIF ()
 ENDIF(MSVC)
Comment 11 Rainer Hurling 2019-11-06 19:22:41 UTC
(In reply to Rainer Hurling from comment #10)

The patch in comment #10 also works with clang8 (default compiler on 12.1).

Perhaps there is a chance to also remove LLVM_VER, CC, CPP and CXX vars now. I will investigate in the next days ...