1
0
mirror of https://github.com/golang/go synced 2024-11-06 13:36:12 -07:00
go/src/internal
Matthew Dempsky ab8d7dd75e cmd/compile: set LocalPkg.Path to -p flag
Since CL 391014, cmd/compile now requires the -p flag to be set the
build system. This CL changes it to initialize LocalPkg.Path to the
provided path, rather than relying on writing out `"".` into object
files and expecting cmd/link to substitute them.

However, this actually involved a rather long tail of fixes. Many have
already been submitted, but a few notable ones that have to land
simultaneously with changing LocalPkg:

1. When compiling package runtime, there are really two "runtime"
packages: types.LocalPkg (the source package itself) and
ir.Pkgs.Runtime (the compiler's internal representation, for synthetic
references). Previously, these ended up creating separate link
symbols (`"".xxx` and `runtime.xxx`, respectively), but now they both
end up as `runtime.xxx`, which causes lsym collisions (notably
inittask and funcsyms).

2. test/codegen tests need to be updated to expect symbols to be named
`command-line-arguments.xxx` rather than `"".foo`.

3. The issue20014 test case is sensitive to the sort order of field
tracking symbols. In particular, the local package now sorts to its
natural place in the list, rather than to the front.

Thanks to David Chase for helping track down all of the fixes needed
for this CL.

Updates #51734.

Change-Id: Iba3041cf7ad967d18c6e17922fa06ba11798b565
Reviewed-on: https://go-review.googlesource.com/c/go/+/393715
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-05-16 18:19:47 +00:00
..
abi internal/abi: define riscv64 register ABI constants 2022-03-26 01:27:54 +00:00
buildcfg buildcfg: disable regabiwrappers along with regabiargs 2022-05-13 18:21:52 +00:00
bytealg internal/bytealg: optimize index function for ppc64le/power9 2022-05-09 12:02:02 +00:00
cfg cmd/go: set go.work path using GOWORK, and remove -workfile flag 2022-02-16 15:58:47 +00:00
cpu internal/cpu: report CPU if known on PPC64 2022-05-10 20:05:43 +00:00
diff internal/diff: add, replacing cmd/internal/diff 2022-03-18 16:56:29 +00:00
fmtsort all: gofmt main repo 2022-04-11 16:34:30 +00:00
fuzz internal/fuzz: minimization should not reduce coverage 2022-03-10 23:06:14 +00:00
goarch all: separate doc comment from //go: directives 2022-04-05 17:54:15 +00:00
godebug net/netip: add new IP address package 2021-11-02 01:28:01 +00:00
goexperiment internal/goexperiment: add GOEXPERIMENT=boringcrypto 2022-04-04 21:06:49 +00:00
goos all: separate doc comment from //go: directives 2022-04-05 17:54:15 +00:00
goroot all: use os/exec instead of internal/execabs 2022-05-02 17:49:12 +00:00
goversion internal/goversion: update Version to 1.19 2022-02-28 22:24:58 +00:00
intern all: separate doc comment from //go: directives 2022-04-05 17:54:15 +00:00
itoa all: add internal/itoa package 2021-03-14 17:56:50 +00:00
lazyregexp
lazytemplate all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
nettrace all: gofmt main repo 2022-04-11 16:34:30 +00:00
obscuretestdata all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTemp 2020-12-09 19:12:23 +00:00
oserror
pkgbits internal/pkgbits: add fingerprints to unified IR export format 2022-03-28 19:58:45 +00:00
poll internal/poll, net, syscall: use accept4 on solaris 2022-05-03 14:38:32 +00:00
profile all: gofmt main repo 2022-04-11 16:34:30 +00:00
race all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
reflectlite cmd/compile: set LocalPkg.Path to -p flag 2022-05-16 18:19:47 +00:00
singleflight all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
syscall all: gofmt main repo 2022-04-11 16:34:30 +00:00
sysinfo testing: print cpu type as label for benchmarks 2020-10-20 21:30:18 +00:00
testenv all: replace `` and '' with “ (U+201C) and ” (U+201D) in doc comments 2022-04-05 17:52:29 +00:00
testlog
trace runtime: add CPU samples to execution trace 2022-05-03 20:49:46 +00:00
txtar all: gofmt main repo 2022-04-11 16:34:30 +00:00
unsafeheader all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
xcoff