-
-
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
Improve *BSD native ABI detection #9089
Comments
zig and llvm model things slightly differently:
Along those lines we could simply do this:
But don't we actually want to capture the idea that Thoughts? |
When targeting ARM you still want to specify EABI/EABIHF as ABI, at least for *BSD targets.
On the LLVM side |
Nowadays we handle |
"target": "x86_64-freebsd.14.1...14.1-gnu",
"target": "x86_64-netbsd.10.0...10.0-gnu",
"target": "x86_64-openbsd.7.5...7.5-gnu", |
…F hosts. Since we exclude Abi.none from the list of ABIs to be tested, it means that Abi.gnu, which happens to be the first in the list, always gets picked for hosts where the dynamic linker path does not depend on the ABI component of the triple. Such hosts include all the BSDs, Haiku, Serenity, Solaris, etc. To fix this, use DynamicLinker.kind() to determine whether this whole exercise even makes sense. If it doesn't, as is the case on every OS other than Linux and Hurd, we'll just fall back to Abi.default() which will try to pick a sensible default based on the arch and OS components. This detection logic still has plenty of room for improvement, but is at least a notable step up from confusingly detecting Abi.gnu ~everywhere. Closes ziglang#9089.
…F hosts. Since we exclude Abi.none from the list of ABIs to be tested, it means that Abi.gnu, which happens to be the first in the list, always gets picked for hosts where the dynamic linker path does not depend on the ABI component of the triple. Such hosts include all the BSDs, Haiku, Serenity, Solaris, etc. To fix this, use DynamicLinker.kind() to determine whether this whole exercise even makes sense. If it doesn't, as is the case on every OS other than Linux and Hurd, we'll just fall back to Abi.default() which will try to pick a sensible default based on the arch and OS components. This detection logic still has plenty of room for improvement, but is at least a notable step up from confusingly detecting Abi.gnu ~everywhere. Closes ziglang#9089.
…F hosts. Since we exclude Abi.none from the list of ABIs to be tested, it means that Abi.gnu, which happens to be the first in the list, always gets picked for hosts where the dynamic linker path does not depend on the ABI component of the triple. Such hosts include all the BSDs, Haiku, Serenity, Solaris, etc. To fix this, use DynamicLinker.kind() to determine whether this whole exercise even makes sense. If it doesn't, as is the case on every OS other than Linux and Hurd, we'll just fall back to Abi.default() which will try to pick a sensible default based on the arch and OS components. This detection logic still has plenty of room for improvement, but is at least a notable step up from confusingly detecting Abi.gnu ~everywhere. Closes ziglang#9089.
At the moment zig detects the native ABI as
.gnu
, that may cause some problems as many *BSD libcs are not fully gnu-compliant (eg. NetBSD has nosincos
, a GNU extension, but since we're passing LLVM the wrong triple we end up with some missing symbols).cc @mikdusan as I guess you'd love some BSD action
The text was updated successfully, but these errors were encountered: