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: document mininum gcc version #43605

Closed
rittneje opened this issue Jan 9, 2021 · 5 comments
Closed

cmd/cgo: document mininum gcc version #43605

rittneje opened this issue Jan 9, 2021 · 5 comments

Comments

@rittneje
Copy link

rittneje commented Jan 9, 2021

When generating _cgo_export.c, cgo outputs several #pragma GCC diagnostic ignored directives. Such pragmas were introduced in gcc 4.6 (https://www.gnu.org/software/gcc/gcc-4.6/changes.html), so it would seem that at least that version is expected. (Ironically, the first pragma is to ignore unknown pragmas, but an older GCC will consider that to be an unknown pragma.)

Unfortunately, I can't find anywhere that the minimum version has been documented. It would be helpful if it were included on one of the wiki pages, such as https://github.com/golang/go/wiki/MinimumRequirements or https://github.com/golang/go/wiki/cgo.

@ianlancetaylor ianlancetaylor changed the title cgo: document mininum gcc version cmd/cgo: document mininum gcc version Jan 9, 2021
@ianlancetaylor
Copy link
Contributor

GCC 4.6 was released in 2011.

I think it would be fine to add this the MinimumRequirements wiki page. Anybody can do that.

@ALTree
Copy link
Member

ALTree commented Jan 9, 2021

I added this to MinimumRequirements. Closing here, but feel free to edit my wording if you wish.

@dwillemv
Copy link

We are using gcc version 4.8.3.
We are getting failures similar to those described at:
#44880
Using go 1.16.3.

With the repro from that case, the output looks like:
/home/willem/development/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /dev/shm/go-link-383363645/000005.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

What is the correct minimum gcc version?

@ALTree
Copy link
Member

ALTree commented Apr 15, 2021

@dwillemv Are you sure you're not just hitting #43996?

@dwillemv
Copy link

You are correct. We are indeed hitting #43996. Thanks for the help.

@golang golang locked and limited conversation to collaborators Apr 15, 2022
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