Hello community, here is the log from the commit of package go1.9.13479 for openSUSE:Leap:15.1:Update checked in at 2020-07-26 14:19:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.1:Update/go1.9.13479 (Old) and /work/SRC/openSUSE:Leap:15.1:Update/.go1.9.13479.new.3592 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "go1.9.13479" Sun Jul 26 14:19:58 2020 rev:1 rq:822351 version:1.9.7 Changes: -------- New Changes file: --- /dev/null 2020-07-16 02:54:20.700682797 +0200 +++ /work/SRC/openSUSE:Leap:15.1:Update/.go1.9.13479.new.3592/go1.9.changes 2020-07-26 14:20:05.238477025 +0200 @@ -0,0 +1,1763 @@ +------------------------------------------------------------------- +Mon Jun 8 08:22:07 UTC 2020 - Guillaume GARDET <guillaume.gar...@opensuse.org> + +- Ensure ARM arch is set properly - boo#1169832 + +------------------------------------------------------------------- +Fri Jan 31 12:29:31 UTC 2020 - Guillaume GARDET <guillaume.gar...@opensuse.org> + +- Drop armv6l.patch to fix build on armv6 + +------------------------------------------------------------------- +Wed Oct 23 16:13:46 UTC 2019 - Stefan Brüns <stefan.bru...@rwth-aachen.de> + +- Remove unneeded systemd BuildRequires. +- Remove specific support for Leap 42.x (EOL), treat it like SLE12 +- Add some missing dir-only markers in files section. + +------------------------------------------------------------------- +Mon Oct 21 17:26:58 UTC 2019 - Stefan Brüns <stefan.bru...@rwth-aachen.de> + +- Let RPM evaluate the go_api version compare, drop no longer required bc. +- Own the gdbinit.d directory, avoid the build dependency on gdb. + +------------------------------------------------------------------- +Sat Jun 22 09:38:30 UTC 2019 - Matwey Kornilov <matwey.korni...@gmail.com> + +- Enable %arm architecture +- Add gcc9-go.patch: bootstrap works only with gcc9 at armv7l (boo#974800) + +------------------------------------------------------------------- +Thu May 16 07:12:55 UTC 2019 - Martin Liška <mli...@suse.cz> + +- Add gcc9-rsp-clobber.patch in order to fix bsc#1121397. + +------------------------------------------------------------------- +Sat Dec 15 12:45:31 UTC 2018 - Aleksa Sarai <asa...@suse.com> + +- Make our profile.d/go.sh no longer set GOROOT=, in order to make switching + between versions no longer break. This ends up removing the need for go.sh + entirely (because GOPATH is also set automatically). boo#1119634 + +------------------------------------------------------------------- +Sun Jun 10 12:31:32 UTC 2018 - duyizhaozj...@yahoo.com + +- Update to version 1.9.7: + * go1.9.7 (released 2018/06/05) includes fixes to the go command, + and the crypto/x509, and strings packages. In particular, it adds + minimal support to the go command for the vgo transition. See the + Go 1.9.7 milestone on our issue tracker for details. +- Changes in version 1.9.6: + * go1.9.6 (released 2018/05/01) includes fixes to the compiler and + go command. See the Go 1.9.6 milestone on our issue tracker for details. +- Changes in version 1.9.5: + * go1.9.5 (released 2018/03/28) includes fixes to the compiler, go + command, and net/http/pprof package. See the Go 1.9.5 milestone + on our issue tracker for details. + + Includes fix for bsc#1081495 (CVE-2018-7187) + +------------------------------------------------------------------- +Fri Mar 2 23:30:03 UTC 2018 - fcaste...@suse.com + +- fix various issues in go trace (bsc#1085785): + * Ensure go binaries are not stripped (eg: go tools trace), this + caused some of them to misbehave + * Ensure go trace html template is shipped as part of the + installation, otherwise the web UI won't work + * Fix license of go race + +------------------------------------------------------------------- +Wed Feb 28 10:47:34 UTC 2018 - jmassaguer...@suse.com + +- update to go1.9.4 + + * go1.9.2 (released 2017/10/25) includes fixes to the compiler, + linker, runtime, documentation, go command, and the crypto/x509, + database/sql, log, and net/smtp packages. It includes a fix to a bug + introduced in Go 1.9.1 that broke go get of non-Git repositories + under certain conditions. + + * go1.9.3 (released 2018/01/22) includes fixes to the compiler, runtime, + and the database/sql, math/big, net/http, and net/url packages. + + * go1.9.4 (released 2018/02/07) includes a security fix to “go get”: + CVE-2018-6574 (bsc#1080006) + + +------------------------------------------------------------------- +Sat Feb 24 18:52:41 UTC 2018 - jmassaguer...@suse.com + +- fix bsc#1082409: Review dependencies (requires, recommends and supports) + +------------------------------------------------------------------- +Thu Dec 21 15:12:24 UTC 2017 - jmassaguer...@suse.com + +- Rename package to go1.9 + +------------------------------------------------------------------- +Thu Oct 26 13:53:05 UTC 2017 - th...@suse.de + +- Update to go1.9.2 + + go1.9.2 (released 2017/10/25) includes fixes to the compiler, + linker, runtime, documentation, go command, and the crypto/x509, + database/sql, log, and net/smtp packages. It includes a fix to a + bug introduced in Go 1.9.1 that broke go get of non-Git + repositories under certain conditions. See the Go 1.9.2 milestone + on our issue tracker for details. + +------------------------------------------------------------------- +Sat Oct 21 11:39:37 UTC 2017 - asa...@suse.com + +- Install $GOROOT/lib packages, to include upstream files such as the timezone + database. bsc#1064522 + +------------------------------------------------------------------- +Thu Oct 5 07:09:54 UTC 2017 - th...@suse.de + +- Update to go1.9.1 + + go1.9.1 (released 2017/10/04) includes two security fixes. See + the Go 1.9.1 milestone on our issue tracker for details. + + Fixes included: + + * net/smtp: fix PlainAuth to refuse to send passwords to non-TLS + servers (CVE-2017-15042, bsc#1062087) + + * cmd/go: arbitrary code execution during “go get” or “go get -d” + (CVE-2017-15041, bsc#1062085) + +------------------------------------------------------------------- +Mon Sep 18 08:52:45 UTC 2017 - th...@suse.de + +- Update to go1.9 + + There are two changes to the language: adding support for type aliases and + defining when implementations may fuse floating point operations. Most of the + changes are in the implementation of the toolchain, runtime, and libraries. As + always, the release maintains the Go 1 promise of compatibility. We expect + almost all Go programs to continue to compile and run as before. + + The release adds transparent monotonic time support, parallelizes compilation + of functions within a package, better supports test helper functions, includes + a new bit manipulation package, and has a new concurrent map type. + + Remove patches: + - fix_certificates_lookup.patch + - runtime-bump-MaxGomaxprocs.patch + +------------------------------------------------------------------- +Tue Sep 5 15:38:19 UTC 2017 - th...@suse.de + +- Fixed incorrectly ghosted files + +------------------------------------------------------------------- +Thu Aug 31 18:46:47 UTC 2017 - th...@suse.de + +- add fix-sanitizer-build-against-latest-glibc.patch which fixes + the sanitizer built against certain glibc versions + +------------------------------------------------------------------- +Wed Aug 9 07:45:47 UTC 2017 - asa...@suse.com + +- go-race: add compiler-rt TSAN binary, necessary for the race detector builds + to work. This requires building compiler-rt from source (becuase upstream Go + stores precompiled binaries in the tree, and we cannot use them). In + addition, a %check was added purely to ensure that we don't install the wrong + version of compiler-rt. boo#1052528 +- go-rpmlintrc: add some entries to address the .syso additions. + +------------------------------------------------------------------- +Fri Jul 21 18:51:29 UTC 2017 - jmassaguer...@suse.com + +- Remove ruby requirement. golang-macros are not ruby anymore, plus + this requirement should have been in the golang-packaging package + +------------------------------------------------------------------- +Fri Jul 7 10:44:28 UTC 2017 - jmassaguer...@suse.com + +- Simplify all the "ifdef suse_version" by removing versions which + have reach eol (13.* 42.1 sle11*) + +------------------------------------------------------------------- +Thu Jul 6 15:18:14 UTC 2017 - jmassaguer...@suse.com + +- Add gcc6-go.patch for sle12 and leap42.x and use binutils-gold + except for s390x/s390 + Remove gcc5-go.patch cause we use gcc6 for sle12 and leap42.x and + gcc7 for newer versions (factory) + +------------------------------------------------------------------- +Sun Jun 18 21:08:10 UTC 2017 - dmuel...@suse.com + +- build with binutils-gold on aarch64, which is hardcoded to + be used for shared linking due to bugs in BFD binutils + ++++ 1566 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:Leap:15.1:Update/.go1.9.13479.new.3592/go1.9.changes New: ---- README.SUSE _service allow-binary-only-packages.patch compiler-rt-g68e1532492f9b3fce0e9024f3c31411105965b11.tar.xz fix-sanitizer-build-against-latest-glibc.patch gcc6-go.patch gcc7-go.patch gcc9-go.patch gcc9-rsp-clobber.patch go-1.5-build-dont-reinstall-stdlibs.patch go-1.5-install-dont-reinstall-stdlibs.patch go-rpmlintrc go.gdbinit go1.9.7.src.tar.gz go1.9.changes go1.9.spec tools-packaging.patch verbose-build.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ go1.9.spec ++++++ # # spec file for package go1.9 # # Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # # nodebuginfo %define __arch_install_post export NO_BRP_STRIP_DEBUG=true # By default use go and not gccgo %define with_gccgo 0 # The fallback boostrap method via go1.4 does not work for Factory because # of a known bug with binutils 2.27 https://github.com/golang/go/issues/16906. # Leap will work but we don't have go1.4 in there. %if 0%{?suse_version} > 1320 # openSUSE Factory, Leap 15.x, SLE 15 %define with_gccgo 1 %endif # The fallback bootstrap method via go1.4 doesn't work # for aarch64 nor ppc64le because go 1.4 did not support that architecture. %ifarch aarch64 ppc64le ppc64 s390x %define with_gccgo 1 %endif # By default we don't include tsan. It's only supported on amd64. %define tsan_arch x86_64 # Go has precompiled versions of LLVM's compiler-rt inside their source code. # We cannot ship pre-compiled binaries so we have to recompile said source, # however they vendor specific commits from upstream. This value comes from # src/runtime/race/README (and we verify that it matches in check). # See boo#1052528 for more details. %define tsan_commit 68e1532492f9b3fce0e9024f3c31411105965b11 %define go_api 1.9 %ifarch ppc64 %define with_shared 0 %endif # shared library support %if "%{rpm_vercmp %{go_api} 1.5}" > "0" %if %{with_gccgo} %define with_shared 1 %else %ifarch %ix86 %arm x86_64 aarch64 %define with_shared 1 %else %define with_shared 0 %endif %endif %else %define with_shared 0 %endif Name: go1.9 Version: 1.9.7 Release: 0 Summary: A compiled, garbage-collected, concurrent programming language License: BSD-3-Clause Group: Development/Languages/Other URL: http://golang.org Source: http://golang.org/dl/go%{version}.src.tar.gz Source1: go-rpmlintrc Source4: README.SUSE Source6: go.gdbinit # We have to compile TSAN ourselves. boo#1052528 Source100: compiler-rt-g%{tsan_commit}.tar.xz # PATCH-FIX-OPENSUSE add -s flag to 'go install' (don't rebuild/install std libs) Patch1: go-1.5-build-dont-reinstall-stdlibs.patch # PATCH-FIX-OPENSUSE re-enable build binary only packages (we are binary distro) # see http://code.google.com/p/go/issues/detail?id=2775 & also issue 3268 Patch2: allow-binary-only-packages.patch #PATCH-FIX-OPENSUSE use -x verbose build output for qemu-arm builders Patch3: verbose-build.patch # PATCH-FIX-OPENSUSE BNC#776058 Patch4: go-1.5-install-dont-reinstall-stdlibs.patch # PATCH-FIX-OPENSUSE enable writing tools outside $GOROOT/pkg/tool for packaging Patch5: tools-packaging.patch # PATCH-FIX-UPSTREAM marguer...@opensuse.org - find /usr/bin/go-5 when bootstrapping with gcc5-go Patch8: gcc6-go.patch Patch9: gcc7-go.patch Patch10: gcc9-go.patch # PATCH-FIX-UPSTREAM (compiler-rt): Fix sanitizer build against latest glibc Patch100: fix-sanitizer-build-against-latest-glibc.patch Patch101: gcc9-rsp-clobber.patch BuildRequires: fdupes #BNC#818502 debug edit tool of rpm fails on i586 builds BuildRequires: rpm >= 4.11.1 Requires: gcc Requires(post): update-alternatives Requires(postun): update-alternatives Recommends: %{name}-doc = %{version} Provides: go = %{version} Provides: go-devel = go%{version} Provides: go-devel-static = go%{version} Provides: golang(API) = %{go_api} Obsoletes: go-devel < go%{version} # go-vim/emacs were separate projects starting from 1.4 Obsoletes: go-emacs <= 1.3.3 Obsoletes: go-vim <= 1.3.3 ExclusiveArch: %ix86 x86_64 %arm aarch64 ppc64 ppc64le s390x # strip will cause Go's .a archives to become invalid because strip appears to # reassemble the archive incorrectly. This is a known issue upstream # (https://github.com/golang/go/issues/17890), but we have to deal with it in # the meantime. %undefine _build_create_debug # boostrap %if %{with_gccgo} %ifnarch s390 s390x BuildRequires: binutils-gold %endif %if 0%{?suse_version} == 1315 # SLE12 or Leap 42.x BuildRequires: gcc6-go %else %ifarch %arm BuildRequires: gcc9-go %else BuildRequires: gcc7-go %endif %endif %else # no gcc-go BuildRequires: go1.4 %endif %ifarch %{tsan_arch} # Needed to compile compiler-rt/TSAN. BuildRequires: gcc-c++ %endif %description Go is an expressive, concurrent, garbage collected systems programming language that is type safe and memory safe. It has pointers but no pointer arithmetic. Go has fast builds, clean syntax, garbage collection, methods for any type, and run-time reflection. It feels like a dynamic language but has the speed and safety of a static language. %package doc Summary: Go documentation Group: Documentation/Other Requires: %{name} = %{version} Provides: go-doc = %{version} %description doc Go examples and documentation. %ifarch %{tsan_arch} # boo#1052528 %package race Summary: Go runtime race detector Group: Development/Languages/Other URL: https://compiler-rt.llvm.org/ Requires: %{name} = %{version} Supplements: %{name} = %{version} ExclusiveArch: %{tsan_arch} %description race Go runtime race detector libraries. Install this package if you wish to use the -race option, in order to detect race conditions present in your Go programs. %endif %prep %ifarch %{tsan_arch} # compiler-rt %setup -q -T -b 100 -n compiler-rt-g%{tsan_commit} %patch100 -p1 %patch101 -p1 %endif # go %setup -q -n go %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %if %{with_gccgo} %if 0%{?suse_version} == 1315 # SLE12 or Leap 42.x %patch8 -p1 %else %ifarch %arm %patch10 -p1 %else %patch9 -p1 %endif %endif %endif cp %{SOURCE4} . # setup go_arch (BSD-like scheme) %ifarch %ix86 %define go_arch 386 %endif %ifarch x86_64 %define go_arch amd64 %endif %ifarch aarch64 %define go_arch arm64 %endif %ifarch %arm %define go_arch arm %endif %ifarch ppc64 %define go_arch ppc64 %endif %ifarch ppc64le %define go_arch ppc64le %endif %ifarch s390x %define go_arch s390x %endif %build # Remove the pre-included .sysos, to avoid shipping things we didn't compile # (which is against the openSUSE guidelines for packaging). find . -type f -name '*.syso' -exec rm -vf {} \; # First, compile LLVM's TSAN, and replace the built-in with it. We can only do # this for amd64. %ifarch %{tsan_arch} pushd ../compiler-rt*/lib/tsan/go ./buildgo.sh popd cp ../compiler-rt*/lib/tsan/go/race_linux_%{go_arch}.syso src/runtime/race/race_linux_%{go_arch}.syso %endif # Now, compile Go. %if %{with_gccgo} export GOROOT_BOOTSTRAP=%{_prefix} %else export GOROOT_BOOTSTRAP=%{_libdir}/go1.4 %endif # Ensure ARM arch is set properly - boo#1169832 %ifarch armv6l armv6hl export GOARCH=arm export GOARM=6 %endif %ifarch armv7l armv7hl export GOARCH=arm export GOARM=7 %endif export GOROOT="`pwd`" export GOROOT_FINAL=%{_libdir}/go/%{go_api} export GOBIN="$GOROOT/bin" mkdir -p "$GOBIN" cd src HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash cd ../ %ifarch %{tsan_arch} # Install TSAN-friendly version of the std libraries. bin/go install -race std %endif %if %{with_shared} bin/go install -buildmode=shared -linkshared std %endif %check %ifarch %{tsan_arch} # Make sure that we have the right TSAN checked out. grep "%{tsan_commit}" src/runtime/race/README %endif %install export GOROOT="%{buildroot}%{_libdir}/go/%{go_api}" # locations for third party libraries, see README-openSUSE for info about locations. install -d %{buildroot}%{_datadir}/go/%{go_api}/contrib install -d $GOROOT/contrib/pkg/linux_%{go_arch} ln -s %{_libdir}/go/%{go_api}/contrib/pkg/ %{buildroot}%{_datadir}/go/%{go_api}/contrib/pkg install -d %{buildroot}%{_datadir}/go/%{go_api}/contrib/cmd install -d %{buildroot}%{_datadir}/go/%{go_api}/contrib/src ln -s %{_datadir}/go/%{go_api}/contrib/src/ %{buildroot}%{_libdir}/go/%{go_api}/contrib/src install -Dm644 README.SUSE $GOROOT/contrib/ ln -s %{_libdir}/go/%{go_api}/contrib/README.SUSE %{buildroot}%{_datadir}/go/%{go_api}/contrib/README.SUSE # source files for go install, godoc, etc install -d %{buildroot}%{_datadir}/go/%{go_api} for ext in *.{go,c,h,s,S,py,syso}; do find src -name ${ext} -exec install -Dm644 \{\} %{buildroot}%{_datadir}/go/%{go_api}/\{\} \; done mkdir -p $GOROOT/src for i in $(ls %{buildroot}%{_datadir}/go/%{go_api}/src);do ln -s %{_datadir}/go/%{go_api}/src/$i $GOROOT/src/$i done # add lib files that are needed (such as the timezone database). install -d $GOROOT/lib find lib -type f -exec install -D -m644 {} $GOROOT/{} \; # copy document templates, packages, obj libs and command utilities mkdir -p $GOROOT/bin # remove bootstrap rm -rf pkg/bootstrap mv pkg $GOROOT mv bin/* $GOROOT/bin mkdir -p $GOROOT/misc/trace mv misc/trace/*.html $GOROOT/misc/trace rm -f %{buildroot}%{_bindir}/{hgpatch,quietgcc} # gdbinit install -Dm644 %{SOURCE6} $GOROOT/bin/gdbinit.d/go.gdb %if "%{_lib}" == "lib64" sed -i "s/lib/lib64/" $GOROOT/bin/gdbinit.d/go.gdb sed -i "s/\$go_api/%{go_api}/" $GOROOT/bin/gdbinit.d/go.gdb %endif # update-alternatives mkdir -p %{buildroot}%{_sysconfdir}/alternatives mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_sysconfdir}/profile.d mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d touch %{buildroot}%{_sysconfdir}/alternatives/{go,gofmt,go.gdb} ln -sf %{_sysconfdir}/alternatives/go %{buildroot}%{_bindir}/go ln -sf %{_sysconfdir}/alternatives/gofmt %{buildroot}%{_bindir}/gofmt ln -sf %{_sysconfdir}/alternatives/go.gdb %{buildroot}%{_sysconfdir}/gdbinit.d/go.gdb # documentation and examples # fix documetation permissions (rpmlint warning) find doc/ misc/ -type f -exec chmod 0644 '{}' \; # remove unwanted arch-dependant binaries (rpmlint warning) rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8} # prepare go-doc mkdir -p %{buildroot}%{_docdir}/go/%{go_api} cp -r AUTHORS CONTRIBUTORS CONTRIBUTING.md LICENSE PATENTS README.md README.SUSE %{buildroot}%{_docdir}/go/%{go_api} cp -r doc/* %{buildroot}%{_docdir}/go/%{go_api} %fdupes -s %{buildroot}%{_prefix} %post update-alternatives \ --install %{_bindir}/go go %{_libdir}/go/%{go_api}/bin/go 30 \ --slave %{_bindir}/gofmt gofmt %{_libdir}/go/%{go_api}/bin/gofmt \ --slave %{_sysconfdir}/gdbinit.d/go.gdb go.gdb %{_libdir}/go/%{go_api}/bin/gdbinit.d/go.gdb \ %postun if [ $1 -eq 0 ] ; then update-alternatives --remove go %{_libdir}/go/%{go_api}/bin/go fi %files %defattr(-,root,root,-) %{_bindir}/go %{_bindir}/gofmt %dir %{_libdir}/go %{_libdir}/go/%{go_api} %dir %{_datadir}/go %{_datadir}/go/%{go_api} %dir %{_sysconfdir}/gdbinit.d/ %config %{_sysconfdir}/gdbinit.d/go.gdb %ghost %{_sysconfdir}/alternatives/go %ghost %{_sysconfdir}/alternatives/gofmt %ghost %{_sysconfdir}/alternatives/go.gdb %dir %{_docdir}/go %dir %{_docdir}/go/%{go_api} %doc %{_docdir}/go/%{go_api}/AUTHORS %doc %{_docdir}/go/%{go_api}/CONTRIBUTORS %doc %{_docdir}/go/%{go_api}/CONTRIBUTING.md %license %{_docdir}/go/%{go_api}/LICENSE %doc %{_docdir}/go/%{go_api}/PATENTS %doc %{_docdir}/go/%{go_api}/README.md %doc %{_docdir}/go/%{go_api}/README.SUSE # We don't include TSAN in the main Go package. %ifarch %{tsan_arch} %exclude %{_datadir}/go/%{go_api}/src/runtime/race/race_linux_%{go_arch}.syso %endif %files doc %defattr(-,root,root,-) %doc %{_docdir}/go/%{go_api}/codewalk %doc %{_docdir}/go/%{go_api}/articles %doc %{_docdir}/go/%{go_api}/progs %doc %{_docdir}/go/%{go_api}/play %doc %{_docdir}/go/%{go_api}/gopher %doc %{_docdir}/go/%{go_api}/devel %doc %{_docdir}/go/%{go_api}/editors %doc %{_docdir}/go/%{go_api}/*.html %doc %{_docdir}/go/%{go_api}/*.css %doc %{_docdir}/go/%{go_api}/*.png %ifarch %{tsan_arch} %files race %defattr(-,root,root,-) %{_datadir}/go/%{go_api}/src/runtime/race/race_linux_%{go_arch}.syso %endif %changelog ++++++ README.SUSE ++++++ Updated: 05.05.2012 Authors: Graham Anderson, <gra...@andtech.eu> PROJECT DETAILS --------------- OBS: https://build.opensuse.org/project/show?project=devel:languages:go Maintainers: Sascha Peilicke (saschpe), Graham Anderson (andtecheu) Wiki: http://en.opensuse.org/Go http://en.opensuse.org/openSUSE:Packaging_Go GENERAL NOTES ------------- Go toolchain environmental variables are configured via go.sh, which is installed to /etc/profile.d/go.sh Packaging guidelines and an RPM spec file recipe for packaging third party Go libraries can be found on the openSUSE wiki: http://en.opensuse.org/openSUSE:Packaging_Go The openSUSE go package uses the standard Go distribution toolchain, with a a small patchset to modify a few of the toolchain commands to suit our environment and packaging needs. This means that many of the standard go toolchain commands are not inside a users PATH, but rather are invoked and used via the "go" command. Should you wish to script or manually use the commands, the install location on a 64 bit system is /usr/lib64/go/pkg/tool/linux_amd64 The "go" tool, the "godoc" document server are inside a users PATH. We currently don't support the gccgo implementation, this is not for any other reason than contributer and maintainer time constraints. GO DOCUMENTATION ---------------- As of yet, there are no man pages for the standard Go distribution toolchain, please see the documentation provided by the "godoc" command. Man pages are slated to be included in the release in future. One of the diffs from the maintained patchset adds the distro specific doc and source file locations of the *-doc RPM packages to the virtual filesystem of the "godoc" documentation server. That is to say, as long as packages follow the Go packaging guidelines, API and other documentation should always be available via the godoc server if the packages "doc" RPM is installed. PACKAGE INSTALL LOCATIONS ------------------------- Go standard library packages are installed to a location in $GOROOT, which is defined as /usr/lib64/go on 64bit systems. Third party package binaries are installed to the default system wide $GOPATH entry. On 64bit systems the location /usr/lib64/go/contrib is used. This is specified in the macros.go RPM macro definition file that is part of the main Go package and is used for packaging most third party Go libraries. The reasons binary packages are installed to a GOPATH entry instead of GOROOT are mainly to do with how the Go toolchain prioritises and behaves with packages installed to the same location as the Go std library. By installing third party packages to a system-wide GOPATH entry location, we can ensure that no packages clobber the standard library namespace or file tree. Additionally we can support binary only packages, which as of Go 1.1 will only be supported outside of the $GOROOT. There are additional benefits to this location; such as allowing users and developers to prioritise linking from their own user defined GOPATH, which defaults to $HOME/go configured via /etc/profile.d/go.sh config. This has particular benefit for development workflows. For Go 1.1 and beyond, building and linking with binary only pacakges will only be supported with the following caveat. Package source code must not exist in the same GOPATH segment as the binary package .a archive file. If both the binary archive (.a) and the package source are installed to the same GOPATH segment, then the "go build" or "go install" command will prioritise building the software using package sources before using package binary archives. A side effect of this is that is actually possible to have source code only third party packages. To summarise the priority of binary package linking and building: 1. Any source files or binary packages in $GOROOT are considered first. Any binary packages in $GOROOT that are considered "stale" by the build tools are ignored in favour of the package source. 2. $GOPATH is considered next for import statements. GOPATH is a colon delimited list of paths. GOPATH segments are examined by the build tools in a FIFO manner, left to right. Both a system wide and a user GOPATH segment are configured by default, the user GOPATH segment takes priority over the system segment to allow flexibility for development workflows. The default user GOPATH is: GOPATH=$HOME/go:$GOROOT/contrib The default root user GOPATH is: GOPATH=$GOROOT/contrib 3. For Go < 1.1, If both the source and binary archive is available for a package import in the same GOPATH segment, the binary archive will take precedence and will be linked during compilation. For Go >= 1.1 If the package source is avaiable in the GOPATH segment, it will always be used in preference to the binary ++++++ _service ++++++ <services> <service name="tar_scm" mode="disabled"> <param name="url">https://git.llvm.org/git/compiler-rt.git</param> <param name="scm">git</param> <param name="exclude">.git</param> <!-- [boo#1052528] Always make sure this is kept up to date with src/runtime/race/README. --> <param name="versionformat">g%H</param> <param name="revision">68e1532492f9b3fce0e9024f3c31411105965b11</param> </service> <service name="download_files" mode="disabled"> <param name="changesgenerate">enable</param> </service> <service name="recompress" mode="disabled"> <param name="file">compiler-rt-*.tar</param> <param name="compression">xz</param> </service> </services> ++++++ allow-binary-only-packages.patch ++++++ Index: go/src/cmd/go/internal/load/pkg.go =================================================================== --- go.orig/src/cmd/go/internal/load/pkg.go +++ go/src/cmd/go/internal/load/pkg.go @@ -414,7 +414,7 @@ func LoadImport(path, srcDir string, par // Not vendoring, or we already found the vendored path. buildMode |= build.IgnoreVendor } - bp, err := cfg.BuildContext.Import(path, srcDir, buildMode) + bp, err := cfg.BuildContext.Import(path, srcDir, build.AllowBinary|buildMode) bp.ImportPath = importPath if cfg.GOBIN != "" { bp.BinDir = cfg.GOBIN ++++++ fix-sanitizer-build-against-latest-glibc.patch ++++++ >From 8a5e425a68de4d2c80ff00a97bbcb3722a4716da Mon Sep 17 00:00:00 2001 From: Kostya Serebryany <k...@google.com> Date: Thu, 13 Jul 2017 21:59:01 +0000 Subject: [PATCH] Fix sanitizer build against latest glibc Summary: libsanitizer doesn't build against latest glibc anymore, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81066 for details. One of the changes is that stack_t changed from typedef struct sigaltstack { ... } stack_t; to typedef struct { ... } stack_t; for conformance reasons. And the other change is that the glibc internal __need_res_state macro is now ignored, so when doing ``` #define __need_res_state #include <resolv.h> ``` the effect is now the same as just ``` #include <resolv.h> ``` and thus one doesn't get just the ``` struct __res_state { ... }; ``` definition, but newly also the ``` extern struct __res_state *__res_state(void) __attribute__ ((__const__)); ``` prototype. So __res_state is no longer a type, but a function. Reviewers: kcc, ygribov Reviewed By: kcc Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D35246 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307969 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/sanitizer_common/sanitizer_linux.cc | 3 +-- lib/sanitizer_common/sanitizer_linux.h | 4 +--- lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +- lib/tsan/rtl/tsan_platform_linux.cc | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc index a79a2a155..8c3c1e5d6 100644 --- a/lib/sanitizer_common/sanitizer_linux.cc +++ b/lib/sanitizer_common/sanitizer_linux.cc @@ -629,8 +629,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) { } #endif -uptr internal_sigaltstack(const struct sigaltstack *ss, - struct sigaltstack *oss) { +uptr internal_sigaltstack(const void *ss, void *oss) { return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); } diff --git a/lib/sanitizer_common/sanitizer_linux.h b/lib/sanitizer_common/sanitizer_linux.h index ee336f7dd..11cad6b80 100644 --- a/lib/sanitizer_common/sanitizer_linux.h +++ b/lib/sanitizer_common/sanitizer_linux.h @@ -21,7 +21,6 @@ #include "sanitizer_platform_limits_posix.h" struct link_map; // Opaque type returned by dlopen(). -struct sigaltstack; namespace __sanitizer { // Dirent structure for getdents(). Note that this structure is different from @@ -30,8 +29,7 @@ struct linux_dirent; // Syscall wrappers. uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); -uptr internal_sigaltstack(const struct sigaltstack* ss, - struct sigaltstack* oss); +uptr internal_sigaltstack(const void* ss, void* oss); uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset); diff --git a/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc index 03f73ae88..d7fa5f645 100644 --- a/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +++ b/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc @@ -287,7 +287,7 @@ static int TracerThread(void* argument) { // Alternate stack for signal handling. InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize); - struct sigaltstack handler_stack; + stack_t handler_stack; internal_memset(&handler_stack, 0, sizeof(handler_stack)); handler_stack.ss_sp = handler_stack_memory.data(); handler_stack.ss_size = kHandlerStackSize; diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc index 0ba01babe..ead1e5704 100644 --- a/lib/tsan/rtl/tsan_platform_linux.cc +++ b/lib/tsan/rtl/tsan_platform_linux.cc @@ -286,7 +286,7 @@ void InitializePlatform() { int ExtractResolvFDs(void *state, int *fds, int nfd) { #if SANITIZER_LINUX && !SANITIZER_ANDROID int cnt = 0; - __res_state *statp = (__res_state*)state; + struct __res_state *statp = (struct __res_state*)state; for (int i = 0; i < MAXNS && cnt < nfd; i++) { if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) fds[cnt++] = statp->_u._ext.nssocks[i]; ++++++ gcc6-go.patch ++++++ Index: go/src/cmd/dist/buildtool.go =================================================================== --- go.orig/src/cmd/dist/buildtool.go +++ go/src/cmd/dist/buildtool.go @@ -164,7 +164,7 @@ func bootstrapBuildTools() { // Use the math_big_pure_go build tag to disable the assembly in math/big // which may contain unsupported instructions. cmd := []string{ - pathf("%s/bin/go", goroot_bootstrap), + pathf("%s/bin/go-6", goroot_bootstrap), "install", "-gcflags=-l", "-tags=math_big_pure_go", Index: go/src/make.bash =================================================================== --- go.orig/src/make.bash +++ go/src/make.bash @@ -41,7 +41,7 @@ # This is used by cgo. Default is CC. # # CXX_FOR_TARGET: Command line to run to compile C++ code for GOARCH. -# This is used by cgo. Default is CXX, or, if that is not set, +# This is used by cgo. Default is CXX, or, if that is not set, # "g++" or "clang++". # # FC: Command line to run to compile Fortran code for GOARCH. @@ -120,8 +120,8 @@ echo '##### Building Go bootstrap tool.' echo cmd/dist export GOROOT="$(cd .. && pwd)" GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4} -if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then - echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2 +if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-6" ]; then + echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-6." >&2 echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 exit 1 fi @@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; exit 1 fi rm -f cmd/dist/dist -GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist +GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go-6" build -o cmd/dist/dist ./cmd/dist # -e doesn't propagate out of eval, so check success by hand. eval $(./cmd/dist/dist env -p || echo FAIL=true) Index: go/src/make.rc =================================================================== --- go.orig/src/make.rc +++ go/src/make.rc @@ -46,13 +46,13 @@ echo cmd/dist GOROOT = `{cd .. && pwd} if(! ~ $#GOROOT_BOOTSTRAP 1) GOROOT_BOOTSTRAP = $home/go1.4 -if(! test -x $GOROOT_BOOTSTRAP/bin/go){ - echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2] +if(! test -x $GOROOT_BOOTSTRAP/bin/go-6){ + echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go-6.' >[1=2] echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2] exit bootstrap } rm -f cmd/dist/dist -GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist +GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go-6 build -o cmd/dist/dist ./cmd/dist eval `{./cmd/dist/dist env -9} echo ++++++ gcc7-go.patch ++++++ Index: go/src/cmd/dist/buildtool.go =================================================================== --- go.orig/src/cmd/dist/buildtool.go +++ go/src/cmd/dist/buildtool.go @@ -164,7 +164,7 @@ func bootstrapBuildTools() { // Use the math_big_pure_go build tag to disable the assembly in math/big // which may contain unsupported instructions. cmd := []string{ - pathf("%s/bin/go", goroot_bootstrap), + pathf("%s/bin/go-7", goroot_bootstrap), "install", "-gcflags=-l", "-tags=math_big_pure_go", Index: go/src/make.bash =================================================================== --- go.orig/src/make.bash +++ go/src/make.bash @@ -41,7 +41,7 @@ # This is used by cgo. Default is CC. # # CXX_FOR_TARGET: Command line to run to compile C++ code for GOARCH. -# This is used by cgo. Default is CXX, or, if that is not set, +# This is used by cgo. Default is CXX, or, if that is not set, # "g++" or "clang++". # # FC: Command line to run to compile Fortran code for GOARCH. @@ -120,8 +120,8 @@ echo '##### Building Go bootstrap tool.' echo cmd/dist export GOROOT="$(cd .. && pwd)" GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4} -if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then - echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2 +if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-7" ]; then + echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-7." >&2 echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 exit 1 fi @@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; exit 1 fi rm -f cmd/dist/dist -GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist +GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go-7" build -o cmd/dist/dist ./cmd/dist # -e doesn't propagate out of eval, so check success by hand. eval $(./cmd/dist/dist env -p || echo FAIL=true) Index: go/src/make.rc =================================================================== --- go.orig/src/make.rc +++ go/src/make.rc @@ -46,13 +46,13 @@ echo cmd/dist GOROOT = `{cd .. && pwd} if(! ~ $#GOROOT_BOOTSTRAP 1) GOROOT_BOOTSTRAP = $home/go1.4 -if(! test -x $GOROOT_BOOTSTRAP/bin/go){ - echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2] +if(! test -x $GOROOT_BOOTSTRAP/bin/go-7){ + echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go-7.' >[1=2] echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2] exit bootstrap } rm -f cmd/dist/dist -GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist +GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go-7 build -o cmd/dist/dist ./cmd/dist eval `{./cmd/dist/dist env -9} echo ++++++ gcc9-go.patch ++++++ Index: go/src/cmd/dist/buildtool.go =================================================================== --- go.orig/src/cmd/dist/buildtool.go +++ go/src/cmd/dist/buildtool.go @@ -164,7 +164,7 @@ func bootstrapBuildTools() { // Use the math_big_pure_go build tag to disable the assembly in math/big // which may contain unsupported instructions. cmd := []string{ - pathf("%s/bin/go", goroot_bootstrap), + pathf("%s/bin/go-9", goroot_bootstrap), "install", "-gcflags=-l", "-tags=math_big_pure_go", Index: go/src/make.bash =================================================================== --- go.orig/src/make.bash +++ go/src/make.bash @@ -41,7 +41,7 @@ # This is used by cgo. Default is CC. # # CXX_FOR_TARGET: Command line to run to compile C++ code for GOARCH. -# This is used by cgo. Default is CXX, or, if that is not set, +# This is used by cgo. Default is CXX, or, if that is not set, # "g++" or "clang++". # # FC: Command line to run to compile Fortran code for GOARCH. @@ -120,8 +120,8 @@ echo '##### Building Go bootstrap tool.' echo cmd/dist export GOROOT="$(cd .. && pwd)" GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4} -if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then - echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2 +if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-9" ]; then + echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-9." >&2 echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 exit 1 fi @@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; exit 1 fi rm -f cmd/dist/dist -GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist +GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go-9" build -o cmd/dist/dist ./cmd/dist # -e doesn't propagate out of eval, so check success by hand. eval $(./cmd/dist/dist env -p || echo FAIL=true) Index: go/src/make.rc =================================================================== --- go.orig/src/make.rc +++ go/src/make.rc @@ -46,13 +46,13 @@ echo cmd/dist GOROOT = `{cd .. && pwd} if(! ~ $#GOROOT_BOOTSTRAP 1) GOROOT_BOOTSTRAP = $home/go1.4 -if(! test -x $GOROOT_BOOTSTRAP/bin/go){ - echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2] +if(! test -x $GOROOT_BOOTSTRAP/bin/go-9){ + echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go-9.' >[1=2] echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2] exit bootstrap } rm -f cmd/dist/dist -GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist +GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go-9 build -o cmd/dist/dist ./cmd/dist eval `{./cmd/dist/dist env -9} echo ++++++ gcc9-rsp-clobber.patch ++++++ --- a/lib/sanitizer_common/sanitizer_linux.cc 2018-01-11 23:53:30.000000000 +0100 +++ b/lib/sanitizer_common/sanitizer_linux.cc.new 2019-03-10 21:23:23.824919781 +0100 @@ -1243,7 +1243,7 @@ "d"(parent_tidptr), "r"(r8), "r"(r10) - : "rsp", "memory", "r11", "rcx"); + : "memory", "r11", "rcx"); return res; } #elif defined(__mips__) ++++++ go-1.5-build-dont-reinstall-stdlibs.patch ++++++ Index: go/src/cmd/go/internal/work/build.go =================================================================== --- go.orig/src/cmd/go/internal/work/build.go +++ go/src/cmd/go/internal/work/build.go @@ -203,6 +203,8 @@ func init() { // addBuildFlags adds the flags common to the build, clean, get, // install, list, run, and test commands. func AddBuildFlags(cmd *base.Command) { + // OPENSUSE + cmd.Flag.BoolVar(&cfg.BuildS, "s", false, "") cmd.Flag.BoolVar(&cfg.BuildA, "a", false, "") cmd.Flag.BoolVar(&cfg.BuildN, "n", false, "") cmd.Flag.IntVar(&cfg.BuildP, "p", cfg.BuildP, "") @@ -1571,6 +1573,11 @@ func (b *Builder) linkShared(a *Action) // BuildInstallFunc is the action for installing a single package or executable. func BuildInstallFunc(b *Builder, a *Action) (err error) { + // OPENSUSE + if cfg.BuildS && (a.Package.Standard || a.Package.ImportPath == "cmd/cgo") { + return nil + } + defer func() { if err != nil && err != errPrintedOutput { err = fmt.Errorf("go install %s: %v", a.Package.ImportPath, err) Index: go/src/cmd/go/internal/cfg/cfg.go =================================================================== --- go.orig/src/cmd/go/internal/cfg/cfg.go +++ go/src/cmd/go/internal/cfg/cfg.go @@ -18,6 +18,7 @@ import ( // These are general "build flags" used by build and other commands. var ( + BuildS bool // OPENSUSE -s (for packaging only) BuildA bool // -a flag BuildBuildmode string // -buildmode flag BuildContext = build.Default ++++++ go-1.5-install-dont-reinstall-stdlibs.patch ++++++ diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index 07aa3ff..3f4836b 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -1457,6 +1457,13 @@ func isStale(p *Package) (bool, string) { return false, "standard package in Go release distribution" } + // openSUSE bnc#776058 + // Only root user can reinstall a std library from a dependancy, all other + // users should *never* have to do this. + if os.Getuid() != 0 && p.Standard { + return false, "only root can reinstall a std library from a dependency" + } + // Time-based staleness. built := fi.ModTime() ++++++ go-rpmlintrc ++++++ addFilter("binaryinfo-readelf-failed") # go binaries are suposedly ELF-compliant addFilter("statically-linked-binary") # go doesn't yet support dynamic linking # .syso files are special. Note that while they are architecture-dependent, # they are named to avoid conflicts (and we make sure of that in the RPM # through go_arch). addFilter("unstripped-binary-or-object.*\.syso$") addFilter("arch-dependent-file-in-usr-share.*\.syso$") addFilter("W: position-independent-executable-suggested") ++++++ go.gdbinit ++++++ add-auto-load-safe-path /usr/lib/go/$go_api/src/runtime/runtime-gdb.py ++++++ tools-packaging.patch ++++++ Index: go/src/cmd/go/internal/load/pkg.go =================================================================== --- go.orig/src/cmd/go/internal/load/pkg.go +++ go/src/cmd/go/internal/load/pkg.go @@ -912,7 +912,13 @@ func (p *Package) load(stk *ImportStack, if GoTools[p.ImportPath] == ToTool { // This is for 'go tool'. // Override all the usual logic and force it into the tool directory. - p.Internal.Target = filepath.Join(cfg.GOROOTpkg, "tool", full) + // If GOROOT_TARGET is set, then write to it for packaging purpose + gorootTarget := os.Getenv("GOROOT_TARGET") + if gorootTarget == "" { + p.Internal.Target = filepath.Join(cfg.GOROOTpkg, "tool", full) + } else { + p.Internal.Target = filepath.Join(gorootTarget, "pkg/tool", full) + } } if p.Internal.Target != "" && cfg.BuildContext.GOOS == "windows" { p.Internal.Target += ".exe" ++++++ verbose-build.patch ++++++ Index: go/src/make.bash =================================================================== --- go.orig/src/make.bash +++ go/src/make.bash @@ -167,7 +167,7 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however, # use the host compiler, CC, from `cmd/dist/dist env` instead. CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \ - "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd + "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd echo fi @@ -175,7 +175,7 @@ echo "##### Building packages and comman old_bin_files=$(cd $GOROOT/bin && echo *) -CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd +CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd # Check that there are no new files in $GOROOT/bin other than go and gofmt # and $GOOS_$GOARCH (a directory used when cross-compiling).