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

Don't pass -fno-use-linker-plugin on OS X #17192

Merged
merged 1 commit into from
Sep 15, 2014
Merged

Conversation

skade
Copy link
Contributor

@skade skade commented Sep 12, 2014

Don't pass -fno-use-linker-plugin on OS X as clang does not accept it.

clang fails linking with:

error: linking with `cc` failed: exit code: 1
... arg list omitted...
note: clang: error: unknown argument: '-fno-use-linker-plugin' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

clang version:

$ clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix

@thestinger
Copy link
Contributor

This also breaks with Clang on Linux. It should probably only pass it on Windows.

@skade
Copy link
Contributor Author

skade commented Sep 12, 2014

What would be the correct path here? As far as I see, the actual compiler isn't currently detected, just the OS.

@alexcrichton
Copy link
Member

Can you change the if statement to sess.targ_cfg.os == abi::Windows ?

@vadimcn
Copy link
Contributor

vadimcn commented Sep 13, 2014

Rust makefiles do know when clang's being used ($CFG_USING_CLANG), so we could set ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future". But as the option name alludes, this is only a temporary solution...

@pnkfelix
Copy link
Member

@alexcrichton long-term, should we expose which compiler we are using for linking ?

(I actually went ahead and made a branch that does this. Its pretty simple; I'll put up a PR after I ensure it bootstraps.)

@pnkfelix
Copy link
Member

closing in favor of PR #17231

@pnkfelix pnkfelix closed this Sep 13, 2014
@pnkfelix
Copy link
Member

Reopening in case I never revise #17231

@pnkfelix pnkfelix reopened this Sep 13, 2014
pnkfelix added a commit to pnkfelix/rust that referenced this pull request Sep 14, 2014
The detected categorization is memoized in the Session object.

The link.rs backend then uses this information when choosing options
to add to the `cc` command line arguments (currently it just affects a
single option that will cause a hard error in clang in the future).

This is meant to be, in part, a more robust version of PR rust-lang#17192.

As drive-bys:

  * fix an english grammar mistake in a comment.

  * replace the use of `String` with `&str` for the program names
    corresponding `cc` and `ar`, avoiding unnecessary string copies
    but more importantly making the code overall look nicer.  :)

Fix rust-lang#17214.

(Addressed review nits from nrc and acrichto.)
@thestinger
Copy link
Contributor

I don't really understand why we need to pass this at all. Why do we need to explicitly disable the linker plugin for GCC, but not Clang's linker plugin?

@alexcrichton
Copy link
Member

We're now bundling mingw executables with the windows distribution, and we want to explicitly disable the linker plugin on windows to avoid pulling in lots of extra dependencies we don't want to bundle.

@skade, could you modify the if-clause to only pass this argument on windows? This looks like it's breaking more recent OSX builds.

Only pass -fno-use-linker-plugin on Windows where it avoids pulling in
dependencies. Passing it to clang on OS X and Linux would make it fail
though.
@skade
Copy link
Contributor Author

skade commented Sep 15, 2014

@alexcrichton sure, here you go. Builds on my OS X machine (tm).

bors added a commit that referenced this pull request Sep 15, 2014
Don't pass -fno-use-linker-plugin on OS X as clang does not accept it.

clang fails linking with:

```
error: linking with `cc` failed: exit code: 1
... arg list omitted...
note: clang: error: unknown argument: '-fno-use-linker-plugin' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
```

clang version:

```
$ clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix
```
@bors bors closed this Sep 15, 2014
@bors bors merged commit e9c4efb into rust-lang:master Sep 15, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request May 19, 2024
Fix source_range for INT_NUMBER in completion

fix rust-lang#17179.

Previously r-a use `TextRange::empty(self.position.offset)` as `source_range` for `INT_NUMBER`, so the `text_edit` would always be an insertion, which results in rust-lang#17179.

This PR changed it by using `text_range` of `original_token` (same as `IDENT`).
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 this pull request may close these issues.

6 participants