A recent commit [1] broke the build of x11/cde on armv7. This is due to a wrong type for a newly introduced local variable. The offending patch is: --- programs/dtksh/ksh93/src/lib/libast/hash/hashalloc.c.orig 2021-12-13 19:03:46 UTC +++ programs/dtksh/ksh93/src/lib/libast/hash/hashalloc.c @@ -49,6 +49,7 @@ hashalloc(Hash_table_t* ref, ...) va_list* vp = va; Hash_region_f region = 0; void* handle; + va_listarg tmpval; va_start(ap, ref); @@ -151,7 +152,8 @@ hashalloc(Hash_table_t* ref, ...) va_copy(*vp, ap); vp++; } - va_copy(ap, va_listval(va_arg(ap, va_listarg))); + tmpval = va_listval(va_arg(ap, va_listarg)); + va_copy(ap, tmpval); break; case 0: if (vp > va) The build then fails with error messages: /wrkdirs/usr/ports/x11/cde/work/cde-2.4.0/programs/dtksh/ksh93/src/lib/libast/hash/hashalloc.c:155:11: error: assigning to 'va_list *' (aka '__builtin_va_list *') from incompatible type 'va_list' (aka '__builtin_va_list'); take the address with & tmpval = va_listval(va_arg(ap, va_listarg)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &( ) /wrkdirs/usr/ports/x11/cde/work/cde-2.4.0/programs/dtksh/ksh93/src/lib/libast/hash/hashalloc.c:156:4: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'va_list *' (aka '__builtin_va_list *') va_copy(ap, tmpval); ^~~~~~~~~~~~~~~~~~~ /usr/include/sys/_stdarg.h:49:32: note: expanded from macro 'va_copy' #define va_copy(dest, src) __va_copy(dest, src) ^~~~~~~~~~~~~~~~~~~~ /usr/include/sys/_stdarg.h:47:58: note: expanded from macro '__va_copy' #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) ^~~~~ 2 errors generated. Likely, this can be fixed by changing the type of tmpval. I am however completely unfamiliar with the code base and for a lack of comments have no idea what the purpose of this patch is or why it is needed in the first place, so I don't think I can fix this on my own without further information. [1]: https://cgit.freebsd.org/ports/commit/?id=c66a851d13783558a8fa17ffcf64759a0c1b5bab
Those were copied from shells/ast-ksh port. I added them to shells/ast-ksh to fix the same build issue. However, I'm not actually the author of those patches. I copied them to shells/ast-ksh from the past commit of shells/ksh93 https://svnweb.freebsd.org/ports?view=revision&revision=346423 I guess the easiest way to fix build will be making those patches architecture-dependent (applied only on powerpc64*).
I'll extract the patches from git and apply them to cde.
(In reply to Piotr Kubaj from comment #1) Those patch files are already in x11/cde.
Created attachment 231185 [details] Revert c66a851d13783558a8fa17ffcf64759a0c1b5bab Can you try this, please.
Oh, could you leave endianness checks as it is? They don't cause issues for the reporter and I got errors about running unknown endianness without that.
Also, I don't think they were in CDE before my commit, because my commit actually fixed build on powerpc64le, so I guess va_* changes should be moved to EXTRA_PATCHES for powerpc64le.
(In reply to Piotr Kubaj from comment #6) Correct. Those patches were not there before your commit. Let's move them to EXTRA_PATCHES. I don't have time to work on this until Monday or Tuesday, if people don't mind waiting. Or, Piotr, you can cobble up a patch.
Created attachment 231194 [details] This fixes c66a851d13783558a8fa17ffcf64759a0c1b5bab. This fix for c66a851d13783558a8fa17ffcf64759a0c1b5bab should resolve the issue. Try it, please.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=47d8fb3af3f0e411edcb06a9c694813404c8fe39 commit 47d8fb3af3f0e411edcb06a9c694813404c8fe39 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2022-01-20 21:20:59 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2022-01-20 22:44:30 +0000 x11/cde: Fix armv7 build In attempting to fix powerpc64le, c66a851d13783558a8fa17ffcf64759a0c1b5bab broke armv7. Fix it. PR: 261359 Reported by: Robert Clausecker <fuz@fuz.su> Fixes: c66a851d13783558a8fa17ffcf64759a0c1b5bab x11/cde/Makefile | 8 +++++++- ...h-programs_dtksh_ksh93_src_lib_libast_hash_hashalloc.c | 15 ++++++++++----- ...h-programs_dtksh_ksh93_src_lib_libast_string_tokscan.c | 15 ++++++++++----- 3 files changed, 27 insertions(+), 11 deletions(-)
Created attachment 231198 [details] x11/cde 2.4.0 build log on armv7 FreeBSD 13 With this patch the port builds, but falls prey to some strange plist issues. See attached build log for details.
Created attachment 231200 [details] Revert PowerPC fix that broke armv7. No such problems here on amd64 14-CURRENT. ====> Checking for pkg-plist issues (check-plist) ===> Parsing plist ===> Checking for items in STAGEDIR missing from pkg-plist ===> Checking for items in pkg-plist which are not in STAGEDIR ===> No pkg-plist issues found (check-plist) I'll revert this and Piotr's PowerPC patch until he finds a better way to solve the PowerPC build without breaking armv7. You will need to test first before I commit the revert. Let me know ASAP.
Robert, Please test with the revert patch. I am trying to establish whether the pkg-plist problems were prior to PowerPC patch and the workaround I committed. Otherwise I will need to the port BROKEN on armv7 (because 32-bit arm is not Tier-1).
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=03c319e5e9f2bd0244819d0d74159d98c10842d2 commit 03c319e5e9f2bd0244819d0d74159d98c10842d2 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2022-01-21 18:50:33 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2022-01-21 18:55:24 +0000 x11/cde: Mark BROKEN on armv7 STAGEDIR contains numerous intermediate files likely used during the install process which are not in the final STAGEDIR on other platforms. An example of one of the 5830 orphaned files is: dt/app-defaults/C/ecp.2AeDmfIk. PR: 261359 x11/cde/Makefile | 1 + 1 file changed, 1 insertion(+)
(In reply to Cy Schubert from comment #12) Hi Cy, Do you still want me to test with the revert patch?
Yes please. We need to establish if 5830 garbage files in $STAGEDIR were a regression from 2.4.0 or due to a subsequent commit.
(In reply to Cy Schubert from comment #15) Your last patch file does not apply cleanly. I have instead reverted c66a851d. Would that do the same thing?
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=ba5de232fe34dc71085e96d1df7937bea080f4d6 commit ba5de232fe34dc71085e96d1df7937bea080f4d6 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2022-01-22 15:54:28 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2022-01-22 16:00:01 +0000 x11/cde: Handle undstrippable outputs Stripping unstrippable files results in ecp.* files. Deal with the fallout. PR: 261359, 261359 x11/cde/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Some discussion that the ecp.* were likely to be created by strip(1) before. Seems a commit seemed to tickle the bug -- not sure how. Try the workaround instead.
(In reply to Cy Schubert from comment #19) Hi, Reverting c66a851d causes the same failure.
My hunch was correct. It's a strip(1) bug. Update your ports tree to resolve the problem.
(In reply to Cy Schubert from comment #21) Hi Cy, I can confirm that the problem is fixed in the current main branch. Can you MFH the fix?
A commit in branch 2022Q1 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=181ced015360d1b86b57298da7be4422e0d28522 commit 181ced015360d1b86b57298da7be4422e0d28522 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2022-01-20 21:20:59 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2022-01-23 20:02:29 +0000 x11/cde: MFH x11/cde fixes The following MFHs were requested by Robert Clausecker <fuz@fuz.su> in PR/261359: Requested by: Robert Clausecker <fuz@fuz.su> PR: 261359 -- x11/cde: Fix armv7 build In attempting to fix powerpc64le, c66a851d13783558a8fa17ffcf64759a0c1b5bab broke armv7. Fix it. PR: 261359 Reported by: Robert Clausecker <fuz@fuz.su> Fixes: c66a851d13783558a8fa17ffcf64759a0c1b5bab (cherry picked from commit 47d8fb3af3f0e411edcb06a9c694813404c8fe39) -- x11/cde: Mark BROKEN on armv7 STAGEDIR contains numerous intermediate files likely used during the install process which are not in the final STAGEDIR on other platforms. An example of one of the 5830 orphaned files is: dt/app-defaults/C/ecp.2AeDmfIk. PR: 261359 (cherry picked from commit 03c319e5e9f2bd0244819d0d74159d98c10842d2) -- x11/cde: Handle undstrippable outputs Stripping unstrippable files results in ecp.* files. Deal with the fallout. PR: 261359, 261359 (cherry picked from commit ba5de232fe34dc71085e96d1df7937bea080f4d6) -- x11/cde: Fix a typo Reported by: adridg (cherry picked from commit 235153c84f41c06ba188bf3df297a6e87b2fe339) x11/cde/Makefile | 10 +++++++++- ...h-programs_dtksh_ksh93_src_lib_libast_hash_hashalloc.c | 15 ++++++++++----- ...h-programs_dtksh_ksh93_src_lib_libast_string_tokscan.c | 15 ++++++++++----- 3 files changed, 29 insertions(+), 11 deletions(-)
fixed