You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1.
//put this code in $GOPATH/src/mytest/mytest.go
package mytest
/*
typedef struct{
int x;
int data[0];
} cStruct;
*/
import "C"
type GoStruct struct {
C.cStruct
}
2.
cd $GOPATH/src/mytest
go build
What is the expected output?
What do you see instead?
# mytest
struct size calculation error
Which compiler are you using (5g, 6g, 8g, gccgo)?
$6g -V
6g version weekly.2012-01-27 11520
Which operating system are you using?
OS X Lion 10.7.2
Which revision are you using? (hg identify)
$ hg identify
23995c78329e tip
Please provide any additional information below.
It compiles on Snow leopard or using the "old" gcc installed via macports.
Here is with the default gcc:
$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files
$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure
--disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2
--mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm-
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib
--build=i686-apple-darwin11
--enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local
--program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11
--target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
$ go build
# mytest
struct size calculation error
And here with the "old" gcc
$export $GCC=/opt/local/bin/gcc-apple-4.2
$ $GCC
i686-apple-darwin11-gcc-apple-4.2.1: no input files
$ $GCC -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_apple-gcc42/apple-gcc42/work/objroot/src/configure
--disable-checking --prefix=/opt/local --mandir=/opt/local/share/man
--enable-languages=c,c++,objc,obj-c++ --libexecdir=/opt/local/libexec/apple-gcc42
--libdir=/opt/local/lib/apple-gcc42 --includedir=/opt/local/include/apple-gcc42
--program-suffix=-apple-4.2 --with-system-zlib --disable-nls --with-gmp=/opt/local
--with-mpfr=/opt/local --with-slibdir=/usr/lib --build=x86_64-apple-darwin11
--enable-werror-always --program-prefix=i686-apple-darwin11-
--host=x86_64-apple-darwin11 --target=i686-apple-darwin11
--with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
$ go build
$
The text was updated successfully, but these errors were encountered:
by giacomo.tartari:
The text was updated successfully, but these errors were encountered: