-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgo1.17.13-fix.diff
64 lines (62 loc) · 2.54 KB
/
go1.17.13-fix.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go
index a73e998877..c3d61f4c5e 100644
--- a/src/cmd/cgo/gcc.go
+++ b/src/cmd/cgo/gcc.go
@@ -1639,7 +1639,7 @@ func (p *Package) gccCmd() []string {
c = append(c, "-mcmodel=large")
}
// disable LTO so we get an object whose symbols we can read
- c = append(c, "-fno-lto")
+ // c = append(c, "-fno-lto")
c = append(c, "-") //read input from standard input
return c
}
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
index 94152f4278..fa965d8362 100644
--- a/src/cmd/cgo/out.go
+++ b/src/cmd/cgo/out.go
@@ -881,9 +881,9 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
// We use packed structs, but they are always aligned.
// The pragmas and address-of-packed-member are only recognized as
// warning groups in clang 4.0+, so ignore unknown pragmas first.
- fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n")
- fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Wpragmas\"\n")
- fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Waddress-of-packed-member\"\n")
+ // fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n")
+ // fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Wpragmas\"\n")
+ // fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Waddress-of-packed-member\"\n")
fmt.Fprintf(fgcc, "extern void crosscall2(void (*fn)(void *), void *, int, __SIZE_TYPE__);\n")
fmt.Fprintf(fgcc, "extern __SIZE_TYPE__ _cgo_wait_runtime_init_done(void);\n")
@@ -1477,10 +1477,10 @@ extern char* _cgo_topofstack(void);
We use packed structs, but they are always aligned.
The pragmas and address-of-packed-member are only recognized as warning
groups in clang 4.0+, so ignore unknown pragmas first.
-*/
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
+*/
#include <errno.h>
#include <string.h>
diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s
index 33cc670b64..1b6abce31b 100644
--- a/src/runtime/sys_linux_amd64.s
+++ b/src/runtime/sys_linux_amd64.s
@@ -43,6 +43,7 @@
#define SYS_epoll_create 213
#define SYS_clock_gettime 228
#define SYS_exit_group 231
+#define SYS_epoll_wait 232
#define SYS_epoll_ctl 233
#define SYS_tgkill 234
#define SYS_openat 257
@@ -660,8 +661,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