-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: cgo generates incorrect symbols on macOS 13 beta 5 #54482
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
Comments
What version of the C linker are you using? I.e. the output of |
|
Installing Xcode-beta on macOS 12, you get the first error, but the build succeeds:
$ ld -v
@(#)PROGRAM:ld PROJECT:ld64-819.1.2
BUILD 18:34:18 Jun 30 2022
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 14.0.0, (clang-1400.0.28.1) (static support for 29, runtime is 29)
TAPI support using: Apple TAPI version 14.0.0 (tapi-1400.0.11) |
I am running into the same issue, with the addition that it causes GoLand to fail my tests.
|
I'm having this issue too. Seems like it started happening after installing XCode 14.
MacOS 12.5 (21G72) |
Tengo el mismo problema, mis configuraciones son las siguientes: MacOs version 12.6
Mensaje de error obtenido: |
Same problem after installing mac updates today :(
|
For anyone who see the "same problem", are you seeing the I can reproduce the warning, but I have never been able to reproduce the error. The warnings are not errors. The build should still succeed, generate a binary that should run fine. (We still want to address that. But it doesn't block you from building your code.) Thanks. |
Hi! Thanks for the reply. I was referring to |
@MitchStephan thanks! Yeah, although it is just a warning we still want to address it. It is also affects tests in the Go distribution. |
@cherrymui any debug info I can help with? I'm still seeing the error which prevents the listed code snippet from running |
Change https://go.dev/cl/430936 mentions this issue: |
Does the (To be clear, we still want to fix the warning. Just for better understanding. Thanks.) |
Change https://go.dev/cl/430937 mentions this issue: |
If I run tests outside of my IDE, I still get the warning, but I do not get the fail. I only get the fail on bulk test runs within the scope of my IDE, making me think it's a configuration issue in the IDE and not go that's failing the test runs. |
We added -pagezero_size in CL 72730, where it was intented for iOS. The current code passes it only on macOS/AMD64 instead. It is not really necessary there. Also, the new darwin linker starts to emit a warning about deprecation of the flag. Stop passing it. For #54482. Change-Id: If9db7a1645c37d4284e48f075856912df8d8c1a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/430936 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com>
@krohmag Same warning message as in IDE, and no evidence of test execution either. |
Apparently the new darwin linker starts to emit a warning about -no_pie deprecation. Maybe we want to switch to PIE by default. For now, suppress the warning. This also makes it easier for backporting to previous releases. For #54482. Change-Id: I1a3b74c237a9d00ec3b030fc3a9940a31e5cd37e Reviewed-on: https://go-review.googlesource.com/c/go/+/430937 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
With the two CLs above submitted it should no longer emit the warnings. I'll work on backport the fix to 1.18 and 1.19 releases. Thanks. |
Change https://go.dev/cl/431515 mentions this issue: |
Change https://go.dev/cl/431516 mentions this issue: |
Change https://go.dev/cl/431517 mentions this issue: |
Ohhhhh okay that solved it. That was somewhat unexpected, thanks! |
Excuse me @cherrymui, what should I do to prevent the warnings from appearing? |
There are a few options:
|
FWIW, I see this warning when building Go from the branch
|
…in linker We added -pagezero_size in CL 72730, where it was intented for iOS. The current code passes it only on macOS/AMD64 instead. It is not really necessary there. Also, the new darwin linker starts to emit a warning about deprecation of the flag. Stop passing it. For #55113 Updates #54482, #55112. Change-Id: If9db7a1645c37d4284e48f075856912df8d8c1a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/430936 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> (cherry picked from commit 5231ba2) Reviewed-on: https://go-review.googlesource.com/c/go/+/431516 Reviewed-by: Austin Clements <austin@google.com>
…in linker We added -pagezero_size in CL 72730, where it was intented for iOS. The current code passes it only on macOS/AMD64 instead. It is not really necessary there. Also, the new darwin linker starts to emit a warning about deprecation of the flag. Stop passing it. For #55114. Updates #55112, #54482. Change-Id: If9db7a1645c37d4284e48f075856912df8d8c1a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/430936 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> (cherry picked from commit 5231ba2) Reviewed-on: https://go-review.googlesource.com/c/go/+/431515 Reviewed-by: Austin Clements <austin@google.com>
…g on darwin Apparently the new darwin linker starts to emit a warning about -no_pie deprecation. Maybe we want to switch to PIE by default. For now, suppress the warning. This also makes it easier for backporting to previous releases. Fixes #55114. Updates #55112, #54482. Change-Id: I1a3b74c237a9d00ec3b030fc3a9940a31e5cd37e Reviewed-on: https://go-review.googlesource.com/c/go/+/430937 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 706d84f) Reviewed-on: https://go-review.googlesource.com/c/go/+/431517
…g on darwin Apparently the new darwin linker starts to emit a warning about -no_pie deprecation. Maybe we want to switch to PIE by default. For now, suppress the warning. This also makes it easier for backporting to previous releases. Fixes #55113. Updates #55112, #54482. Change-Id: I1a3b74c237a9d00ec3b030fc3a9940a31e5cd37e Reviewed-on: https://go-review.googlesource.com/c/go/+/430937 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 706d84f) Reviewed-on: https://go-review.googlesource.com/c/go/+/431518 Reviewed-by: Austin Clements <austin@google.com>
Excuse me @cherrymui, if I need to use
have any suggestion to solve this conflict if I want prevent the warnings and pass |
…in linker We added -pagezero_size in CL 72730, where it was intented for iOS. The current code passes it only on macOS/AMD64 instead. It is not really necessary there. Also, the new darwin linker starts to emit a warning about deprecation of the flag. Stop passing it. For golang#55114. Updates golang#55112, golang#54482. Change-Id: If9db7a1645c37d4284e48f075856912df8d8c1a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/430936 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> (cherry picked from commit 5231ba2) Reviewed-on: https://go-review.googlesource.com/c/go/+/431515 Reviewed-by: Austin Clements <austin@google.com>
…g on darwin Apparently the new darwin linker starts to emit a warning about -no_pie deprecation. Maybe we want to switch to PIE by default. For now, suppress the warning. This also makes it easier for backporting to previous releases. Fixes golang#55114. Updates golang#55112, golang#54482. Change-Id: I1a3b74c237a9d00ec3b030fc3a9940a31e5cd37e Reviewed-on: https://go-review.googlesource.com/c/go/+/430937 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 706d84f) Reviewed-on: https://go-review.googlesource.com/c/go/+/431517
…in linker We added -pagezero_size in CL 72730, where it was intented for iOS. The current code passes it only on macOS/AMD64 instead. It is not really necessary there. Also, the new darwin linker starts to emit a warning about deprecation of the flag. Stop passing it. For golang#55114. Updates golang#55112, golang#54482. Change-Id: If9db7a1645c37d4284e48f075856912df8d8c1a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/430936 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> (cherry picked from commit 5231ba2) Reviewed-on: https://go-review.googlesource.com/c/go/+/431515 Reviewed-by: Austin Clements <austin@google.com>
…g on darwin Apparently the new darwin linker starts to emit a warning about -no_pie deprecation. Maybe we want to switch to PIE by default. For now, suppress the warning. This also makes it easier for backporting to previous releases. Fixes golang#55114. Updates golang#55112, golang#54482. Change-Id: I1a3b74c237a9d00ec3b030fc3a9940a31e5cd37e Reviewed-on: https://go-review.googlesource.com/c/go/+/430937 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 706d84f) Reviewed-on: https://go-review.googlesource.com/c/go/+/431517
…in linker We added -pagezero_size in CL 72730, where it was intented for iOS. The current code passes it only on macOS/AMD64 instead. It is not really necessary there. Also, the new darwin linker starts to emit a warning about deprecation of the flag. Stop passing it. For golang#55114. Updates golang#55112, golang#54482. Change-Id: If9db7a1645c37d4284e48f075856912df8d8c1a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/430936 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> (cherry picked from commit 5231ba2) Reviewed-on: https://go-review.googlesource.com/c/go/+/431515 Reviewed-by: Austin Clements <austin@google.com>
…g on darwin Apparently the new darwin linker starts to emit a warning about -no_pie deprecation. Maybe we want to switch to PIE by default. For now, suppress the warning. This also makes it easier for backporting to previous releases. Fixes golang#55114. Updates golang#55112, golang#54482. Change-Id: I1a3b74c237a9d00ec3b030fc3a9940a31e5cd37e Reviewed-on: https://go-review.googlesource.com/c/go/+/430937 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 706d84f) Reviewed-on: https://go-review.googlesource.com/c/go/+/431517
I upgraded from |
Change https://go.dev/cl/461697 mentions this issue: |
The recent version of darwin linker ld64 emits an warning about deprecation of the -no_pie flag. Further, the new darwin linker ld-prime ignores -no_pie flag and generates a PIE binary anyway. Switch to building PIE binaries by default. Updates #54482. Updates #61229. Change-Id: I81294dcd07a368a20e1349d56556ee2fdcb8df44 Reviewed-on: https://go-review.googlesource.com/c/go/+/461697 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
cpoc.go
cpoc.c
cpoc.h
What did you expect to see?
Correctly compiled cgo binary.
What did you see instead?
I'm guessing this is due to the beta-ness of the OS. Happy to provide more debug info to get this working.
The text was updated successfully, but these errors were encountered: