Comment 2 for bug 1431388

Revision history for this message
Stéphane Graber (stgraber) wrote :

So with the recent cgo powerpc cherry-pick, I now get the following (unsure if it's the relocation issue or some other missing cgo arch-specific value somewhere).

(vivid-powerpc-sbuild)root@winton-06:~# cat test.go
package main

/*
#include <stdio.h>

void hello() {
        printf("Hello world!\n");
}
*/
import "C"

func main() {
    C.hello()
}

(vivid-powerpc-sbuild)root@winton-06:~# go build -v -x test.go
WORK=/tmp/go-build320378268
command-line-arguments
mkdir -p $WORK/command-line-arguments/_obj/
cd /root
CGO_LDFLAGS="-g" "-O2" /usr/lib/gcc/powerpc-linux-gnu/5/cgo -objdir $WORK/command-line-arguments/_obj/ -gccgo -- -I $WORK/command-line-arguments/_obj/ test.go
# command-line-arguments
./test.go:13:5: call of non-function C.hello

(vivid-powerpc-sbuild)root@winton-06:~# go version
go version go1.4.2 gccgo (Ubuntu 5-20150309-1ubuntu3) 5.0.0 20150310 (experimental) [trunk revision 221296] linux/ppc
(vivid-powerpc-sbuild)root@winton-06:~#