Bug 52557 - Timex undefined on arm-linux-gnueabi
Summary: Timex undefined on arm-linux-gnueabi
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-11 17:33 UTC by Matthias Klose
Modified: 2012-03-13 22:13 UTC (History)
0 users

See Also:
Host:
Target: arm-linux-gnueabi
Build:
Known to work:
Known to fail: 4.7.0
Last reconfirmed: 2012-03-13 00:00:00


Attachments
libgo.log (2.14 KB, text/x-log)
2012-03-13 21:10 UTC, Matthias Klose
Details
libgo.sum (959 bytes, application/octet-stream)
2012-03-13 21:11 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2012-03-11 17:33:14 UTC
libgo r185183 fails to build on arm-linux-gnueabi,

libcalls.go:1662:22: error: use of undefined type 'Timex'
make[6]: *** [syscall/syscall.lo] Error 1

build/arm-linux-gnueabi/libgo/gen-sysinfo.go has:

// type _timex struct { modes uint32; offset int32; freq int32; maxerror int32; esterror int32; status int32; constant int32; precision int32; tolerance int32; time _timeval; tick int32; ppsfreq int32; jitter int32; shift int32; stabil int32; jitcnt int32; calcnt int32; errcnt int32; stbcnt int32; tai int32; Godump_0 INVALID-bit-field; Godump_1 INVALID-bit-field; Godump_2 INVALID-bit-field; Godump_3 INVALID-bit-field; Godump_4 INVALID-bit-field; Godump_5 INVALID-bit-field; Godump_6 INVALID-bit-field; Godump_7 INVALID-bit-field; Godump_8 INVALID-bit-field; Godump_9 INVALID-bit-field; Godump_10 INVALID-bit-field; }

the invalid fields correspond to bits/timex.h in the timex struct:

  int tai;              /* TAI offset (ro) */

  /* ??? */
  int  :32; int  :32; int  :32; int  :32;
  int  :32; int  :32; int  :32; int  :32;
  int  :32; int  :32; int  :32;
Comment 1 Matthias Klose 2012-03-11 20:35:42 UTC
with the following hack, I'm able to build on arm, and run the tests.

--- libgo/mksysinfo.sh~     2012-03-11 00:36:59.000000000 +0000
+++ libgo/mksysinfo.sh      2012-03-11 19:17:15.000000000 +0000
@@ -137,6 +137,9 @@
 
 ${CC} -fdump-go-spec=gen-sysinfo.go -std=gnu99 -S -o sysinfo.s sysinfo.c
 
+# ARM
+sed -i '/type _timex/s/INVALID-bit-field/int32/g;/type _timex/s,^// ,,' gen-sysinfo.go
+
 echo 'package syscall' > ${OUT}
 echo 'import "unsafe"' >> ${OUT}
 echo 'type _ unsafe.Pointer' >> ${OUT}


$ grep -v ^PASS libgo.sum 
Test Run By doko on Sun Mar 11 19:35:35 UTC 2012
Native configuration is arm-unknown-linux-gnueabi

		=== libgo tests ===

Schedule of variations:
    unix

Running target unix
Running ../../../src/libgo/libgo.exp ...
FAIL: fmt
FAIL: log
FAIL: reflect
FAIL: sync
FAIL: time
FAIL: archive/zip
FAIL: debug/dwarf
FAIL: encoding/gob
FAIL: encoding/json
FAIL: html/template
FAIL: go/printer
FAIL: math/big
FAIL: net/http
FAIL: net/rpc
FAIL: old/regexp
FAIL: old/template
FAIL: text/template
FAIL: text/template/parse

		=== libgo Summary ===

# of expected passes		105
# of unexpected failures	18
Comment 2 ian@gcc.gnu.org 2012-03-13 20:56:29 UTC
Author: ian
Date: Tue Mar 13 20:56:23 2012
New Revision: 185354

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185354
Log:
	PR go/52557
mksysinfo: Fix handling of timex for ARM GNU/Linux.

Modified:
    trunk/libgo/mksysinfo.sh
Comment 3 Ian Lance Taylor 2012-03-13 20:58:41 UTC
Fixed on mainline, waiting for approval for 4.7 branch.

Thanks for reporting it.

Can you attach the complete libgo.sum file, either here or in a different PR?  It may have some clues as to why those tests are failing.
Comment 4 Matthias Klose 2012-03-13 21:10:38 UTC
Created attachment 26887 [details]
libgo.log
Comment 5 Matthias Klose 2012-03-13 21:11:06 UTC
Created attachment 26888 [details]
libgo.sum
Comment 6 ian@gcc.gnu.org 2012-03-13 22:03:38 UTC
Author: ian
Date: Tue Mar 13 22:03:30 2012
New Revision: 185359

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185359
Log:
	PR go/52557
mksysinfo: Fix handling of timex for ARM GNU/Linux.

Modified:
    branches/gcc-4_7-branch/libgo/mksysinfo.sh
Comment 7 Ian Lance Taylor 2012-03-13 22:05:42 UTC
Original problem should be fixed now.
Comment 8 Ian Lance Taylor 2012-03-13 22:13:24 UTC
From the log files, looks like there is some problem with unwinding the stack.  My first guess would be that there is something wrong with the ARM-specific code in libgo/runtime/go-unwind.c.