Created attachment 206277 [details] patch Merge https://github.com/att/ast/commit/dd0570ce4aa087de133f18237efa262151c5154f.patch to fix build with GCC. Since the files changed before this commit, we can't apply it via PATCHFILES.
That is actually this patch: commit 63e9edcb6084d4b164439065e2d71f3e900ec3c7 Author: Kurtis Rader <krader@skepticism.us> Date: Wed May 22 19:30:12 2019 -0700 Stop dynamically generating conftab.c and conftab.h GCC 9.1 changes the output of `gcc -E` which breaks the conf.sh script. We want to eliminate the `getconf` builtin and the `astconf()` function. No unit tests depend on either of those. And it is highly unlikely any real world scripts do so. So as the first step in removing those APIs and to make building this possible with gcc 9.1 just use a static version of conftab.c and conftab.h. Fixes #1315 Related #1118
Created attachment 206281 [details] Upd
The upstream patch doesn't apply, even with -p1. So, can you please try the updated patch? For patches such as this you need to apply them first then do make makepatch.
A commit references this bug: Author: cy Date: Sun Aug 4 17:42:40 UTC 2019 New revision: 508117 URL: https://svnweb.freebsd.org/changeset/ports/508117 Log: Fix build with GCC-based architectures. PR: 239644 Submitted by: pkubaj@ MFH: 2019Q3 Changes: head/shells/ksh93/Makefile head/shells/ksh93/files/patch-scripts__libast____prereq.sh head/shells/ksh93/files/patch-scripts__sort____symbols.py head/shells/ksh93/files/patch-src__lib__libast__comp__conf.sh head/shells/ksh93/files/patch-src__lib__libast__comp__conf.tab head/shells/ksh93/files/patch-src__lib__libast__comp__conftab.c head/shells/ksh93/files/patch-src__lib__libast__comp__conftab.c.in head/shells/ksh93/files/patch-src__lib__libast__comp__conftab.h.in head/shells/ksh93/files/patch-src__lib__libast__include__conftab.h head/shells/ksh93/files/patch-src__lib__libast__meson.build
Committed. Thanks for the pre-work massaging the patch. As you said, the raw github patch, regardless of the hash used, didn't patch. It is greatly appreciated that you allow me the opportunity to review the patch first as a jumbo patch would have been inappropriate in this case.
A commit references this bug: Author: cy Date: Mon Aug 5 13:28:05 UTC 2019 New revision: 508167 URL: https://svnweb.freebsd.org/changeset/ports/508167 Log: MFH: r508117 Fix build with GCC-based architectures. PR: 239644 Submitted by: pkubaj@ Approved by: portmgr (joneum@) Changes: _U branches/2019Q3/ branches/2019Q3/shells/ksh93/Makefile branches/2019Q3/shells/ksh93/files/patch-scripts__libast____prereq.sh branches/2019Q3/shells/ksh93/files/patch-scripts__sort____symbols.py branches/2019Q3/shells/ksh93/files/patch-src__lib__libast__comp__conf.sh branches/2019Q3/shells/ksh93/files/patch-src__lib__libast__comp__conf.tab branches/2019Q3/shells/ksh93/files/patch-src__lib__libast__comp__conftab.c branches/2019Q3/shells/ksh93/files/patch-src__lib__libast__comp__conftab.c.in branches/2019Q3/shells/ksh93/files/patch-src__lib__libast__comp__conftab.h.in branches/2019Q3/shells/ksh93/files/patch-src__lib__libast__include__conftab.h branches/2019Q3/shells/ksh93/files/patch-src__lib__libast__meson.build
Build still fails with GCC9: /usr/local/poudriere/ports/default/shells/ksh93/work/ast-2020.0.0-alpha1/build/src/lib/libast/comp/conftab.c:356:74: error: '_PC_XATTR_EXISTS' undeclared here (not in a function) 356 | { "XATTR_EXISTS", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SUN, 1, CONF_pathconf, _PC_XATTR_EXISTS }, | ^~~~~~~~~~~~~~~~
This was fixed by upstream commit: commit 63e9edcb6084d4b164439065e2d71f3e900ec3c7 Author: Kurtis Rader <krader@skepticism.us> Date: Wed May 22 19:30:12 2019 -0700 Stop dynamically generating conftab.c and conftab.h GCC 9.1 changes the output of `gcc -E` which breaks the conf.sh script. We want to eliminate the `getconf` builtin and the `astconf()` function. No unit tests depend on either of those. And it is highly unlikely any real world scripts do so. So as the first step in removing those APIs and to make building this possible with gcc 9.1 just use a static version of conftab.c and conftab.h. Fixes #1315 Related #1118 -- Unfortunately the patch does not apply to the somewhat ancient shells/ksh93. We can flag the port broken on architectures that use GCC 9, recommending people use ksh93-devel. What architectures would you like flagged broken with a pointer to ksh93-devel?
We will flag as broken when USE_GCC==9 instead.
A commit references this bug: Author: cy Date: Mon Aug 12 04:44:38 UTC 2019 New revision: 508705 URL: https://svnweb.freebsd.org/changeset/ports/508705 Log: Mark broken when USE_GCC=9. Upstream git commit 63e9edcb6084d4b164439065e2d71f3e900ec3c7 resolves this issue. Unfortunately it does not apply, requiring this port to be upated to ksh93 well into ksh93-devel. Bringing ksh93 up to the ksh93-devel or shy of it would negate the justification for ksh93's existence. It is therefore recommended that people use ksh93-devel on architectures that use GCC 9 or use GCC 8. PR: 239644 Reported by: pkubaj@ Changes: head/shells/ksh93/Makefile
A commit references this bug: Author: tobik Date: Mon Aug 12 07:17:09 UTC 2019 New revision: 508709 URL: https://svnweb.freebsd.org/changeset/ports/508709 Log: shells/ksh93: Attempt to fix r508705 and unbreak index It fails basic sanity checks: make: "/usr/ports/shells/ksh93/Makefile" line 16: Malformed conditional (${USE_GCC} == "9") make: Fatal errors encountered -- cannot continue make: stopped in /usr/ports/shells/ksh93 PR: 239644 Pointy hat: cy Changes: head/shells/ksh93/Makefile
Reopening this. Even though you committed a conditional so that it doesn't build with gcc9, it's after inclusion of bsd.port.pre.mk, which makes it still build. You could actually try using the patch sent by me, that way the port compiles. A (hacky) workaround would be also to force using gcc8.
That is a significant patch. Have you test built it on current, stable/12 and stable/11?
I tested on 11 and 12. I have no CURRENT installed.
Requested upstream tag 2020.0.0-alpha2 based on 63e9edcb6084d4b164439065e2d71f3e900ec3c7. Let's avoid too many patches that will require you to upkeep. Or we can push forward the port to 63e9edcb6084d4b164439065e2d71f3e900ec3c7 instead of the 2020.0.0-alpha1 tag. Let's see what they say and decide whether to push forward or apply your patches.
Our upstream has agreed it's time for a new tag. They will tag 2020.0.0-beta-something. https://github.com/att/ast/issues/1385.
A commit references this bug: Author: cy Date: Fri Aug 30 20:05:28 UTC 2019 New revision: 510287 URL: https://svnweb.freebsd.org/changeset/ports/510287 Log: Update 2020.0.0-alpha1 --> 2020.0.0-beta1 2020.0.0-beta1 resolves gcc9 build issues in PR/239644. PR: 239644 Changes: head/shells/ksh93/Makefile head/shells/ksh93/distinfo head/shells/ksh93/files/extra-patch-install-as-ksh93 head/shells/ksh93/files/patch-scripts__libast____prereq.sh head/shells/ksh93/files/patch-scripts__sort____symbols.py head/shells/ksh93/files/patch-scripts_builtin_documentation.sh head/shells/ksh93/files/patch-src__lib__libast__comp__conf.sh head/shells/ksh93/files/patch-src__lib__libast__comp__conf.tab head/shells/ksh93/files/patch-src__lib__libast__comp__conftab.c head/shells/ksh93/files/patch-src__lib__libast__comp__conftab.c.in head/shells/ksh93/files/patch-src__lib__libast__comp__conftab.h.in head/shells/ksh93/files/patch-src__lib__libast__include__conftab.h head/shells/ksh93/files/patch-src__lib__libast__meson.build head/shells/ksh93/files/patch-src_cmd_ksh93_sh_xec.c