From 7ded3472ae5e5eec41909fcefc911e1092479f9b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor <ian@gcc.gnu.org> Date: Wed, 17 May 2017 20:16:13 +0000 Subject: [PATCH] libgo: add "vendor" to pkgpath for vendored standard packages Ensure that the packages vendored into the standard library do not have the same pkgpath as the actual packages. If we don't, attempts to build and test the actual packages will get confused. The specific error I was seeing was import loops, causing some of the packages to fail to get initialized, causing an obscure run time crash. Reviewed-on: https://go-review.googlesource.com/43610 From-SVN: r248168 --- gcc/go/gofrontend/MERGE | 2 +- libgo/Makefile.am | 2 +- libgo/Makefile.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index b1882af5a7f5..f7e19d32bd6c 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -924a1fcc5658a5d66f5015921d7258e3a77519bc +ba68a42618d1e8516e38da093d3af731d7fd4f06 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/Makefile.am b/libgo/Makefile.am index d18f1b89a31c..8bbd43771447 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -910,7 +910,7 @@ BUILDDEPS = \ BUILDPACKAGE = \ $(MKDIR_P) $(@D); \ files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \ - $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files + $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//' -e 's|golang_org|vendor/golang_org|'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files # How to build a .gox file from a .lo file. # Matching .o file can either be in the same directory as the .lo (non-PIC diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 0a0603876846..cbdd37998369 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -1063,7 +1063,7 @@ BUILDDEPS = \ BUILDPACKAGE = \ $(MKDIR_P) $(@D); \ files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \ - $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files + $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//' -e 's|golang_org|vendor/golang_org|'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files # How to build a .gox file from a .lo file. -- GitLab