Last active
September 13, 2020 02:55
-
-
Save dreampuf/1ee158a695d4b3451b4f8c1c84546ce4 to your computer and use it in GitHub Desktop.
How to install golang 1.11 in CentOS5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# details in: https://golang.org/doc/install/source | |
# a patch for centos 5 build: https://github.com/golang/go/issues/24980#issuecomment-384193598 | |
export GOROOT="/usr/local/go" | |
export PATH="$GOROOT/bin:$PATH" | |
mkdir /usr/local/go ~/go | |
curl -L https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz | tar xf - -C /usr/local/go | |
cd /usr/local/go/src | |
./make.bash | |
curl -L https://dl.google.com/go/go1.11.src.tar.gz | tar xf - -C ~/go | |
cd ~/go/src | |
patch -p2 <<EOF | |
diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s | |
index a5db5cba23..8e945add07 100644 | |
--- a/src/runtime/sys_linux_amd64.s | |
+++ b/src/runtime/sys_linux_amd64.s | |
@@ -41,6 +41,7 @@ | |
#define SYS_sched_getaffinity 204 | |
#define SYS_epoll_create 213 | |
#define SYS_exit_group 231 | |
+#define SYS_epoll_wait 232 | |
#define SYS_epoll_ctl 233 | |
#define SYS_openat 257 | |
#define SYS_faccessat 269 | |
@@ -664,8 +665,7 @@ TEXT runtime·epollwait(SB),NOSPLIT,$0 | |
MOVQ ev+8(FP), SI | |
MOVL nev+16(FP), DX | |
MOVL timeout+20(FP), R10 | |
- MOVQ $0, R8 | |
- MOVL $SYS_epoll_pwait, AX | |
+ MOVL $SYS_epoll_wait, AX | |
SYSCALL | |
MOVL AX, ret+24(FP) | |
RET | |
EOF | |
./make.bash | |
../bin/go version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment