Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime/cgo: _check_for_64_bit_pointer_matching_GoInt declared as an array with a negative size #10334

Closed
josharian opened this issue Apr 3, 2015 · 8 comments
Milestone

Comments

@josharian
Copy link
Contributor

iostest.bash fails for me right now with:

# runtime/cgo
In file included from $WORK/runtime/cgo/_obj/_cgo_export.c:2:
/var/folders/jw/xrvq7wz95p5bwvjyx9yc2npm390cfb/T/go-build406231563/runtime/cgo/_obj/_cgo_export.h:23:55: error: '_check_for_64_bit_pointer_matching_GoInt' declared as an array with a negative size

Go repo at 21ed40c. clang version Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn), Target: x86_64-apple-darwin14.1.0. Using a regular, locked iPhone 6.

Full build log:

$ ./iostest.bash 
Restarting device.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>GasGauge</key>
    <dict>
        <key>CycleCount</key>
        <integer>137</integer>
        <key>DesignCapacity</key>
        <integer>1751</integer>
        <key>FullChargeCapacity</key>
        <integer>1800</integer>
        <key>Status</key>
        <string>Success</string>
    </dict>
    <key>HDMI</key>
    <dict>
        <key>Connection</key>
        <string>Unplugged</string>
        <key>Status</key>
        <string>Success</string>
    </dict>
    <key>NAND</key>
    <dict>
        <key>Status</key>
        <string>NANDInfoFailed</string>
    </dict>
    <key>WiFi</key>
    <dict>
        <key>Active</key>
        <string>YES</string>
        <key>Status</key>
        <string>Success</string>
    </dict>
</dict>
</plist>

##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using /Users/jbleechersnyder/src/go-1.4.
bootstrap/internal/gc/big
bootstrap/internal/obj
bootstrap/asm/internal/flags
bootstrap/internal/obj/arm
bootstrap/internal/ld
bootstrap/internal/obj/x86
bootstrap/internal/obj/arm64
bootstrap/internal/obj/ppc64
bootstrap/asm/internal/lex
bootstrap/internal/asm
bootstrap/internal/gc
bootstrap/old5a
bootstrap/old9a
bootstrap/asm/internal/arch
bootstrap/old6a
bootstrap/old8a
bootstrap/asm/internal/asm
bootstrap/asm
bootstrap/5l
bootstrap/6l
bootstrap/7l
bootstrap/8l
bootstrap/9l
bootstrap/5g
bootstrap/6g
bootstrap/7g
bootstrap/8g
bootstrap/9g

##### Building compilers and go_bootstrap for host, darwin/amd64.
runtime
errors
sync/atomic
sync
io
unicode
unicode/utf8
unicode/utf16
bytes
math
strings
strconv
bufio
sort
container/heap
encoding/base64
syscall
time
internal/syscall/windows
os
reflect
fmt
encoding
encoding/binary
encoding/json
flag
path/filepath
path
io/ioutil
log
regexp/syntax
regexp
go/token
go/scanner
go/ast
go/parser
os/exec
os/signal
net/url
text/template/parse
text/template
go/doc
go/build
cmd/go

##### Building packages and commands for darwin/amd64.
math/rand
cmd/internal/obj
hash
text/tabwriter
archive/tar
compress/flate
compress/bzip2
compress/lzw
crypto
crypto/md5
runtime/pprof
cmd/internal/gc/big
hash/crc32
hash/adler32
container/list
container/ring
crypto/subtle
math/big
crypto/cipher
crypto/sha512
crypto/hmac
crypto/rc4
crypto/sha1
crypto/sha256
crypto/aes
archive/zip
compress/gzip
compress/zlib
crypto/des
encoding/hex
encoding/pem
debug/dwarf
go/printer
database/sql/driver
debug/gosym
database/sql
cmd/internal/obj/arm
debug/plan9obj
encoding/ascii85
encoding/base32
encoding/csv
encoding/gob
cmd/internal/gc
encoding/xml
mime
crypto/dsa
crypto/elliptic
encoding/asn1
crypto/rand
debug/elf
crypto/rsa
debug/macho
debug/pe
crypto/ecdsa
crypto/x509/pkix
mime/quotedprintable
net/http/internal
internal/format
hash/crc64
hash/fnv
html
image/color
index/suffixarray
cmd/cgo
go/format
image
image/color/palette
internal/mime
internal/trace
math/cmplx
html/template
net/internal/socktest
runtime/debug
runtime/race
testing
testing/iotest
testing/quick
image/internal/imageutil
image/png
text/scanner
image/draw
image/jpeg
cmd/internal/ld
image/gif
cmd/internal/obj/x86
cmd/internal/obj/arm64
cmd/internal/obj/ppc64
cmd/internal/goobj
cmd/internal/rsc.io/arm/armasm
cmd/internal/rsc.io/x86/x86asm
cmd/asm/internal/flags
cmd/dist
cmd/asm/internal/lex
cmd/fix
cmd/asm/internal/arch
cmd/gofmt
cmd/asm/internal/asm
cmd/internal/objfile
cmd/asm
cmd/addr2line
runtime/cgo
cmd/internal/asm
cmd/link
cmd/nm
cmd/5l
cmd/6l
cmd/7l
cmd/8l
cmd/9l
cmd/objdump
# runtime/cgo
In file included from $WORK/runtime/cgo/_obj/_cgo_export.c:2:
/var/folders/jw/xrvq7wz95p5bwvjyx9yc2npm390cfb/T/go-build406231563/runtime/cgo/_obj/_cgo_export.h:23:55: error: '_check_for_64_bit_pointer_matching_GoInt' declared as an array with a negative size
cmd/old5a
cmd/old6a
cmd/old8a
cmd/old9a
cmd/pack
cmd/pprof/internal/profile
cmd/pprof/internal/svg
cmd/pprof/internal/tempfile
cmd/yacc
cmd/pprof/internal/plugin
cmd/pprof/internal/symbolz
cmd/pprof/internal/report
cmd/pprof/internal/symbolizer
cmd/pprof/internal/commands
cmd/pprof/internal/driver
cmd/5g
cmd/6g
cmd/7g
cmd/8g
cmd/9g

/cc @crawshaw @minux

@josharian josharian added this to the Go1.5 milestone Apr 3, 2015
@minux
Copy link
Member

minux commented Apr 3, 2015 via email

@crawshaw
Copy link
Member

crawshaw commented Apr 3, 2015

As @minux said, you may be setting CC=clangwrap.sh instead of CC_FOR_TARGET=clangwrap.sh.

@josharian
Copy link
Contributor Author

Hmmm. I'm not setting any environment variables; I just ran iostest.bash, which appears to set CC_FOR_TARGET. Should I be setting some environment variable?

Also, can we detect this error directly and give a better error message?

@crawshaw
Copy link
Member

crawshaw commented Apr 3, 2015

Your error message is from the darwin/amd64 phase, trying to build a compiler for your host. Something must be off in your setup, try a normal ./all.bash?

A nicer error would be nice, but I do not expect normal users to go anywhere near iostest.bash. The intended way to build static libraries / native apps for iOS will be https://golang.org/x/mobile/cmd/gomobile. But we can get that working after the 1.5 freeze.

@josharian
Copy link
Contributor Author

Normal all.bash passes.

Here are all possibly relevant entries from an env dump just before calling make.bash in iostest.bash:

CC_FOR_TARGET=/Users/jbleechersnyder/src/go-cmp/misc/ios/clangwrap.sh
GOROOT_BOOTSTRAP=/Users/jbleechersnyder/src/go-1.4
CGO_ENABLED=1
GOROOT=/Users/jbleechersnyder/src/go-cmp
GOOS=darwin
GOPATH=/Users/jbleechersnyder/go

@crawshaw
Copy link
Member

crawshaw commented Apr 3, 2015

Oh, I misread your transcript. You need to set GOARCH=arm.

(iostest.bash doesn't do that for you, because soon GOARCH=arm64 will be valid too.)

@minux
Copy link
Member

minux commented Apr 3, 2015 via email

@josharian
Copy link
Contributor Author

Just sent CL 8442.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants