changeset 251 | 1c52a0eeb952 |
parent 242 | 2a9ec03fe5a1 |
child 256 | 6d9efbef00a9 |
250:c040f992052f | 251:1c52a0eeb952 |
---|---|
15 echo 1>&2 "GOARCH or GOOS not defined in environment" |
15 echo 1>&2 "GOARCH or GOOS not defined in environment" |
16 exit 1 |
16 exit 1 |
17 fi |
17 fi |
18 |
18 |
19 # Check that we are using the new build system if we should |
19 # Check that we are using the new build system if we should |
20 if [[ "$GOOS" = "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then |
20 if [[ "$GOOS" = "linux" ]] && [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then |
21 if [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then |
21 echo 1>&2 "In the Docker based build system, mkerrors should not be called directly." |
22 echo 1>&2 "In the new build system, mkerrors should not be called directly." |
22 echo 1>&2 "See README.md" |
23 echo 1>&2 "See README.md" |
23 exit 1 |
24 exit 1 |
|
25 fi |
|
26 fi |
24 fi |
27 |
25 |
28 if [[ "$GOOS" = "aix" ]]; then |
26 if [[ "$GOOS" = "aix" ]]; then |
29 CC=${CC:-gcc} |
27 CC=${CC:-gcc} |
30 else |
28 else |
44 #include <netinet/ip_mroute.h> |
42 #include <netinet/ip_mroute.h> |
45 #include <sys/protosw.h> |
43 #include <sys/protosw.h> |
46 #include <sys/stropts.h> |
44 #include <sys/stropts.h> |
47 #include <sys/mman.h> |
45 #include <sys/mman.h> |
48 #include <sys/poll.h> |
46 #include <sys/poll.h> |
47 #include <sys/select.h> |
|
49 #include <sys/termio.h> |
48 #include <sys/termio.h> |
50 #include <termios.h> |
49 #include <termios.h> |
51 #include <fcntl.h> |
50 #include <fcntl.h> |
52 |
51 |
53 #define AF_LOCAL AF_UNIX |
52 #define AF_LOCAL AF_UNIX |
60 #include <stdint.h> |
59 #include <stdint.h> |
61 #include <sys/attr.h> |
60 #include <sys/attr.h> |
62 #include <sys/types.h> |
61 #include <sys/types.h> |
63 #include <sys/event.h> |
62 #include <sys/event.h> |
64 #include <sys/ptrace.h> |
63 #include <sys/ptrace.h> |
64 #include <sys/select.h> |
|
65 #include <sys/socket.h> |
65 #include <sys/socket.h> |
66 #include <sys/sockio.h> |
66 #include <sys/sockio.h> |
67 #include <sys/sysctl.h> |
67 #include <sys/sysctl.h> |
68 #include <sys/mman.h> |
68 #include <sys/mman.h> |
69 #include <sys/mount.h> |
69 #include <sys/mount.h> |
80 ' |
80 ' |
81 |
81 |
82 includes_DragonFly=' |
82 includes_DragonFly=' |
83 #include <sys/types.h> |
83 #include <sys/types.h> |
84 #include <sys/event.h> |
84 #include <sys/event.h> |
85 #include <sys/select.h> |
|
85 #include <sys/socket.h> |
86 #include <sys/socket.h> |
86 #include <sys/sockio.h> |
87 #include <sys/sockio.h> |
87 #include <sys/stat.h> |
88 #include <sys/stat.h> |
88 #include <sys/sysctl.h> |
89 #include <sys/sysctl.h> |
89 #include <sys/mman.h> |
90 #include <sys/mman.h> |
99 #include <netinet/ip.h> |
100 #include <netinet/ip.h> |
100 #include <net/ip_mroute/ip_mroute.h> |
101 #include <net/ip_mroute/ip_mroute.h> |
101 ' |
102 ' |
102 |
103 |
103 includes_FreeBSD=' |
104 includes_FreeBSD=' |
104 #include <sys/capability.h> |
105 #include <sys/capsicum.h> |
105 #include <sys/param.h> |
106 #include <sys/param.h> |
106 #include <sys/types.h> |
107 #include <sys/types.h> |
107 #include <sys/event.h> |
108 #include <sys/event.h> |
109 #include <sys/select.h> |
|
108 #include <sys/socket.h> |
110 #include <sys/socket.h> |
109 #include <sys/sockio.h> |
111 #include <sys/sockio.h> |
110 #include <sys/stat.h> |
112 #include <sys/stat.h> |
111 #include <sys/sysctl.h> |
113 #include <sys/sysctl.h> |
112 #include <sys/mman.h> |
114 #include <sys/mman.h> |
179 #include <sys/mount.h> |
181 #include <sys/mount.h> |
180 #include <sys/prctl.h> |
182 #include <sys/prctl.h> |
181 #include <sys/stat.h> |
183 #include <sys/stat.h> |
182 #include <sys/types.h> |
184 #include <sys/types.h> |
183 #include <sys/time.h> |
185 #include <sys/time.h> |
184 #include <sys/socket.h> |
186 #include <sys/select.h> |
187 #include <sys/signalfd.h> |
|
188 #include <sys/socket.h> |
|
189 #include <sys/uio.h> |
|
185 #include <sys/xattr.h> |
190 #include <sys/xattr.h> |
191 #include <linux/bpf.h> |
|
192 #include <linux/can.h> |
|
193 #include <linux/capability.h> |
|
194 #include <linux/cryptouser.h> |
|
195 #include <linux/devlink.h> |
|
196 #include <linux/errqueue.h> |
|
197 #include <linux/falloc.h> |
|
198 #include <linux/fanotify.h> |
|
199 #include <linux/filter.h> |
|
200 #include <linux/fs.h> |
|
201 #include <linux/fscrypt.h> |
|
202 #include <linux/genetlink.h> |
|
203 #include <linux/hdreg.h> |
|
204 #include <linux/icmpv6.h> |
|
186 #include <linux/if.h> |
205 #include <linux/if.h> |
206 #include <linux/if_addr.h> |
|
187 #include <linux/if_alg.h> |
207 #include <linux/if_alg.h> |
188 #include <linux/if_arp.h> |
208 #include <linux/if_arp.h> |
189 #include <linux/if_ether.h> |
209 #include <linux/if_ether.h> |
210 #include <linux/if_ppp.h> |
|
190 #include <linux/if_tun.h> |
211 #include <linux/if_tun.h> |
191 #include <linux/if_packet.h> |
212 #include <linux/if_packet.h> |
192 #include <linux/if_addr.h> |
213 #include <linux/if_xdp.h> |
193 #include <linux/falloc.h> |
214 #include <linux/kexec.h> |
194 #include <linux/filter.h> |
|
195 #include <linux/fs.h> |
|
196 #include <linux/keyctl.h> |
215 #include <linux/keyctl.h> |
216 #include <linux/loop.h> |
|
197 #include <linux/magic.h> |
217 #include <linux/magic.h> |
198 #include <linux/memfd.h> |
218 #include <linux/memfd.h> |
219 #include <linux/module.h> |
|
199 #include <linux/netfilter/nfnetlink.h> |
220 #include <linux/netfilter/nfnetlink.h> |
200 #include <linux/netlink.h> |
221 #include <linux/netlink.h> |
201 #include <linux/net_namespace.h> |
222 #include <linux/net_namespace.h> |
223 #include <linux/nsfs.h> |
|
202 #include <linux/perf_event.h> |
224 #include <linux/perf_event.h> |
225 #include <linux/ptrace.h> |
|
203 #include <linux/random.h> |
226 #include <linux/random.h> |
204 #include <linux/reboot.h> |
227 #include <linux/reboot.h> |
228 #include <linux/rtc.h> |
|
205 #include <linux/rtnetlink.h> |
229 #include <linux/rtnetlink.h> |
206 #include <linux/ptrace.h> |
|
207 #include <linux/sched.h> |
230 #include <linux/sched.h> |
208 #include <linux/seccomp.h> |
231 #include <linux/seccomp.h> |
232 #include <linux/serial.h> |
|
209 #include <linux/sockios.h> |
233 #include <linux/sockios.h> |
234 #include <linux/taskstats.h> |
|
235 #include <linux/tipc.h> |
|
236 #include <linux/vm_sockets.h> |
|
210 #include <linux/wait.h> |
237 #include <linux/wait.h> |
211 #include <linux/icmpv6.h> |
|
212 #include <linux/serial.h> |
|
213 #include <linux/can.h> |
|
214 #include <linux/vm_sockets.h> |
|
215 #include <linux/taskstats.h> |
|
216 #include <linux/genetlink.h> |
|
217 #include <linux/watchdog.h> |
238 #include <linux/watchdog.h> |
218 #include <linux/hdreg.h> |
239 |
219 #include <linux/rtc.h> |
|
220 #include <linux/if_xdp.h> |
|
221 #include <mtd/ubi-user.h> |
240 #include <mtd/ubi-user.h> |
222 #include <net/route.h> |
241 #include <net/route.h> |
242 |
|
243 #if defined(__sparc__) |
|
244 // On sparc{,64}, the kernel defines struct termios2 itself which clashes with the |
|
245 // definition in glibc. As only the error constants are needed here, include the |
|
246 // generic termibits.h (which is included by termbits.h on sparc). |
|
247 #include <asm-generic/termbits.h> |
|
248 #else |
|
223 #include <asm/termbits.h> |
249 #include <asm/termbits.h> |
250 #endif |
|
224 |
251 |
225 #ifndef MSG_FASTOPEN |
252 #ifndef MSG_FASTOPEN |
226 #define MSG_FASTOPEN 0x20000000 |
253 #define MSG_FASTOPEN 0x20000000 |
227 #endif |
254 #endif |
228 |
255 |
247 // Certain constants are missing from the fs/crypto UAPI |
274 // Certain constants are missing from the fs/crypto UAPI |
248 #define FS_KEY_DESC_PREFIX "fscrypt:" |
275 #define FS_KEY_DESC_PREFIX "fscrypt:" |
249 #define FS_KEY_DESC_PREFIX_SIZE 8 |
276 #define FS_KEY_DESC_PREFIX_SIZE 8 |
250 #define FS_MAX_KEY_SIZE 64 |
277 #define FS_MAX_KEY_SIZE 64 |
251 |
278 |
252 // XDP socket constants do not appear to be picked up otherwise. |
279 // The code generator produces -0x1 for (~0), but an unsigned value is necessary |
253 // Copied from samples/bpf/xdpsock_user.c. |
280 // for the tipc_subscr timeout __u32 field. |
254 #ifndef SOL_XDP |
281 #undef TIPC_WAIT_FOREVER |
255 #define SOL_XDP 283 |
282 #define TIPC_WAIT_FOREVER 0xffffffff |
256 #endif |
|
257 |
|
258 #ifndef AF_XDP |
|
259 #define AF_XDP 44 |
|
260 #endif |
|
261 ' |
283 ' |
262 |
284 |
263 includes_NetBSD=' |
285 includes_NetBSD=' |
264 #include <sys/types.h> |
286 #include <sys/types.h> |
265 #include <sys/param.h> |
287 #include <sys/param.h> |
266 #include <sys/event.h> |
288 #include <sys/event.h> |
267 #include <sys/extattr.h> |
289 #include <sys/extattr.h> |
268 #include <sys/mman.h> |
290 #include <sys/mman.h> |
269 #include <sys/mount.h> |
291 #include <sys/mount.h> |
292 #include <sys/select.h> |
|
270 #include <sys/socket.h> |
293 #include <sys/socket.h> |
271 #include <sys/sockio.h> |
294 #include <sys/sockio.h> |
272 #include <sys/sysctl.h> |
295 #include <sys/sysctl.h> |
273 #include <sys/termios.h> |
296 #include <sys/termios.h> |
274 #include <sys/ttycom.h> |
297 #include <sys/ttycom.h> |
291 #include <sys/types.h> |
314 #include <sys/types.h> |
292 #include <sys/param.h> |
315 #include <sys/param.h> |
293 #include <sys/event.h> |
316 #include <sys/event.h> |
294 #include <sys/mman.h> |
317 #include <sys/mman.h> |
295 #include <sys/mount.h> |
318 #include <sys/mount.h> |
319 #include <sys/select.h> |
|
296 #include <sys/socket.h> |
320 #include <sys/socket.h> |
297 #include <sys/sockio.h> |
321 #include <sys/sockio.h> |
298 #include <sys/stat.h> |
322 #include <sys/stat.h> |
299 #include <sys/sysctl.h> |
323 #include <sys/sysctl.h> |
300 #include <sys/termios.h> |
324 #include <sys/termios.h> |
327 ' |
351 ' |
328 |
352 |
329 includes_SunOS=' |
353 includes_SunOS=' |
330 #include <limits.h> |
354 #include <limits.h> |
331 #include <sys/types.h> |
355 #include <sys/types.h> |
356 #include <sys/select.h> |
|
332 #include <sys/socket.h> |
357 #include <sys/socket.h> |
333 #include <sys/sockio.h> |
358 #include <sys/sockio.h> |
334 #include <sys/stat.h> |
359 #include <sys/stat.h> |
335 #include <sys/mman.h> |
360 #include <sys/mman.h> |
336 #include <sys/wait.h> |
361 #include <sys/wait.h> |
419 $2 == "PENDIN" || |
444 $2 == "PENDIN" || |
420 $2 == "TOSTOP" || |
445 $2 == "TOSTOP" || |
421 $2 == "XCASE" || |
446 $2 == "XCASE" || |
422 $2 == "ALTWERASE" || |
447 $2 == "ALTWERASE" || |
423 $2 == "NOKERNINFO" || |
448 $2 == "NOKERNINFO" || |
449 $2 == "NFDBITS" || |
|
424 $2 ~ /^PAR/ || |
450 $2 ~ /^PAR/ || |
425 $2 ~ /^SIG[^_]/ || |
451 $2 ~ /^SIG[^_]/ || |
426 $2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ || |
452 $2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ || |
427 $2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ || |
453 $2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ || |
428 $2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ || |
454 $2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ || |
429 $2 ~ /^O?XTABS$/ || |
455 $2 ~ /^O?XTABS$/ || |
430 $2 ~ /^TC[IO](ON|OFF)$/ || |
456 $2 ~ /^TC[IO](ON|OFF)$/ || |
431 $2 ~ /^IN_/ || |
457 $2 ~ /^IN_/ || |
432 $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || |
458 $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || |
433 $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || |
459 $2 ~ /^LO_(KEY|NAME)_SIZE$/ || |
460 $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || |
|
461 $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|MCAST|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || |
|
434 $2 ~ /^TP_STATUS_/ || |
462 $2 ~ /^TP_STATUS_/ || |
435 $2 ~ /^FALLOC_/ || |
463 $2 ~ /^FALLOC_/ || |
436 $2 == "ICMPV6_FILTER" || |
464 $2 == "ICMPV6_FILTER" || |
437 $2 == "SOMAXCONN" || |
465 $2 == "SOMAXCONN" || |
438 $2 == "NAME_MAX" || |
466 $2 == "NAME_MAX" || |
441 $2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ || |
469 $2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ || |
442 $2 ~ /^HW_MACHINE$/ || |
470 $2 ~ /^HW_MACHINE$/ || |
443 $2 ~ /^SYSCTL_VERS/ || |
471 $2 ~ /^SYSCTL_VERS/ || |
444 $2 !~ "MNT_BITS" && |
472 $2 !~ "MNT_BITS" && |
445 $2 ~ /^(MS|MNT|UMOUNT)_/ || |
473 $2 ~ /^(MS|MNT|UMOUNT)_/ || |
474 $2 ~ /^NS_GET_/ || |
|
446 $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || |
475 $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || |
447 $2 ~ /^(O|F|E?FD|NAME|S|PTRACE|PT)_/ || |
476 $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT)_/ || |
477 $2 ~ /^KEXEC_/ || |
|
448 $2 ~ /^LINUX_REBOOT_CMD_/ || |
478 $2 ~ /^LINUX_REBOOT_CMD_/ || |
449 $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || |
479 $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || |
480 $2 ~ /^MODULE_INIT_/ || |
|
450 $2 !~ "NLA_TYPE_MASK" && |
481 $2 !~ "NLA_TYPE_MASK" && |
451 $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || |
482 $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || |
452 $2 ~ /^SIOC/ || |
483 $2 ~ /^SIOC/ || |
453 $2 ~ /^TIOC/ || |
484 $2 ~ /^TIOC/ || |
454 $2 ~ /^TCGET/ || |
485 $2 ~ /^TCGET/ || |
459 $2 ~ /^BIOC/ || |
490 $2 ~ /^BIOC/ || |
460 $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || |
491 $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || |
461 $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ || |
492 $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ || |
462 $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || |
493 $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || |
463 $2 ~ /^CLONE_[A-Z_]+/ || |
494 $2 ~ /^CLONE_[A-Z_]+/ || |
464 $2 !~ /^(BPF_TIMEVAL)$/ && |
495 $2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+)$/ && |
465 $2 ~ /^(BPF|DLT)_/ || |
496 $2 ~ /^(BPF|DLT)_/ || |
466 $2 ~ /^CLOCK_/ || |
497 $2 ~ /^(CLOCK|TIMER)_/ || |
467 $2 ~ /^CAN_/ || |
498 $2 ~ /^CAN_/ || |
468 $2 ~ /^CAP_/ || |
499 $2 ~ /^CAP_/ || |
469 $2 ~ /^ALG_/ || |
500 $2 ~ /^ALG_/ || |
470 $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE|IOC_(GET|SET)_ENCRYPTION)/ || |
501 $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE)/ || |
502 $2 ~ /^FS_IOC_.*ENCRYPTION/ || |
|
503 $2 ~ /^FSCRYPT_/ || |
|
471 $2 ~ /^GRND_/ || |
504 $2 ~ /^GRND_/ || |
505 $2 ~ /^RND/ || |
|
472 $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ || |
506 $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ || |
473 $2 ~ /^KEYCTL_/ || |
507 $2 ~ /^KEYCTL_/ || |
474 $2 ~ /^PERF_EVENT_IOC_/ || |
508 $2 ~ /^PERF_EVENT_IOC_/ || |
475 $2 ~ /^SECCOMP_MODE_/ || |
509 $2 ~ /^SECCOMP_MODE_/ || |
476 $2 ~ /^SPLICE_/ || |
510 $2 ~ /^SPLICE_/ || |
491 $2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ || |
525 $2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ || |
492 $2 ~ /^FSOPT_/ || |
526 $2 ~ /^FSOPT_/ || |
493 $2 ~ /^WDIOC_/ || |
527 $2 ~ /^WDIOC_/ || |
494 $2 ~ /^NFN/ || |
528 $2 ~ /^NFN/ || |
495 $2 ~ /^XDP_/ || |
529 $2 ~ /^XDP_/ || |
530 $2 ~ /^RWF_/ || |
|
496 $2 ~ /^(HDIO|WIN|SMART)_/ || |
531 $2 ~ /^(HDIO|WIN|SMART)_/ || |
532 $2 ~ /^CRYPTO_/ || |
|
533 $2 ~ /^TIPC_/ || |
|
534 $2 ~ /^DEVLINK_/ || |
|
497 $2 !~ "WMESGLEN" && |
535 $2 !~ "WMESGLEN" && |
498 $2 ~ /^W[A-Z0-9]+$/ || |
536 $2 ~ /^W[A-Z0-9]+$/ || |
537 $2 ~/^PPPIOC/ || |
|
538 $2 ~ /^FAN_|FANOTIFY_/ || |
|
499 $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} |
539 $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} |
500 $2 ~ /^__WCOREFLAG$/ {next} |
540 $2 ~ /^__WCOREFLAG$/ {next} |
501 $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} |
541 $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} |
502 |
542 |
503 {next} |
543 {next} |