Created attachment 181681 [details]
Despite discussion in bug 217016 my patch there was discarded in favor of manually backporting upstream change and making the same mistake upstream did. configure.ac has to be preprocessed by autoconf in order to remove extra [...] symbols used for quoting character list. Doing so would properly strip -f* flags including -fno-exceptions.
$ llvm-config40 --cxxflags | sed -E ... -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' ...
$ llvm-config40 --cxxflags | sed -E ... -e 's/[[:space:]]+-f[^[:space:]]*//g' ...
FYI, proper fix for DragonFly (and OS X) got stalled on review.
(In reply to Jan Beich from comment #0)
> making the same mistake upstream did
Created attachment 181684 [details]
(In reply to Jan Beich from comment #1)
> FYI, proper fix for DragonFly (and OS X) got stalled on review.
Nevermind, I've included the upstream fix. It survived poudriere and sed(1) on FreeBSD 9.x which is close to DragonFly.
*Sigh* I put back the stripping of -fno-exceptions because that seemed necessary due to the imperfect sed action in post-patch, then figured I might as well backport that sed change from 17.1 since it's in the same place. I made the change in configure first, then configure.ac and counted more brackets, so go add some in configure thinking I must have missed copying everything the first time, and somehow that all does work with -march present. I should have just left well enough alone with [:graph:] there....
Thanks for providing a standalone diff that can easily be applied without other changes. Since this is only a build fix (if there are any build failures) there is no need to bump PORTREVISION.
PORTREVISION was bumped out of caution. llvm-config has a bunch of -f* flags that neither Mesa build nor the ports framework passes otherwise.
$ llvm-config40 --cxxflags | sed 'y/ /\n/' | sed '/^-f/!d'
Nevermind, -fno-omit-frame-pointer was actually from my make.conf (for profiling). The rest are mostly optimizations.
A commit references this bug:
Date: Fri May 12 18:46:56 UTC 2017
New revision: 440699
Consolidate the Mesa ports, update to 17.0.4, and add Wayland option
* libGL, libEGL, libglesv2, libglapi, and gbm have been moved into mesa-libs,
graphics/dri has been renamed to mesa-dri, and USE_GL has been adjusted
* mesa-libs has a new WAYLAND option that enables platform support in libEGL
* mesa-dri now depends on graphics/s2tc for compressed texture support 
* re-remove obsolete dependency on makedepends 
* correct sed fix backported from 17.1 
PR: 218799 (exp-run), 212762 , 218552 , 218562 
Submitted by: dbn , jbeich [2,3]
Reported by: firstname.lastname@example.org 
Reviewed by: kwm, email@example.com
Approved by: portmgr, swills (mentor)
Differential Revision: https://reviews.freebsd.org/D10448