swig -intgosize

402 views
Skip to first unread message

gta

unread,
Feb 4, 2013, 5:00:20 AM2/4/13
to golan...@googlegroups.com
Hello,
I was trying to use swig at tip and this happened:

cd $HOME/go/misc/swig/callback/

$ go build
# _/Users/giacomo/go/misc/swig/callback
SWIG -go: -intgosize option required but not specified

How can I pass the -intgosize flag? I tried -gcflags and -ccflags, but neither worked.
Or is this a swig issue? 
It sounds like something can go very wrong if I tell swig the wrong length.

My go and swig version:

$ go version
go version devel +437d7aefea45 Mon Feb 04 00:40:11 2013 +0800 darwin/amd64

$ swig -version
SWIG Version 2.0.9
Compiled with g++ [i386-apple-darwin11.4.2]
Configured options: +pcre

Regards.

Giacomo

minux

unread,
Feb 4, 2013, 9:38:02 AM2/4/13
to gta, golan...@googlegroups.com
On Mon, Feb 4, 2013 at 6:00 PM, gta <giacomo...@gmail.com> wrote:
Hello,
I was trying to use swig at tip and this happened:

cd $HOME/go/misc/swig/callback/

$ go build
# _/Users/giacomo/go/misc/swig/callback
SWIG -go: -intgosize option required but not specified

How can I pass the -intgosize flag? I tried -gcflags and -ccflags, but neither worked.
Or is this a swig issue? 
It sounds like something can go very wrong if I tell swig the wrong length.
it should be passed automatically by the go tool, please file an issue.
also note because Go 1.1 will make int 64-bit on 64-bit architectures, we need to
make cmd/go detect whether swig supports the flag, and if not, reject it as it can't
be used. (this latter note is for someone who want to contribute a fix for this issue)

gta

unread,
Feb 4, 2013, 9:45:57 AM2/4/13
to golan...@googlegroups.com, gta
Opened issue 4756.

Ian Lance Taylor

unread,
Feb 4, 2013, 11:29:16 AM2/4/13
to minux, gta, golan...@googlegroups.com
On Mon, Feb 4, 2013 at 6:38 AM, minux <minu...@gmail.com> wrote:
>
> also note because Go 1.1 will make int 64-bit on 64-bit architectures, we
> need to
> make cmd/go detect whether swig supports the flag, and if not, reject it as
> it can't
> be used. (this latter note is for someone who want to contribute a fix for
> this issue)

We can just always pass the -intgosize option. If using an old
version of SWIG, SWIG will fail. That is, we don't have to test, all
we have to do, if we want to be nice, is give a better error message
if SWIG outputs "Unrecognized option -intgosize".

Ian
Reply all
Reply to author
Forward
0 new messages