Hi Ian,

> This patch to the Go frontend and libgo changes the name mangling
> convention.  The previous convention (which was actually the second
> one) turned out to be ambiguous when the path to a package contained a
> dot; this is a common case, as many package paths are of the form
> "github.com/name/package".  The previous convention also did not
> support package paths that start with a digit, which is less common
> but does occur (https://golang.org/issue/41862).
>
> This patch rewrites and somewhat simplifies the naming convention.
> Now dot is used only as a separator character and for special names.
> Actual name mangling, for representing Unicode characters and other
> non-ASCII alphanumerics, is now done with an underscore.  This has the
> advantage of being simpler, in that it avoids the overloading that the
> previous convention applied to dot.  It has the disadvantage that
> mangled symbol names look somewhat like valid Go names, since valid Go
> names can of course contain underscore.  Still, it seems like the best
> choice.
>
> This patch increments the libgo major version number, since many
> symbol names have changed.
>
> Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
> to mainline.

this patch broke Solaris bootstrap: linking in gotools fails with

Undefined                       first referenced
 symbol                             in file
log_1syslog.syslog__c               ../i386-pc-solaris2.11/libgo/.libs/libgo.so
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:829: buildid] Error 1

The following patch fixed this for me:

diff --git a/libgo/go/log/syslog/syslog_c.c b/libgo/go/log/syslog/syslog_c.c
--- a/libgo/go/log/syslog/syslog_c.c
+++ b/libgo/go/log/syslog/syslog_c.c
@@ -12,7 +12,7 @@
    can't represent a C varargs function in Go.  */
 
 void syslog_c(intgo, const char*)
-  __asm__ (GOSYM_PREFIX "log_1syslog.syslog_c");
+  __asm__ (GOSYM_PREFIX "log_1syslog.syslog__c");
 
 void
 syslog_c (intgo priority, const char *msg)
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to