-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Failure cross-compiling for ARM #2290
Comments
Hi, @jayconrod Does If Go is cross-compiled separately, you can use
|
@yicm rules_go does support platform-based construction. The document you linked is out of date, as noted at the top. Not sure how that |
@jayconrod The question I want to ask is not clearly expressed, so I should make it clear here #2089 (comment), Thank you for your reply. |
The issue is GoStdLib ( Maybe the best way to solve this is to add a cc-wrapper mode to the builder. When invoking go, CC should be set to use this wrapper. The wrapper could change the current directory back to the bazel execroot and transform input/output parameters and possibly any includes added by the go compiler on the fly to absolute paths. This is the opposite of what is attempted currently, but a more robust solution that could support all toolchain implementations and flags. |
This change was made to address this issue: bazel-contrib/rules_go#2290
I ran into this issue today, and took a path that was inspired by @kalcutter 's advice. However, rather than changing directory and transforming the input/output parameters, I constructed a relative path to the toolchain binaries that is relative to the path of the wrapper scripts themselves rather than relative to the current working directory. |
@bsirang Yes that is the best strategy when writing a toolchain. My LLVM toolchain does exactly the same thing: https://github.com/kalcutter/bazel-llvm-toolchain/commit/360c56833e45f39ab08a2a9f638726a95bf404e9. |
What version of rules_go are you using?
0.20.2
What version of gazelle are you using?
0.19.1
What version of Bazel are you using?
1.2.0
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
darwin/amd64
Any other potentially useful information about your toolchain?
I adopted the toolchain from Bazel's cc_toolchain test.
Made slight modifications to fit the toolchain into my repo, and to match
rules_go
cross-compile recommendations. Specifically I://toolchain
.armeabi-v7a
toarm
so that rules_go would pick up the toolchain.What did you do?
.bazelrc:
Then:
What did you expect to see?
Cross-compiled binary success.
What did you see instead?
Looks like rules_go is not playing nicely with the
cc_toolchain
(gcc is run from the wrong directory?)Help would be much appreciated!
The text was updated successfully, but these errors were encountered: