public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support
@ 2023-02-06 10:08 robinlee.sysu at gmail dot com
  2023-03-03  4:14 ` [Bug libffi/108682] " xry111 at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: robinlee.sysu at gmail dot com @ 2023-02-06 10:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

            Bug ID: 108682
           Summary: libffi needs to merge upstream to get LoongArch
                    support
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libffi
          Assignee: unassigned at gcc dot gnu.org
          Reporter: robinlee.sysu at gmail dot com
  Target Milestone: ---

Significant parts of GCC already get LoongArch support. But when I try to build
gccgo for LoongArch, it fails:

configure: error: "libffi has not been ported to
loongarch64-unknown-linux-gnuf64."

libffi upstream already gets LoongArch support since 3.4.3. The latest version
is 3.4.4.

Is there any chance a merge with upstream can be performed before GCC 13 final
release? So gccgo can be built for LoongArch.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
@ 2023-03-03  4:14 ` xry111 at gcc dot gnu.org
  2023-03-03  4:16 ` xry111 at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-03-03  4:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |xry111 at gcc dot gnu.org
   Last reconfirmed|                            |2023-03-03

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
  2023-03-03  4:14 ` [Bug libffi/108682] " xry111 at gcc dot gnu.org
@ 2023-03-03  4:16 ` xry111 at gcc dot gnu.org
  2023-03-03  7:54 ` xry111 at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-03-03  4:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #1 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Merging libffi is a big change and not suitable for stage 3 IMO.

Can we can apply the LoongArch patch locally instead?  It will not affect other
targets and even if does not work perfectly on LoongArch we don't lose
anything.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
  2023-03-03  4:14 ` [Bug libffi/108682] " xry111 at gcc dot gnu.org
  2023-03-03  4:16 ` xry111 at gcc dot gnu.org
@ 2023-03-03  7:54 ` xry111 at gcc dot gnu.org
  2023-03-03  8:33 ` schwab@linux-m68k.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-03-03  7:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #2 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
I applied the LoongArch port patch (upstream PR 678, config.guess and
config.sub changes stripped and Makefile.am conflict resolved manually) and use
autogen.sh to regenerate the build system.  But libgo build still fails with:

libtool: compile:  /home/xry111/git-repos/gcc-build/./gcc/gccgo
-B/home/xry111/git-repos/gcc-build/./gcc/
-B/home/xry111/gcc-trunk/loongarch64-unknown-linux-gnu/bin/
-B/home/xry111/gcc-trunk/loongarch64-unknown-linux-gnu/lib/ -isystem
/home/xry111/gcc-trunk/loongarch64-unknown-linux-gnu/include -isystem
/home/xry111/gcc-trunk/loongarch64-unknown-linux-gnu/sys-include -O2 -g -I . -c
-fgo-pkgpath=internal/goarch ../../../gcc/libgo/go/internal/goarch/goarch.go
zgoarch.go  -fPIC -o internal/.libs/goarch.o
zgoarch.go:7:14: error: expected ‘;’ or ‘)’ or newline
    7 |   _BigEndian =
      |              ^
zgoarch.go:7:3: error: reference to undefined name ‘_BigEndian’
    7 |   _BigEndian =
      |   ^
../../../gcc/libgo/go/internal/goarch/goarch.go:18:19: error: reference to
undefined name ‘_BigEndian’
   18 | const BigEndian = _BigEndian
      |                   ^
../../../gcc/libgo/go/internal/goarch/goarch.go:21:29: error: reference to
undefined name ‘_DefaultPhysPageSize’
   21 | const DefaultPhysPageSize = _DefaultPhysPageSize
      |                             ^
../../../gcc/libgo/go/internal/goarch/goarch.go:25:19: error: reference to
undefined name ‘_PCQuantum’
   25 | const PCQuantum = _PCQuantum
      |                   ^
../../../gcc/libgo/go/internal/goarch/goarch.go:28:20: error: reference to
undefined name ‘_Int64Align’
   28 | const Int64Align = _Int64Align
      |                    ^
../../../gcc/libgo/go/internal/goarch/goarch.go:35:22: error: reference to
undefined name ‘_MinFrameSize’
   35 | const MinFrameSize = _MinFrameSize
      |                      ^
../../../gcc/libgo/go/internal/goarch/goarch.go:39:20: error: reference to
undefined name ‘_StackAlign’
   39 | const StackAlign = _StackAlign
      |                    ^

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (2 preceding siblings ...)
  2023-03-03  7:54 ` xry111 at gcc dot gnu.org
@ 2023-03-03  8:33 ` schwab@linux-m68k.org
  2023-03-03  8:45 ` xry111 at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: schwab@linux-m68k.org @ 2023-03-03  8:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #3 from Andreas Schwab <schwab@linux-m68k.org> ---
libgo/goarch.sh is missing LoongArch support.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (3 preceding siblings ...)
  2023-03-03  8:33 ` schwab@linux-m68k.org
@ 2023-03-03  8:45 ` xry111 at gcc dot gnu.org
  2023-05-22  6:28 ` xry111 at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-03-03  8:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #4 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Andreas Schwab from comment #3)
> libgo/goarch.sh is missing LoongArch support.

We ship a go 1.18 runtime but LoongArch support was added in 1.19.  Updating go
runtime in stage 3 is definitely not possible.

Defer to GCC 14.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (4 preceding siblings ...)
  2023-03-03  8:45 ` xry111 at gcc dot gnu.org
@ 2023-05-22  6:28 ` xry111 at gcc dot gnu.org
  2023-05-22 16:34 ` ian at airs dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-05-22  6:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian at airs dot com

--- Comment #5 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Ian: is there any plan to update libgo?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (5 preceding siblings ...)
  2023-05-22  6:28 ` xry111 at gcc dot gnu.org
@ 2023-05-22 16:34 ` ian at airs dot com
  2023-05-22 16:34 ` ian at airs dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ian at airs dot com @ 2023-05-22 16:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #6 from Ian Lance Taylor <ian at airs dot com> ---
libgo is running behind right now, but in any case I personally don't have
plans to add LoongARCH support.  I would be happy to review any patches, which
would ideally be sent using the process described at
https://go.dev/doc/gccgo_contribute.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (6 preceding siblings ...)
  2023-05-22 16:34 ` ian at airs dot com
@ 2023-05-22 16:34 ` ian at airs dot com
  2023-05-23  8:17 ` xry111 at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ian at airs dot com @ 2023-05-22 16:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #7 from Ian Lance Taylor <ian at airs dot com> ---
To be clear, I will at some point update libgo to newer Go releases, yes.  I'm
working on adding generics support to the frontend.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (7 preceding siblings ...)
  2023-05-22 16:34 ` ian at airs dot com
@ 2023-05-23  8:17 ` xry111 at gcc dot gnu.org
  2023-05-23 16:22 ` ian at airs dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-05-23  8:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #8 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Ian Lance Taylor from comment #6)
> libgo is running behind right now, but in any case I personally don't have
> plans to add LoongARCH support.  I would be happy to review any patches,
> which would ideally be sent using the process described at
> https://go.dev/doc/gccgo_contribute.

The Go runtime already contains LoongArch support since 1.19 release.  I (and
Xuerui, and some Loongson employees) can help for integrating it with gccgo,
but I guess we cannot do a thing until libgo is updated to use Go runtime >=
1.19.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (8 preceding siblings ...)
  2023-05-23  8:17 ` xry111 at gcc dot gnu.org
@ 2023-05-23 16:22 ` ian at airs dot com
  2023-05-24  7:40 ` xry111 at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ian at airs dot com @ 2023-05-23 16:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #9 from Ian Lance Taylor <ian at airs dot com> ---
If you really want to you can port the LoongArch changes back to 1.18.  I don't
think that would be too hard--it's mostly a matter of adding build tags in
various places.  But it's up to you.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (9 preceding siblings ...)
  2023-05-23 16:22 ` ian at airs dot com
@ 2023-05-24  7:40 ` xry111 at gcc dot gnu.org
  2023-08-23  6:16 ` cvs-commit at gcc dot gnu.org
  2023-08-23 14:12 ` xry111 at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-05-24  7:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #10 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Ian Lance Taylor from comment #9)
> If you really want to you can port the LoongArch changes back to 1.18.  I
> don't think that would be too hard--it's mostly a matter of adding build
> tags in various places.  But it's up to you.

I'd wait for the next update.  People can use the Google Go compiler for now
anyway.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (10 preceding siblings ...)
  2023-05-24  7:40 ` xry111 at gcc dot gnu.org
@ 2023-08-23  6:16 ` cvs-commit at gcc dot gnu.org
  2023-08-23 14:12 ` xry111 at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-23  6:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by LuluCheng <chenglulu@gcc.gnu.org>:

https://gcc.gnu.org/g:4beacf3cb8d128b3b9c8c2d3824693b895414428

commit r14-3405-g4beacf3cb8d128b3b9c8c2d3824693b895414428
Author: Lulu Cheng <chenglulu@loongson.cn>
Date:   Tue Aug 22 19:56:21 2023 +0800

    libffi: Backport of LoongArch support for libffi.

    This is a backport of <https://github.com/libffi/libffi/commit/f259a6f6de>,
    and contains modifications to commit 5a4774cd4d, as well as the LoongArch
    schema portion of commit ee22ecbd11. This is needed for libgo.

    libffi/ChangeLog:

            PR libffi/108682
            * configure.host: Add LoongArch support.
            * Makefile.am: Likewise.
            * Makefile.in: Regenerate.
            * src/loongarch64/ffi.c: New file.
            * src/loongarch64/ffitarget.h: New file.
            * src/loongarch64/sysv.S: New file.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libffi/108682] libffi needs to merge upstream to get LoongArch support
  2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
                   ` (11 preceding siblings ...)
  2023-08-23  6:16 ` cvs-commit at gcc dot gnu.org
@ 2023-08-23 14:12 ` xry111 at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-08-23 14:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108682

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #12 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Fixed.  If we need a ticket for Go support open a new one.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-08-23 14:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-06 10:08 [Bug libffi/108682] New: libffi needs to merge upstream to get LoongArch support robinlee.sysu at gmail dot com
2023-03-03  4:14 ` [Bug libffi/108682] " xry111 at gcc dot gnu.org
2023-03-03  4:16 ` xry111 at gcc dot gnu.org
2023-03-03  7:54 ` xry111 at gcc dot gnu.org
2023-03-03  8:33 ` schwab@linux-m68k.org
2023-03-03  8:45 ` xry111 at gcc dot gnu.org
2023-05-22  6:28 ` xry111 at gcc dot gnu.org
2023-05-22 16:34 ` ian at airs dot com
2023-05-22 16:34 ` ian at airs dot com
2023-05-23  8:17 ` xry111 at gcc dot gnu.org
2023-05-23 16:22 ` ian at airs dot com
2023-05-24  7:40 ` xry111 at gcc dot gnu.org
2023-08-23  6:16 ` cvs-commit at gcc dot gnu.org
2023-08-23 14:12 ` xry111 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).