diff options
author | William Hubbs <williamh@gentoo.org> | 2023-02-16 21:13:31 -0600 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2023-02-16 21:20:13 -0600 |
commit | b2ef3711590017fec705bbb8a9f00268781128a1 (patch) | |
tree | f9eb466a1795e597660ca2d8ac1146003b074622 /eclass | |
parent | sys-apps/systemd: add 252.6 (diff) | |
download | gentoo-b2ef3711590017fec705bbb8a9f00268781128a1.tar.gz gentoo-b2ef3711590017fec705bbb8a9f00268781128a1.tar.bz2 gentoo-b2ef3711590017fec705bbb8a9f00268781128a1.zip |
go-module.eclass: fix -buildmode=pie, support makeopts
Closes: https://bugs.gentoo.org/893316
Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/go-module.eclass | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass index 08e9f267d0af..bae5d2a49894 100644 --- a/eclass/go-module.eclass +++ b/eclass/go-module.eclass @@ -65,6 +65,8 @@ case ${EAPI} in *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +inherit multiprocessing + if [[ -z ${_GO_MODULE} ]]; then _GO_MODULE=1 @@ -100,7 +102,7 @@ export GOMODCACHE="${WORKDIR}/go-mod" # -modcacherw makes the build cache read/write # -v prints the names of packages as they are compiled # -x prints commands as they are executed -export GOFLAGS="-buildmode=pie -buildvcs=false -modcacherw -v -x" +export GOFLAGS="-buildvcs=false -modcacherw -v -x" # Do not complain about CFLAGS etc since go projects do not use them. QA_FLAGS_IGNORED='.*' @@ -349,6 +351,11 @@ go-module_setup_proxy() { # - Otherwise, if EGO_VENDOR is set, bail out. # - Otherwise do a normal unpack. go-module_src_unpack() { + if use amd64 || use arm || use arm64 || + ( use ppc64 && ! use big-endian ) || use s390 || use x86; then + GOFLAGS="-buildmode=pie ${GOFLAGS}" + fi + GOFLAGS="${GOFLAGS} -p $(makeopts_jobs)" if [[ "${#EGO_SUM[@]}" -gt 0 ]]; then eqawarn "This ebuild uses EGO_SUM which is deprecated" eqawarn "Please migrate to a dependency tarball" |