You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhancementSolving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.os-freebsdFreeBSDos-openbsdOpenBSD
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 no sincos, 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
Target.abi.none vs (Triple.Environment.unknown and .hasEnvironment())
currently when Target.abi == none we omit the Environment string component of -triple and it ends up as hasEnvironment() == false
Along those lines we could simply do this:
set .abi = .none when detecting target on *bsd hosts (and darwin)
bad: this lies to the reader because we in fact have an ABI
But don't we actually want to capture the idea that .abi is optional? We could either do that through using zig optional but it would have higher impact on src/*.zig codebase, or we could add enum .unspecified or similar.
enhancementSolving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.os-freebsdFreeBSDos-openbsdOpenBSD
Activity
mikdusan commentedon Jun 12, 2021
-triplefor bothzig ccand systemclangfor compilingempty.con a freebsd hostzig and llvm model things slightly differently:
Target.abi.nonevs (Triple.Environment.unknownand.hasEnvironment())Target.abi == nonewe omit the Environment string component of-tripleand it ends up ashasEnvironment() == falseAlong those lines we could simply do this:
.abi = .nonewhen detecting target on *bsd hosts (and darwin)But don't we actually want to capture the idea that
.abiis optional? We could either do that through using zig optional but it would have higher impact on src/*.zig codebase, or we could add enum.unspecifiedor similar.Thoughts?
LemonBoy commentedon Jun 12, 2021
When targeting ARM you still want to specify EABI/EABIHF as ABI, at least for *BSD targets.
On the LLVM side
.nonedoesn't really mean "no ABI" but more "unspecified, do not make any assumption".alexrp commentedon Aug 27, 2024
Nowadays we handle
Abi.noneby emittingunknownas the ABI component. @mikdusan can you confirm whether this issue is still actually relevant?mikdusan commentedon Aug 27, 2024
zig envstill detects/setsgnuas the ABI on the BSDs: