-
Notifications
You must be signed in to change notification settings - Fork 17.3k
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
runtime/cgo: x_cgo_getstackbound()
broken on SmartOS
#67353
Comments
Does SmartOS have a different macro that can be tested with Would you like to send a patch to fix this? See https://go.dev/doc/contribute. Thanks. |
Unfortunately I don't know much about SmartOS internals, I just found the issue and I happened to have some time to investigate. I am also unable to contribute a fix directly, even though I will try to find a proper solution. Looking through the output of
I don't have a machine running another Illumos flavor to check, but I do not expect them to be unique to SmartOS. |
CC @golang/illumos. |
G'day! @bardo The Thanks, and sorry for the trouble here! |
@jclulow no need to apologize at all. In fact, answering your question clarified quite a bit. I was wondering myself what the rationale would be behind not setting The short answer is that this is probably a limitation of the The longer answer is that GCC binary comes from the gcc9-9.3.0 package, which indeed is the only GCC version I had installed:
However, that package is not present in the repositories (anymore).
So my reasoning is that it has been removed in favor of newer versions, even though pkgsrc's inability (or sane unwillingness) to do a major version upgrade silently left the outdated version around. I imagine that GCC7 is there just for compatibility reasons. Curious, I installed both available versions to check for the macro, and indeed:
Meaning that it has been added somewhere between GCC10 and GCC13. So my specific issue is fixed, however the cgo minimum requirements report GCC4.6, potentially putting GCC7 firmly in scope. Is an issue needed on the SmartOS side or can we trust that a newer GCC will be used when available? |
I think we can say that the minimum GCC version on SmartOS is GCC 13. |
Great, feel free to close here, then, and apologies for the noise. |
I will investigate and get back to you with some specifics on our end! |
Thanks. |
Go version
go version go1.22.2 illumos/amd64
Output of
go env
in your module/workspace:What did you do?
Applications that rely on
x_cgo_getstackbound()
(in this case, Navidrome) are broken on SmartOS due to an incorrect macro check.What did you see happen?
Error:
What did you expect to see?
The current implementation of
x_cgo_getstackbound()
relies on the__illumos__
macro being defined platforms to callpthread_attr_init()
as needed:go/src/runtime/cgo/gcc_stack_unix.c
Lines 21 to 30 in 8623c0b
SmartOS, being Illumos-derived, requires the same treatment, however it does not define the
__illumos__
macro, falling into the first branch of the#ifdef
and leading to the error.Test program:
Output:
The text was updated successfully, but these errors were encountered: