Skip to content

gccgo, cgo: compile errors due to global variable #3183

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

Closed
alberts opened this issue Mar 4, 2012 · 4 comments
Closed

gccgo, cgo: compile errors due to global variable #3183

alberts opened this issue Mar 4, 2012 · 4 comments
Milestone

Comments

@alberts
Copy link
Contributor

alberts commented Mar 4, 2012

What steps will reproduce the problem?

GC=gccgo go build sg.go

What is the expected output?

makes it to the link step with 6g

What do you see instead?

compile errors with gccgo:

_cgo_defun.c:36:1: error: unknown type name ‘byte’
_cgo_defun.c:37:1: error: stray ‘\302’ in program
_cgo_defun.c:37:1: error: stray ‘\267’ in program

Which compiler are you using (5g, 6g, 8g, gccgo)?

gccgo

Which operating system are you using?

linux

Which revision are you using?  (hg identify)

gccgo (GCC) 4.7.0 20120302
commit f2b34014d56c08d8fa5d93a2329e92046215de6d
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184877
138bc75d-0d04-0410-961f-82ee72b054a4

Please provide any additional information below.

The problematic lines in _cgo_defun.c:

extern byte *sg_lib_version_str;
void *·_Cvar_sg_lib_version_str = &sg_lib_version_str;

Attachments:

  1. sg.go (138 bytes)
@dsymonds
Copy link
Contributor

dsymonds commented Mar 4, 2012

Comment 1:

Labels changed: added priority-go1, cgo, removed priority-triage.

@minux
Copy link
Member

minux commented Mar 13, 2012

Comment 2:

I think this is a duplicate of issue #2313.
The generated _cgo_defun.c is clearly for the 6c compiler.

@alberts
Copy link
Contributor Author

alberts commented Mar 13, 2012

Comment 3:

Yes, I think this issue is at least part of what is described in issue #2313.

@minux
Copy link
Member

minux commented Mar 13, 2012

Comment 4:

Status changed to Duplicate.

Merged into issue #2313.

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@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
Development

No branches or pull requests

5 participants