-
-
Notifications
You must be signed in to change notification settings - Fork 673
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
Allow pure without purego #3959
Comments
@mattyclarkson I think we (at least I) missed the interaction with
We might have to roll back as not having a C++ toolchain doesn't mean you don't want (or can't get) What's the situation for circl? Could we add |
The upstream change I did for I didn't even know that there was a Go flavour of asssembly 😊 If that is what is in curve_amd64.s, then the
I'm OK to rollback to fix the performance regression. I feel the fix is upstream though.
As far as I understand it, unless a project respects the
In This is the current setup for the build flags based on what is enabled in the
Note: Projects could enable C toolchain ASM when both I'm not a GoLang expert so unsure how these build variant parts interact. |
I don't think pure ASM will generally require a C toolchain. Let's say I use Go's assembly flavor to implement some code that needs to be "constant time". We will use some of the CPU architecture underlying instructions without having a dependency on external libraries. When it comes to linking Go's internal linker might try to load libraries from the toolchain (e.g. libgcc).
Indeed. This is where the performance degradation stems from.
Yes. That directly invokes the compiler and has external dependencies.
|
When cgo is enabled the resulting binary will have a dependency on the C library. I think adding a row to the table on whether on Linux the resulting go binary has external dependencies would be helpful. |
What version of rules_go are you using?
0.48.0
What version of gazelle are you using?
0.36.0
What version of Bazel are you using?
bazel 6.4.x
Does this issue reproduce with the latest releases of all the above?
yes
What operating system and processor architecture are you using?
Linux
Any other potentially useful information about your toolchain?
The application is built with
--@io_bazel_rules_go//go/config:pure
to have no dependencies on GLIBC (or any other c library) as this allows building minimal container images.What did you do?
Upgraded an application that uses google.golang.org/protobuf to the latest release of rules_go.
What did you expect to see?
No changes in performance.
What did you see instead?
The performance of the application has greatly reduced. Enabling "pure" now implies not using pointer arithmetic (https://github.com/search?q=repo%3Aprotocolbuffers%2Fprotobuf-go%20purego&type=code).
While it seems possible to add
gotags
in ago_binary
it doesn't seem possible to take them away. Usingcgo = False
will still produce a dynamically linked executable (and require glibc at runtime).The text was updated successfully, but these errors were encountered: