This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Include transitive imports in type descriptor list


This patch to the Go frontend by Cherry Zhang includes transitive
imports in the type descriptor list.

In https://golang.org/cl/179598, we were using Gogo::packages_, when
compiling the main package, as the list of packages of which we need
to register the type descriptors.  This is not complete.  It only
includes main's direct import and one-level indirect imports.  It does
not include all the packages transitively imported.

To fix that, we need to track all the transitive imports.  We have
almost already done that, for init functions.  However, there may be
packages that don't need init functions but do need to register type
descriptors.  For them, we add a dummy init function to its export
data.  So when we compile the main package we will see all the
transitive imports.  The dummy init functions are not real functions
and are not called.

This fixes https://golang.org/issue/32901.

Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]