abinfo "Setting GOFLAGS for a reproducible build ..."
export GOFLAGS="${GOFLAGS} -trimpath"

abinfo "Setting other GOFLAGS ..."
export GOFLAGS="${GOFLAGS} -mod=readonly -modcacherw"

# FIXME: Go PIE not supported on loongarch64 and loongson3.
if ! ab_match_arch loongarch64 && \
   ! ab_match_arch loongarch64_nosimd && \
   ! ab_match_arch loongson3; then
    abinfo "Enabling buildmode=pie ..."
    export GOFLAGS="${GOFLAGS} -buildmode=pie"
fi
