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

cmd/cgo: external linking support and Go 1.1.1 runtime changes have broken gccgo support #5905

Closed
ianlancetaylor opened this issue Jul 17, 2013 · 5 comments

Comments

@ianlancetaylor
Copy link
Contributor

commented Jul 17, 2013

> cd misc/cgo/test && go test -compiler=gccgo
# _/home/iant/go/misc/cgo/test
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:1:0: warning:
ignoring #pragma cgo_ldflag  [-Wunknown-pragmas]
 #pragma cgo_ldflag "-ldl"
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:40:0: warning:
ignoring #pragma cgo_import_static SansTypeface [-Wunknown-pragmas]
 #pragma cgo_import_static SansTypeface
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:43:0: warning:
ignoring #pragma cgo_import_static _expA [-Wunknown-pragmas]
 #pragma cgo_import_static _expA
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:46:0: warning:
ignoring #pragma cgo_import_static _expB [-Wunknown-pragmas]
 #pragma cgo_import_static _expB
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:49:0: warning:
ignoring #pragma cgo_import_static _expC [-Wunknown-pragmas]
 #pragma cgo_import_static _expC
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:52:0: warning:
ignoring #pragma cgo_import_static _expD [-Wunknown-pragmas]
 #pragma cgo_import_static _expD
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:55:0: warning:
ignoring #pragma cgo_import_static base_symbol [-Wunknown-pragmas]
 #pragma cgo_import_static base_symbol
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:59:0: warning:
ignoring #pragma cgo_import_static api_hello [-Wunknown-pragmas]
 #pragma cgo_import_static api_hello
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:63:0: warning:
ignoring #pragma cgo_import_static common [-Wunknown-pragmas]
 #pragma cgo_import_static common
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:66:0: warning:
ignoring #pragma cgo_import_static greeting [-Wunknown-pragmas]
 #pragma cgo_import_static greeting
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:69:0: warning:
ignoring #pragma cgo_import_static hola [-Wunknown-pragmas]
 #pragma cgo_import_static hola
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:72:0: warning:
ignoring #pragma cgo_import_static is_windows [-Wunknown-pragmas]
 #pragma cgo_import_static is_windows
 ^
/tmp/go-build832685136/_/home/iant/go/misc/cgo/test/_test/_cgo_defun.c:75:0: warning:
ignoring #pragma cgo_import_static issue5603exp [-Wunknown-pragmas]
 #pragma cgo_import_static issue5603exp
 ^
# testmain
<stdin>:379: error: undefined reference to 'lockOSThreadC'
collect2: error: ld returned 1 exit status
FAIL    _/home/iant/go/misc/cgo/test [build failed]
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor Author

commented Jul 18, 2013

Comment 1:

This issue was updated by revision c5c52f0.

Don't emit #pragma cgo_ldflag and cgo_import_static
declarations that gccgo doesn't understand and can't use.
R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/11490043
@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2013

Comment 3:

Ian, did that CL fix the issue? If not, can you say what remains? Thanks.
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor Author

commented Jul 23, 2013

Comment 4:

Remaining issues: https://golang.org/cl/11406047 .
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor Author

commented Jul 25, 2013

Comment 6:

This issue was closed by revision d9d3deb.

Status changed to Fixed.

@adg

This comment has been minimized.

Copy link
Contributor

commented Jul 28, 2013

Comment 7:

This issue was closed by revision 4e2d025187c6.

@rsc rsc added this to the Go1.1.2 milestone Apr 14, 2015

@rsc rsc removed the go1.1.2 label Apr 14, 2015

adg added a commit that referenced this issue May 11, 2015
[release-branch.go1.1] cmd/cgo: gccgo fixes
««« CL 11406047 / 4d9c3095de9d
cmd/cgo: gccgo fixes

Don't require a full-scale callback for calls to the special
prologue functions.

Always use a simple wrapper function for C functions, so that
we can handle static functions defined in the import "C"
comment.

Disable a test that relies on gc-specific function names.

Fixes #5905.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11406047

»»»

Update #5928

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/11887043

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.