rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.86k stars 12.67k forks source link

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

Open Zoxc opened 8 years ago

Zoxc commented 8 years ago

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 commented 8 years ago

Quoth he. ;)

steveklabnik commented 8 years ago

Yes, you need quotes.

Zoxc commented 8 years ago

What kind of quotes? Also that should be documented somewhere

alexcrichton commented 8 years ago

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.

l0calh05t commented 8 years ago

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 commented 8 years ago

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 commented 5 years ago

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

retep998 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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