Skip to content

cgo/stdio tests fail due to linker error #1352

@gopherbot

Description

@gopherbot

by consalus:

On darwin amd64 at b7b92d1bdcf4+ tip:

"test.bash" in misc/cgo/stdio fails with the following output:

CGOPKGPATH= cgo --  align.go file.go test.go test1.go 
6g -o _go_.6  align.cgo1.go file.cgo1.go test.cgo1.go test1.cgo1.go _cgo_gotypes.go
6c -FVw -I"/Users/username/code/go/src/pkg/runtime" _cgo_defun.c
echo 'int main() { return 0; }' >_cgo_main.c
gcc -m64 -g -fPIC -O2 -o _cgo_main.o -c  _cgo_main.c
gcc -m64 -g -fPIC -O2 -o align.cgo2.o -c  align.cgo2.c
gcc -m64 -g -fPIC -O2 -o file.cgo2.o -c  file.cgo2.c
gcc -m64 -g -fPIC -O2 -o test.cgo2.o -c  test.cgo2.c
gcc -m64 -g -fPIC -O2 -o test1.cgo2.o -c  test1.cgo2.c
gcc -m64 -g -fPIC -O2 -o _cgo1_.o _cgo_main.o align.cgo2.o file.cgo2.o test.cgo2.o
test1.cgo2.o 
cgo -dynimport _cgo1_.o >__cgo_import.c && mv -f __cgo_import.c _cgo_import.c
6c -FVw _cgo_import.c
rm -f _obj/stdio.a
gopack grc _obj/stdio.a _go_.6  _cgo_defun.6 _cgo_import.6 align.cgo2.o file.cgo2.o
test.cgo2.o test1.cgo2.o
cp _obj/stdio.a "/Users/username/code/go/pkg/darwin_amd64/stdio.a"
6g hello.go
6l -o hello hello.6
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of
amd64.S
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of
amd64.S
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
/Users/username/code/go/pkg/darwin_amd64/runtime/cgo.a(amd64.o): duplicate definition of 
too many errors
make: *** [hello] Error 1


This has been happening for about a week (I sync regularly to see if it is fixed). I
assumed it was something wrong on my machine, since it would otherwise be caught on any
similar machine running "all.bash", but no amount of make clean|nuke has had
an effect. Same issue was independently reported on go-nuts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions