Skip to content
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

Support rust lld @file command line arguments #95

Closed
great-houk opened this issue Jul 9, 2024 · 2 comments · Fixed by #96
Closed

Support rust lld @file command line arguments #95

great-houk opened this issue Jul 9, 2024 · 2 comments · Fixed by #96

Comments

@great-houk
Copy link
Contributor

I don't know exactly why this is a thing, but when the arguments passed to rust lld are too long (?) it gets passed a special argument (at the bottom of this page) that refers to a file. Currently, flip-link doesn't seem to handle this.

I've made a fork that "fixes" the bug by just hardcoding support and using a bunch of unwraps here, but I imagine someone who knows how linkers work and can make a good solution should be the one to make the PR.

@jonathanpallant
Copy link
Contributor

It's because operating systems place a fairly small upper bound on the length of a command line. I think it's 8191 bytes on Windows. We should handle this, I agree.

@Urhengulas
Copy link
Member

@great-houk The documentation does not state that the argument can only be in last position. From reading the docs I'd assume it can be in any. Unless it is specified somewhere else we should support it in any position.

Also can there only be one of those arguments or also multiple?

Can you open a PR with your changes? I think you can get rid of some unwraps by using if let and the like.

Btw, if you click on a heading you can link to it directly: https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants