From: Ian Lance Taylor <iant@golang.org>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
gofrontend-dev <gofrontend-dev@googlegroups.com>
Subject: libgo patch committed: Unexport FFICallbackGo; use go:linkname instead
Date: Tue, 17 Sep 2019 17:22:00 -0000 [thread overview]
Message-ID: <CAOyqgcXH9T1FCtnxSARibULDm5VfkZYN2VggJsFF3J4UrmWWPg@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 239 bytes --]
The libgo function was always intended to be internal-only, but was
exported so that C code could call it. Now that have go:linkname for
that, use it. Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2616 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 275758)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-722990deeede7801e4ed3ca5d53ce312a19fcd7a
+ff18e041624b8c23ffcd747f51e9dda945777d2a
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: libgo/go/reflect/makefunc_ffi.go
===================================================================
--- libgo/go/reflect/makefunc_ffi.go (revision 275698)
+++ libgo/go/reflect/makefunc_ffi.go (working copy)
@@ -15,19 +15,20 @@ func makeFuncFFI(cif unsafe.Pointer, imp
// The makeCIF function, implemented in the runtime package, allocates a CIF.
func makeCIF(ft *funcType) unsafe.Pointer
-// FFICallbackGo implements the Go side of the libffi callback.
-// It is exported so that C code can call it.
+// Export ffiCallbackGo so that C code in makefunc_ffi_c.c can call it.
+//go:linkname ffiCallbackGo
+
+// ffiCallbackGo implements the Go side of the libffi callback.
//
// The call chain arriving here looks like
// some_go_caller
// ->some_ffi_internals
// ->ffi_callback (in C)
-// ->FFICallbackGo
+// ->ffiCallbackGo
//
// The ffi_callback handles __go_makefunc_can_recover, and
// then passes off the data as received from ffi here.
-
-func FFICallbackGo(results unsafe.Pointer, params unsafe.Pointer, impl *makeFuncImpl) {
+func ffiCallbackGo(results unsafe.Pointer, params unsafe.Pointer, impl *makeFuncImpl) {
ftyp := impl.typ
in := make([]Value, 0, len(ftyp.in))
ap := params
Index: libgo/go/reflect/makefunc_ffi_c.c
===================================================================
--- libgo/go/reflect/makefunc_ffi_c.c (revision 275698)
+++ libgo/go/reflect/makefunc_ffi_c.c (working copy)
@@ -25,8 +25,8 @@ void makeFuncFFI(void *cif, void *impl)
function ffiCall with the pointer to the arguments, the results area,
and the closure structure. */
-extern void FFICallbackGo(void *result, void **args, ffi_go_closure *closure)
- __asm__ (GOSYM_PREFIX "reflect.FFICallbackGo");
+extern void ffiCallbackGo(void *result, void **args, ffi_go_closure *closure)
+ __asm__ (GOSYM_PREFIX "reflect.ffiCallbackGo");
extern void makefuncfficanrecover(Slice)
__asm__ (GOSYM_PREFIX "runtime.makefuncfficanrecover");
@@ -72,7 +72,7 @@ ffi_callback (ffi_cif* cif __attribute__
makefuncfficanrecover (s);
}
- FFICallbackGo(results, args, closure);
+ ffiCallbackGo(results, args, closure);
if (i < n)
makefuncreturning ();
reply other threads:[~2019-09-17 17:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOyqgcXH9T1FCtnxSARibULDm5VfkZYN2VggJsFF3J4UrmWWPg@mail.gmail.com \
--to=iant@golang.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=gofrontend-dev@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).