Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/golang/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Go programming language compiler"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="3:1.26.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://go.dev/dl/go${TERMUX_PKG_VERSION#*:}.src.tar.gz
TERMUX_PKG_SHA256=c9132a8a1f6bd2aa4aad1d74b8231d95274950483a4950657ee6c56e6e817790
TERMUX_PKG_DEPENDS="clang"
Expand All @@ -14,6 +15,7 @@ TERMUX_PKG_NO_STATICSPLIT=true
termux_step_post_get_source() {
. "$TERMUX_PKG_BUILDER_DIR/patch-script/fix-hardcoded-etc-resolv-conf.sh"
. "$TERMUX_PKG_BUILDER_DIR/patch-script/remove-pidfd.sh"
. "$TERMUX_PKG_BUILDER_DIR/patch-script/remove-futex_time64.sh"
}

termux_step_make_install() {
Expand Down
20 changes: 20 additions & 0 deletions packages/golang/patch-script/remove-futex_time64.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/src/runtime/os_linux32.go
+++ b/src/runtime/os_linux32.go
@@ -21,7 +21,7 @@

//go:nosplit
func futex(addr unsafe.Pointer, op int32, val uint32, ts *timespec, addr2 unsafe.Pointer, val3 uint32) int32 {
- if !isFutexTime32bitOnly.Load() {
+ if GOOS != "android" && !isFutexTime32bitOnly.Load() {
ret := futex_time64(addr, op, val, ts, addr2, val3)
// futex_time64 is only supported on Linux 5.0+
if ret != -_ENOSYS {
@@ -49,7 +49,7 @@

//go:nosplit
func timer_settime(timerid int32, flags int32, new, old *itimerspec) int32 {
- if !isSetTime32bitOnly.Load() {
+ if GOOS != "android" && !isSetTime32bitOnly.Load() {
ret := timer_settime64(timerid, flags, new, old)
// timer_settime64 is only supported on Linux 5.0+
if ret != -_ENOSYS {
3 changes: 3 additions & 0 deletions packages/golang/patch-script/remove-futex_time64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sed -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \
${TERMUX_SCRIPTDIR}/packages/golang/patch-script/remove-futex_time64.diff \
| patch --silent -p1
3 changes: 2 additions & 1 deletion scripts/build/setup/termux_setup_golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ termux_setup_golang() {
TERMUX_BUILDGO_FOLDER=${TERMUX_COMMON_CACHEDIR}/${TERMUX_GO_VERSION}
fi

TERMUX_BUILDGO_FOLDER+="-r1"
TERMUX_BUILDGO_FOLDER+="-r2"

export GOROOT=$TERMUX_BUILDGO_FOLDER
export PATH=${GOROOT}/bin:${PATH}
Expand All @@ -38,6 +38,7 @@ termux_setup_golang() {
cd "$TERMUX_BUILDGO_FOLDER"
. "${TERMUX_SCRIPTDIR}/packages/golang/patch-script/fix-hardcoded-etc-resolv-conf.sh"
. "${TERMUX_SCRIPTDIR}/packages/golang/patch-script/remove-pidfd.sh"
. "${TERMUX_SCRIPTDIR}/packages/golang/patch-script/remove-futex_time64.sh"
)
else
if [[ "$TERMUX_APP_PACKAGE_MANAGER" = "apt" && "$(dpkg-query -W -f '${db:Status-Status}\n' golang 2>/dev/null)" != "installed" ]] ||
Expand Down
Loading