Bug 255308 - shells/ast-ksh: fix build on powerpc64*
Summary: shells/ast-ksh: fix build on powerpc64*
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: powerpc Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-21 16:18 UTC by Piotr Kubaj
Modified: 2021-04-26 15:25 UTC (History)
2 users (show)

See Also:
saper: maintainer-feedback+


Attachments
patch (1.50 KB, patch)
2021-04-21 16:18 UTC, Piotr Kubaj
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2021-04-21 16:18:10 UTC
Created attachment 224334 [details]
patch

This patch brings back patches that were committed as part of https://svnweb.freebsd.org/ports?view=revision&revision=346423.

This is necessary to build on powerpc64 and powerpc64le, due to the following error:
+ cc -D_BLD_DLL -fPIC -D_BLD_ast -Wno-unused-value -Wno-parentheses -Wno-logical-op-parentheses -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -I. -I/wrkdirs/usr/ports/shells/ast-ksh/work/ast-ksh93v/src/lib/libast -Icomp -I/wrkdirs/usr/ports/shells/ast-ksh/work/ast-ksh93v/src/lib/libast/comp -Ihash -I/wrkdirs/usr/ports/shells/ast-ksh/work/ast-ksh93v/src/lib/libast/hash -Iinclude -I/wrkdirs/usr/ports/shells/ast-ksh/work/ast-ksh93v/src/lib/libast/include -Istd -I/wrkdirs/usr/ports/shells/ast-ksh/work/ast-ksh93v/src/lib/libast/std -D_PACKAGE_ast -c /wrkdirs/usr/ports/shells/ast-ksh/work/ast-ksh93v/src/lib/libast/hash/hashalloc.c
/wrkdirs/usr/ports/shells/ast-ksh/work/ast-ksh93v/src/lib/libast/hash/hashalloc.c:162:4: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a temporary of type 'va_list' (aka 'char *')
                        va_copy(ap, va_listval(va_arg(ap, va_listarg)));
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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))
                                                                  ^~~~~
1 error generated.
mamake [lib/libast]: *** exit code 1 making hashalloc.o
Comment 1 Marcin Cieślak 2021-04-25 21:34:19 UTC
I can't test it, but yes, please restore it as it were. Thank you.

Is sbrk(0) syscall still working on the platform?
Comment 2 Piotr Kubaj freebsd_committer 2021-04-26 15:23:10 UTC
(In reply to Marcin Cieślak from comment #1)
Yes, sbrk() works on powerpc64. Thanks!
Comment 3 commit-hook freebsd_committer 2021-04-26 15:25:32 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=27ff8d373e4d1ed2e6a049015109d23171e4bc1d

commit 27ff8d373e4d1ed2e6a049015109d23171e4bc1d
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2021-04-26 15:24:28 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2021-04-26 15:24:28 +0000

    shells/ast-ksh: fix build on powerpc64*

    Bring back patches committed as part of r346423 to fix build issue:
    /wrkdirs/usr/ports/shells/ast-ksh/work/ast-ksh93v/src/lib/libast/hash/hashalloc.c:162:4: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a temporary of type 'va_list' (aka 'char *')
                            va_copy(ap, va_listval(va_arg(ap, va_listarg)));
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /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))
                                                                      ^~~~~
    1 error generated.

    PR:     255308
    Approved by:    saper@saper.info (maintainer)

 .../patch-src_lib_libast_hash_hashalloc.c (new)      | 20 ++++++++++++++++++++
 .../patch-src_lib_libast_string_tokscan.c (new)      | 20 ++++++++++++++++++++
 2 files changed, 40 insertions(+)