-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Allow COFF output for freestanding target #3182
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
I think we can add this as a DOS OS. That should be a pretty straightforward modification. Then you could use |
Another option here is something like: // main.zig
pub const debug_info_type = .COFF; // or .ELF, .Auto
pub fn main() void {} |
If it's possible, add support for allowing arbitrary overrides of the output format for the user. The linker could output PE, COFF, ECOFF, ELF, flat binaries, ihex, .... This would allow something like This is especially interesting for freestanding targets if you write plugins/modules for custom/embedded systems. |
Same as #2826 (but add COFF?) |
My original use-case for this issue has been obsoleted. I am now using a linker script to produce a MZ executable that subsequently loads and runs an ELF executable. That said, making output format configurable is probably still desirable. |
After some investigation, I've found LLVM will never output COFF objects unless the target triple is This seems to leave three options: (1) change LLVM's behavior, (2) add a separate |
LLVM target triples can actually encode the object format in all cases. For this use case, |
I am experimenting with linking Zig libraries into DOS executables using the Open Watcom toolchain. The Watcom linker seems to require COFF because it does not understand ELF. When building the Zig library, I cannot figure out how to target freestanding and get COFF output. For now, I am using
i386-uefi-none
as my target.The text was updated successfully, but these errors were encountered: