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

-C link-args and -C llvm-args can't pass arguments with spaces #30947

Open
Zoxc opened this issue Jan 16, 2016 · 10 comments
Open

-C link-args and -C llvm-args can't pass arguments with spaces #30947

Zoxc opened this issue Jan 16, 2016 · 10 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Zoxc
Copy link
Contributor

Zoxc commented Jan 16, 2016

The arguments passed in -C link-args and -C llvm-args is split by spaces making it impossible to pass along paths with spaces in them.

@MagaTailor
Copy link

Quoth he. ;)

@steveklabnik
Copy link
Member

Yes, you need quotes.

@Zoxc
Copy link
Contributor Author

Zoxc commented Jan 26, 2016

What kind of quotes? Also that should be documented somewhere

@alexcrichton
Copy link
Member

Ah this is actually an issue about if you want to pass the argument "foo bar" down to the linker you can't do that, for example rustc -C link-args="foo bar" will pass two arguments down to the linker, first foo then bar.

I'm going to reopen this for now, but there may not be a whole lot we can do here, as inventing our own syntax for escaping spaces is both onerous and unfortunately backwards incompatible.

@alexcrichton alexcrichton reopened this Jan 26, 2016
@l0calh05t
Copy link

This is also an issue when using the MSVC linker and passing /manifestdependency flags which always contain spaces such as (for example):

/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'

This is currently impossible.

@pnkfelix
Copy link
Member

pnkfelix commented Apr 28, 2016

Could we accept multiple occurrences of -C link-args=... and then accumulate them all into one space-separated collection of arguments?

(oops, I misunderstood the problem that @alexcrichton described; my suggestion won't address that.)

@steveklabnik steveklabnik added the A-frontend Area: Compiler frontend (errors, parsing and HIR) label Jul 25, 2016
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 24, 2017
@steveklabnik
Copy link
Member

Triage: I agree with @alexcrichton , I'm not sure what we can do here :(

@retep998
Copy link
Member

retep998 commented Nov 1, 2018

Switch to -Clink-arg and -Cllvm-arg which take only a single argument which can contain spaces. If they don't exist then they need to be implemented.

@MabezDev
Copy link
Contributor

MabezDev commented Aug 26, 2019

@retep998 Seems like -Cllvm-arg has dissapeared? Only -Cllvm-args exists which has the space issue (in my case I am looking to omit frame pointers with --frame-pointer none)

@retep998
Copy link
Member

It didn't disappear. It simply never existed in the first place and still needs to be implemented.

@Enselic Enselic added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed C-bug Category: This is a bug. labels Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

10 participants