Go patch committed: Support -fgo-importcfg

1 view
Skip to first unread message

Ian Lance Taylor

unread,
Jun 26, 2023, 12:58:35 PM6/26/23
to gcc-patches, gofrontend-dev
The gc Go compiler has a -importcfg option that takes a file that
provides a mapping from import paths to the files that satisfy those
imports. This is used by the go build tool to let the compiler read
imported packages directly out of the build cache. Without this
option the go build tool has to construct a tree of files to provide
the same mapping in the file system.

This patch to the Go frontend adds a -fgo-importcfg option that does
the same thing. The go build tool already uses this option if it is
supported; with this patch, it is supported.

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

Ian

* lang.opt (fgo-importcfg): New option.
* go-c.h (struct go_create_gogo_args): Add importcfg field.
* go-lang.cc (go_importcfg): New static variable.
(go_langhook_init): Set args.importcfg.
(go_langhook_handle_option): Handle -fgo-importcfg.
* gccgo.texi (Invoking gccgo): Document -fgo-importcfg.
patch.txt
Reply all
Reply to author
Forward
0 new messages