https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61789
Bug ID: 61789 Summary: Missing syscall constants Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: go Assignee: ian at airs dot com Reporter: erezh at il dot ibm.com CC: cmang at google dot com Created attachment 33113 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33113&action=edit Failed compilation OS: Ubutnu 14.04 LTS Server - both amd64 and ppc64 gccgo version (output of "go version"): go version xgcc (Ubuntu 4.9-20140406-0ubuntu1) 4.9.0 20140405 (experimental) [trunk revision 209157] linux/amd64 How-to-produce: Compile the attached syscallCheck.go with gccgo. It should fail with an output similar to below. When compiling with Google's gc, there should be no errors. # gccgo -g -o test syscall_test.go syscall_test.go:12:48: error: reference to undefined identifier ‘syscall.TIOCSPTLCK’ fmt.Println("syscall.TIOCSPTLCK=", syscall.TIOCSPTLCK) ^ syscall_test.go:13:46: error: reference to undefined identifier ‘syscall.TIOCGPTN’ fmt.Println("syscall.TIOCGPTN=", syscall.TIOCGPTN) ^ syscall_test.go:17:49: error: reference to undefined identifier ‘syscall.CLONE_NEWNS’ fmt.Println("syscall.CLONE_NEWNS=", syscall.CLONE_NEWNS) ^ syscall_test.go:18:50: error: reference to undefined identifier ‘syscall.CLONE_NEWUTS’ fmt.Println("syscall.CLONE_NEWUTS=", syscall.CLONE_NEWUTS) ^ syscall_test.go:19:50: error: reference to undefined identifier ‘syscall.CLONE_NEWIPC’ fmt.Println("syscall.CLONE_NEWIPC=", syscall.CLONE_NEWIPC) ^ syscall_test.go:20:51: error: reference to undefined identifier ‘syscall.CLONE_NEWUSER’ fmt.Println("syscall.CLONE_NEWUSER=", syscall.CLONE_NEWUSER) ^ syscall_test.go:21:50: error: reference to undefined identifier ‘syscall.CLONE_NEWPID’ fmt.Println("syscall.CLONE_NEWPID=", syscall.CLONE_NEWPID) ^ syscall_test.go:22:50: error: reference to undefined identifier ‘syscall.CLONE_NEWNET’ fmt.Println("syscall.CLONE_NEWNET=", syscall.CLONE_NEWNET) ^ Further analysis, and more related issues: 1. I found that the missing constants are defined in the files zerrors_linux_amd64.go and ztypes_linux_amd64.go - for amd64. Both files are part of the golang-src package. However, for some reason, those files are not compiled into gccgo (libgo?) and are therefore not available for builds. 2. For ppc64, I could not even find the respective files in golang-src. 3. Is it possible that more platform-specific files such as above have been skipped being built into gccgo/libgo?