-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/go: consider path to the C and C++ compiler executable when deciding when to recompile CGO packages #40042
Comments
Can you show us a short example? I can think of a few different things you might mean, and I want to be sure that we understand the actual problem that you are encountering. Thanks. |
I`ve had some problems when the linker from GCC10.1.0 tried to link artifacts compiled by GCC9.2, specifically when doing link-time-optimization as the different compilers can't read the others LTO representation. |
@Keithcat1 Could you please add:
The |
Hi, |
I think the current mechanism is to use the value of the environment variable I guess the question for the go tool is whether it should call |
We may want to invoke the C compiler to incorporate some version information, too. We do something that for the Go compiler and other tools. |
Sure, you can get real information about the C compiler by using |
Maybe just make an SHA256 hash of the C compiler and recompile if it changes? |
The C compiler is a collection of different programs, so computing a hash is not trivial. The |
Change https://golang.org/cl/314276 mentions this issue: |
Change https://golang.org/cl/335409 mentions this issue: |
No test because a real test requires installing two different compilers. For #40042 For #47251 Change-Id: Iefddd67830d242a119378b7ce20be481904806e4 Reviewed-on: https://go-review.googlesource.com/c/go/+/335409 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
I have 2 versions of GCC on my computer, but it seems that Go can't tell the difference. It would be good if Go remembered the path to the compiler executables and recompile if it changed to avoide incompatibilities.
The text was updated successfully, but these errors were encountered: