Created attachment 198458 [details] patch -fnested-functions is necessary to support nested functions with base GCC. Tested on powerpc64. Hardware sponsored by IntegriCloud.
Patch looks good to me.
Testing a patch with the flag conditionalized on CHOSEN_COMPILER_TYPE.
Created attachment 199632 [details] updated patch to tigcc
(In reply to Mark Linimon from comment #3) This patch is sufficient on powerpc64 but fails on amd64. What am I missing?
(In reply to Mark Linimon from comment #4) Do you mean it fails with clang or gcc on amd64?
(In reply to Piotr Kubaj from comment #5) On amd64 I get: checking whether the C compiler (gcc7 -O2 -pipe -fnested-functions -fstack-protector -Wl,-rpath=/usr/local/lib/gcc7 -fno-strict-aliasing -std=gnu89 -fstack-protector -Wl,-rpath=/usr/local/lib/gcc7 -L/usr/local/l ib/gcc7 ) works... no configure: error: installation or configuration problem: C compiler cannot create executables.
It looks like new GCC supports nested functions without any switch. We can check for .if exists(/usr/lib/libstdc++.so) and only add -fnested-functions if it exists.
A commit references this bug: Author: linimon Date: Thu Dec 6 23:56:00 UTC 2018 New revision: 486810 URL: https://svnweb.freebsd.org/changeset/ports/486810 Log: -fnested-functions is necessary to support nested functions with base GCC. While here, pet portlint. PR: 232520 Submitted by: Piotr Kubaj Approved by: maintainer (earlier version of patch) Changes: head/devel/tigcc/Makefile