Created attachment 226120 [details]
Improve settings about NATIVECOMP option by replacing the combination of NATIVECOMP_LIB_DEPENDS, NATIVECOMP_CFLAGS and NATIVECOMP_LDFLAGS with NATIVECOMP_USE.
Currently it only means lang/gcc11 is used instead of lang/gcc11-devel and there isn't much difference. But when newer versions of GCC are released in the future, it will bring following benefits.
* Multiple versions of GCC can be used to build this port with NATIVECOMP option enabled.
* If default version of GCC is switched to 11 or later, or changed by adding "DEFAULT_VERSIONS+=gcc=11", "DEFAULT_VERSIONS+=gcc=12", ... in make.conf, then default one can be used for NATIVECOMP option. It means you need not build and install non-default one to build this port with NATIVECOMP option enabled.
(In reply to Yasuhiro Kimura from comment #0)
Thanks for submitting.
> Improve settings about NATIVECOMP option by replacing the combination of NATIVECOMP_LIB_DEPENDS, NATIVECOMP_CFLAGS and NATIVECOMP_LDFLAGS with NATIVECOMP_USE.
This has a side-effect that emacs will also be built with GCC. We would prefer to continue to build emacs with the default compiler.
It makes sense not to force a dependency on gcc1-devel though. When the NATIVECOMP knob was first added, only gcc11-devel supported libgccjit. We will see if bsd.gcc.mk can be modified, so that only a LIB_DEPENDS on an appropriate GCC version can be added.
We'll keep this report open until we have a solution.
Created attachment 227445 [details]
Updated patch file
Use `make -V _GCC_PORT USE_GCC=11+` to determine which version of GCC to be used as dependency for libgccjit. This command returns default version of GCC if it is 11 or newer and 11 otherwise. So if default version of GCC is switched to 11 or later in the future, or user explicitly changed it to 11, 12, ..., then he can build this port with NATIVCOMP option enabled without install non-default version of GCC.
(In reply to Yasuhiro Kimura from comment #3)
Our apologies for not letting you know, we have a solution in works to resolve this problem: https://reviews.freebsd.org/D31011 (waiting to be reviewed).
If you have any feedback about this, then please share.
I beginning to believe that the patch here would be better than what's proposed in https://reviews.freebsd.org/D31011. I left a comment on the review stating this.
A commit in branch main references this bug:
Author: Yasuhiro Kimura <firstname.lastname@example.org>
AuthorDate: 2021-09-06 22:16:08 +0000
Commit: Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2021-09-07 02:44:59 +0000
editors/emacs-devel: Improve gcc port selection for NATIVECOMP
Differential Revision: https://reviews.freebsd.org/D31011
editors/emacs-devel/Makefile | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Committed with minor modifications. Thanks for submitting and sorry for the delay.