-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[MachO] error: unsupported linker arg: -no_pie #15438
Comments
Related: #15439 |
I don't think we ever wanted to enable non PIE builds on macOS mainly because it is x86_64 specific. Thoughts? |
I personally don't care much about it nor truly understand the impact on this flag. I am reporting the issue, because Go just adds it on x86_64. We need some way to make Go compile the CGo binaries for x86_64-macos. Here is the CR in Go that added it: https://go-review.googlesource.com/c/go/+/201358 Or do we really need it? x86_64-macos is on the verge of being abandoned by Apple altogether. |
This flag is required to disambiguate position-dependent from position-independent code models generated by the compiler. The linker has no idea which model it should assume which is important to correctly apply relocations and relaxations. If Apple is on the verge of discontinuing |
Hit " |
Does CGo actually require position-dependent code? In any case, for Clang-level arguments, we currently handle |
There's way more than just forwarding a flag to the linker. We are actually missing all of non-pic/pie handling in the linker, so no, it's not a simple change. |
I think you misunderstood my comment? I'm acknowledging exactly that. |
What I'm saying is: We already handle the Clang-level (no-)PIE flags by setting So I'm suggesting that we can just do the same for the |
See ziglang#15438 for a case where it appears.
See ziglang#15438 for a case where it appears.
The dotnet AOT toolchain uses these related lld/bfd flags: |
See ziglang#15438 for a case where it appears.
See ziglang#15438 for a case where it appears.
See ziglang#15438 for a case where it appears.
Please note this issue is low priority for me especially since Apple ditched |
See ziglang#15438 for a case where it appears.
Currently we cannot compile CGo programs to MacOS (at least x86_64) with default settings. Example Go file:
main.go
Compile to MacOS
The text was updated successfully, but these errors were encountered: