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

rustc does not recognize "is-like-msvc" properly? #32818

Closed
pravic opened this issue Apr 8, 2016 · 5 comments
Closed

rustc does not recognize "is-like-msvc" properly? #32818

pravic opened this issue Apr 8, 2016 · 5 comments

Comments

@pravic
Copy link
Contributor

pravic commented Apr 8, 2016

Here is a gist with the target specification.

When "linker": "link.exe" is specified, I get the following:

rustc --target=i786-pc-windows-msvc.json --crate-type=dylib lib.rs
note: LINK : warning LNK4044: unrecognized option '/L'; ignored
LINK : warning LNK4044: unrecognized option '/o'; ignored
LINK : warning LNK4044: unrecognized option '/nodefaultlibs'; ignored
LINK : warning LNK4044: unrecognized option '/L'; ignored
LINK : warning LNK4044: unrecognized option '/Wl,-Bstatic'; ignored
LINK : warning LNK4044: unrecognized option '/Wl,-Bdynamic'; ignored
LINK : warning LNK4044: unrecognized option '/shared'; ignored

If omit it, rustc calls cc:

rustc --target=i786-pc-windows-msvc.json --crate-type=dylib lib.rs
error: could not exec the linker `cc`

Why? This code shows that is-like-msvc must handle it properly. And such things as "-Wl,-Bstatic" is coming from GnuLinker.

Meta:

rustc 1.9.0-nightly (bf5da36 2016-04-06)
binary: rustc
commit-hash: bf5da36
commit-date: 2016-04-06
host: i686-pc-windows-msvc
release: 1.9.0-nightly

@Aatch
Copy link
Contributor

Aatch commented Apr 8, 2016

That option isn't settable from JSON. This https://github.com/rust-lang/rust/blob/master/src/librustc_back/target/mod.rs#L419, plus a few other keys are supported.

It probably should be settable from the JSON.

@pravic
Copy link
Contributor Author

pravic commented Apr 8, 2016

Thanks.

Guess reasonable keys which are missing are

is_like_android: false,
is_like_msvc: false,
is_like_solaris: false,

@cardoe
Copy link
Contributor

cardoe commented Apr 11, 2016

Guess reasonable keys which are missing are

is_like_android: false,
is_like_msvc: false,
is_like_solaris: false,

Was there a reason for leaving the android and solaris ones out?

steveklabnik added a commit to steveklabnik/rust that referenced this issue Apr 11, 2016
Read "is-like-msvc" target option from JSON

This is in reference to rust-lang#32818.
@pravic
Copy link
Contributor Author

pravic commented Apr 14, 2016

Issue was fixed at #32823 and landed with 2016-04-12 nightly.

@pravic pravic closed this as completed Apr 14, 2016
@pravic
Copy link
Contributor Author

pravic commented Apr 14, 2016

Idk about testcases, may be they needed for this.

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

No branches or pull requests

3 participants