-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
coff: Add initial Coff support #1
Conversation
4068ce2
to
e8a8ade
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @Pombal! Just one nit that I'd like you comment on before I merge it into master.
src/Coff.zig
Outdated
const file = try options.emit.directory.createFile(options.emit.sub_path, .{ | ||
.truncate = true, | ||
.read = true, | ||
.mode = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should include a check like in other backends when using zld
to cross-link to a foreign platform from Linux say.
.mode = 0, | |
.mode = if (std.Target.current.os.tag == .windows) 0 else 0o777, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that's fixed now. I thought it would only be used on Windows platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the idea is that in principle since zld
is written in Zig, it can easily be cross-compiled for any platform which we should make use by giving the possibility to easily cross-link to any platform too. It will obviously be lacking in this department all of the automation tooling that goes with Zig proper, but this where once would use the zig ld
abstraction embedded directly in Zig toolchain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'm not sure how this works with cross-linking to Windows from Linux while testing in Wine. Something I need to give a look but didn't yet. It might not be needed indeed, but for consistency I'd like for all linker backends to set the mode correctly :-)
Also, do you mind changing the README to say that work on COFF is now officially in progress? |
I would rather not do that until I'm more certain I have the bandwidth to work on this for an extended period of time. But I can make the change if you'd prefer it. |
I'm good with either TBH, and just so we're clear, there is absolutely no pressure! |
No description provided.