Commit Graph

29 Commits

Author SHA1 Message Date
Tianling Shen 32a22201db golang: Enable loongarch64 for Go compiler and packages
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-09 16:15:50 +08:00
Jeffery To a80af7e443
golang: Update to 1.21.0, remove patch
Upstream has updated the Go compiler to not use gold when building for
arm, and is waiting for a fix to binutils (released in 2.41) before
doing the same for aarch64.[1]

Based on the above, it does not appear that
https://github.com/golang/go/pull/49748 will be merged. This removes the
patch from that pull request.

[1]: https://github.com/golang/go/issues/22040

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-08-15 11:57:28 +08:00
Jeffery To 8000a7f769
golang: Update to 1.20.6
Includes fix for CVE-2023-29406 (net/http: insufficient sanitization of
Host header).

This also updates the copyright information for various Go packaging
files.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-07-17 15:13:00 +08:00
Jeffery To 3906e54c08
golang: Enable riscv64 for Go compiler and packages
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-06-04 01:08:00 +08:00
Jeffery To 8711653f1e
golang: Update to 1.20.2, refresh patch
Includes fixes for:

* 1.20.1:
  * CVE-2022-41722: path/filepath: path traversal in filepath.Clean on
    Windows
  * CVE-2022-41723: net/http: avoid quadratic complexity in HPACK
    decoding
  * CVE-2022-41724: crypto/tls: large handshake records may cause panics
  * CVE-2022-41725: net/http, mime/multipart: denial of service from
    excessive resource consumption

* 1.20.2:
  * CVE-2023-24532: crypto/elliptic: specific unreduced P-256 scalars
    produce incorrect results

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-03-20 14:43:52 +08:00
Jeffery To 8677ed11e3
golang: Update to 1.19.7
Includes fix for CVE-2023-2453 (crypto/elliptic: specific unreduced
P-256 scalars produce incorrect results).

This also includes makefile updates for Go 1.19.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-03-14 14:23:35 +08:00
Jeffery To 478666b00b golang: Update to 1.18, update patch
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-03-28 19:42:59 -07:00
Jeffery To d0aab6b8bc
golang: Update to 1.17
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-08-23 00:37:25 +08:00
Jeffery To dc587eccb7
golang: Update to 1.16
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-02-22 17:01:56 +08:00
Jeffery To 0a4d40b37e
golang: Fix vars not passed when calling cache_cleanup
Fixes https://github.com/openwrt/packages/issues/13674.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-16 17:38:17 +08:00
Jeffery To b70fb40c11
golang: Move build cache into $(TMP_DIR)
This changes the default build cache directory from $(TOPDIR)/.go-build
to $(TMP_DIR)/go-build, so that the cache directory is ignored by git
and is removed by "make dirclean".

This does not move/remove a build cache directory in the previous
location; it will need to be removed manually.

Fixes https://github.com/openwrt/packages/issues/13675.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-16 17:13:42 +08:00
Jeffery To d5dc30fe80
golang: Add option to enable Spectre mitigations
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:34:41 +08:00
Jeffery To 2d22a629f5
golang: Move package scripts into golang-build.sh
This also adds GO_PKG_INSTALL_BIN_PATH which determines the path where
binaries are installed by GoPackage/Package/Install/Bin (this was
previously hard-coded to /usr/bin).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:34:40 +08:00
Jeffery To 9074dbd917
golang: Share build cache across package builds
This also adds a config option GOLANG_BUILD_CACHE_DIR to customize the
location of the build cache directory.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:28:06 +08:00
Jeffery To 3dd55b504c
golang: Move module cache into DL_DIR
This also adds a config option GOLANG_MOD_CACHE_WORLD_READABLE; if
enabled, chmod is run after a Go package build to make all
files/directories in the module cache world-readable.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-06 16:27:52 +08:00
Jeffery To fc7cf379e3
golang: Update to 1.15.2
1.15.1 includes a fix for CVE-2020-24553:
net/http/cgi,net/http/fcgi: Cross-Site Scripting (XSS) when Content-Type
is not specified

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-10-05 00:25:18 +08:00
Jeffery To 74b02ca24c golang: Blacklist older (or no) FPUs rather than whitelist newer FPUs
This should be more future-proof (presumably all future ARM FPUs will be
at least VFPv3).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-13 16:07:27 +08:00
Jeffery To 074b417c67 golang: Update to 1.14
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-03-05 02:53:44 +08:00
Jeffery To 89d3f0ab54 golang: Reorganize GoPackage/Environment and Makefile variables
* Move more environment variables into GoPackage/Environment
* Split GoPackage/Environment into target and build sections
* Do not set GOROOT_FINAL for Go packages (setting it should only affect
  the Go compiler and not Go packages)
* Set CGO_LDFLAGS to $(TARGET_LDFLAGS)
* Move GO_TARGET_* variables from golang-values.mk, and GO_VERSION_*
  variables from golang-version.mk, into golang/Makefile

This also updates runc, containerd, and docker-ce to reflect the changes
in GoPackage/Environment.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-02-05 14:19:34 +08:00
Jeffery To b36f27716f golang: Fix selection of GOARM value
This fixes how GOARM is selected for arm platforms, based on support for
VFP/VFPv3 rather than CPU version.

Fixes #10967.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-01-14 22:11:02 +08:00
Jeffery To c377576734 golang: Add support for ASLR/PIE for host and target Go
This adds support to compile host and target Go as position-independent
executables.

Host Go will have PIE enabled if Go supports PIE on the host platform.

Target Go will have PIE enabled if Go supports PIE on the target
platform and CONFIG_PKG_ASLR_PIE is selected.

Go 1.13 supports PIE for x86 and arm targets; mips support is in
progress[1].

[1]: https://github.com/golang/go/issues/21222#issuecomment-542064462

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-01-08 19:29:54 +08:00
Jeffery To 53603abaae golang: Make golang-values.mk more readable
This replaces conditional functions with conditional directives to make
golang-values.mk more readable.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-01-08 19:29:54 +08:00
Jeffery To c9781b027a golang: Update variables unexported in golang-values.mk
The lists of variables are updated for Go 1.13.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-01-08 19:29:54 +08:00
Jeffery To afaf95b4d8 golang: Re-format environment variable unexports
This changes the formatting of environment variable unexports in
golang-values.mk to be more maintainable, and to document the sources of
variables.

There should be no change to the actual list of variables unexported.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-01-08 19:29:54 +08:00
Jeffery To 22ee6e86a0 golang: Use new -trimpath option when compiling Go packages
Go 1.13 added a new -trimpath option to the "go build" command[1] that
removes system paths from compiled executables. This replaces the
previous -trimpath flags.

There are still system paths in the compiled executable (for crti.o and
crtn.o, when cross-compiling); these appear to be stripped during the
packaging process.

[1]: https://golang.org/doc/go1.13#trimpath

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-09-13 17:48:40 +08:00
Jeffery To 0d3ec704b0 golang: Add support for setting gcflags/ldflags from package Makefile
This adds several variables for Go package Makefiles:
* GO_PKG_GCFLAGS - go tool compile arguments
* GO_PKG_LDFLAGS - go tool link arguments
* GO_PKG_LDFLAGS_X - go tool link -X definitions

Settings these will add the corresponding flags to the go install
command line. (Other command line arguments can still be added by
passing them as the first argument to GoPackage/Build/Compile.)

This also adds Go's runtime environment variables (GOGC, GOMAXPROCS,
GOTRACEBACK) to the unexport list.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-03-21 10:10:21 +08:00
Jeffery To 6a8c72c7b0 golang: Ignore GOFLAGS, GO111MODULE environment variables
These were added in Go 1.11.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-02-11 20:33:45 +08:00
Jeffery To 453749f12b golang: Update to 1.11.1, add mips64 / mips64el builds
Go 1.11 added softfloat support for 64-bit MIPS systems[1], so this also
adds builds for mips64 and mips64el.

[1] https://golang.org/doc/go1.11#mips

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2018-10-13 02:30:03 +08:00
Jeffery To c137c38257 golang: new packages
From golang.org:
The Go programming language is an open source project to make
programmers more productive.

This commit consists of two "parts":

* golang/host: Main Go compiler for host (installed to
  STAGING_DIR_HOST/lib/go-cross), used to cross-compile Go programs to
  be packaged.

* golang (and golang-src/golang-doc): Main Go compiler for on-target
  development. These packages are quite large, but I would expect only
  developers to install these.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2018-03-21 09:21:57 +08:00