Commit Graph

55541 Commits

Author SHA1 Message Date
Jorge Aparicio
b38953709d rustc_back/target: remove musl_base
it's the same as linux_musl_base
2016-07-30 15:39:13 -05:00
Jorge Aparicio
f0ec906d18 arm-musl: statically link to libunwind 2016-07-30 15:39:13 -05:00
Jorge Aparicio
e50bcf3404 arm-musl: set max_atomic_width 2016-07-30 15:39:13 -05:00
Jorge Aparicio
9ffd0fe5a7 arm-musl targets now use cfg(env = "musl") 2016-07-30 15:39:13 -05:00
Timon Van Overveldt
f7247d1071 Add ARM MUSL targets.
The targets are:
- `arm-unknown-linux-musleabi`
- `arm-unknown-linux-musleabihf`
- `armv7-unknown-linux-musleabihf`

These mirror the existing `gnueabi` targets.

All of these targets produce fully static binaries, similar to the
x86 MUSL targets.

For now these targets can only be used with `--rustbuild` builds, as
https://github.com/rust-lang/compiler-rt/pull/22 only made the
necessary compiler-rt changes in the CMake configs, not the plain
GNU Make configs.

I've tested these targets GCC 5.3.0 compiled again musl-1.1.12
(downloaded from http://musl.codu.org/). An example `./configure`
invocation is:

```
./configure \
    --enable-rustbuild
    --target=arm-unknown-linux-musleabi \
    --musl-root="$MUSL_ROOT"
```

where `MUSL_ROOT` points to the `arm-linux-musleabi` prefix.
Usually that path will be of the form
`/foobar/arm-linux-musleabi/arm-linux-musleabi`.

Usually the cross-compile toolchain will live under
`/foobar/arm-linux-musleabi/bin`. That path should either by added
to your `PATH` variable, or you should add a section to your
`config.toml` as follows:

```
[target.arm-unknown-linux-musleabi]
cc = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-gcc"
cxx = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-g++"
```

As a prerequisite you'll also have to put a cross-compiled static
`libunwind.a` library in `$MUSL_ROOT/lib`. This is similar to [how
the x86_64 MUSL targets are built]
(https://doc.rust-lang.org/book/advanced-linking.html).
2016-07-30 15:39:13 -05:00
Timon Van Overveldt
57cad5722d Update gcc crate dependency to 0.3.27.
This is to pull in changes to support ARM MUSL targets.

This change also commits a couple of other cargo-generated changes
to other dependencies in the various Cargo.toml files.
2016-07-30 15:39:13 -05:00
bors
9dba50b059 Auto merge of #35069 - wesleywiser:too_many_symbols, r=alexcrichton
Only export #[no_mangle] extern symbols during LTO

Fixes #34985
2016-07-30 13:04:30 -07:00
bors
7f7969ef44 Auto merge of #35117 - aravind-pg:path, r=alexcrichton
On Windows, ensure PATH does not contain invalid character `"`

Fixes #34959.

r? @alexcrichton
2016-07-30 10:11:33 -07:00
Seo Sanghyeon
03652157f9 Suppress unused type parameter error when type has error field 2016-07-31 00:58:30 +09:00
Guillaume Gomez
fda473f00f Add urls in std::io types 2016-07-30 13:38:04 +02:00
bors
ffcbd2deb5 Auto merge of #35127 - Manishearth:rollup, r=Manishearth
Rollup of 8 pull requests

- Successful merges: #35049, #35058, #35063, #35080, #35090, #35094, #35104, #35106
- Failed merges:
2016-07-30 04:35:39 -07:00
Guillaume Gomez
2bed205d3b Add io::Take doc example 2016-07-30 13:30:41 +02:00
Manish Goregaokar
0b64a561f6 Rollup merge of #35106 - xen0n:issue-35082, r=alexcrichton
syntax_ext: format: fix ICE with bad named arguments

Fixes #35082 by guarding against a new case of malformed invocation not previously covered.

r? @alexcrichton
2016-07-30 13:44:47 +05:30
Manish Goregaokar
ce79972314 Rollup merge of #35104 - frewsxcv:linked-list-append, r=steveklabnik
Rewrite `collections::LinkedList::append` doc example.

None
2016-07-30 13:44:47 +05:30
Manish Goregaokar
6ea3ef7ac2 Rollup merge of #35094 - mcarton:multispan, r=jonathandturner
Revert "Remove unused methods from MultiSpan"

This reverts commit f7019a4e2f.

That commit removed the only way to make a suggestion with more than one substitute. That feature is not used directly by rustc but exists and is used by Clippy. Bring it back until we come up with a better solution (suggestions don't use span labels, so it would make sense for them to use their own type).
Rational there: https://github.com/Manishearth/rust-clippy/pull/1119.

r? @jonathandturner
Cc @Manishearth
2016-07-30 13:44:47 +05:30
Manish Goregaokar
e649a2535f Rollup merge of #35090 - michaelwoerister:get-rid-of-id-visitor, r=eddyb
intravisit: Fold functionality of IdVisitor into the regular Visitor.
2016-07-30 13:44:47 +05:30
Manish Goregaokar
26e22b8e2e Rollup merge of #35080 - jonathandturner:fix_numeric_expected_found, r=nikomatsakis
Rename _ to {integer} and {float} for unknown numeric types

This PR renames _ to {integer} or {float} for unknown numeric types, to help people parse error messages that have numeric types that haven't been nailed down.

Example:
```rust
fn main() {
    let x: String = 4;
}
```

Before:
```
error[E0308]: mismatched types
 --> quicktest.rs:2:21
  |
2 |     let x: String = 4;
  |                     ^ expected struct `std::string::String`, found integral variable
  |
  = note: expected type `std::string::String`
  = note:    found type `_`

error: aborting due to previous error
```

after:
```
error[E0308]: mismatched types
 --> quicktest.rs:2:21
  |
2 |     let x: String = 4;
  |                     ^ expected struct `std::string::String`, found integral variable
  |
  = note: expected type `std::string::String`
  = note:    found type `{integer}`

error: aborting due to previous error
```
```
2016-07-30 13:44:46 +05:30
Manish Goregaokar
8c6421fb17 Rollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names, r=nrc
resolve: Exclude inaccessible names from single imports

If a single import resolves to an inaccessible name in some but not all namespaces, avoid importing the name in the inaccessible namespaces.

Currently, the inaccessible namespaces are imported but cause a privacy error when used.

r? @nrc
2016-07-30 13:44:46 +05:30
Manish Goregaokar
6234610252 Rollup merge of #35058 - jethrogb:no_panic_abs, r=alexcrichton
Add non-panicking abs() functions to all signed integer types.

Currently, calling abs() on one of the signed integer types might panic (in
debug mode at least) because the absolute value of the largest negative value
can not be represented in that signed type. Unlike all other integer
operations, there is currently not a non-panicking version on this function.
This seems to just be an oversight in the design, therefore just adding it now.
2016-07-30 13:44:46 +05:30
Manish Goregaokar
96e3972707 Rollup merge of #35049 - knight42:add-test, r=alexcrichton
Add a test for AddAssign on String

Fix #35047
2016-07-30 13:44:46 +05:30
bors
7580534c3a Auto merge of #35051 - japaric:backtrace, r=alexcrichton
rustbuild: make backtraces (RUST_BACKTRACE) optional

but keep them enabled by default to maintain the status quo.

When disabled shaves ~56KB off every x86_64-unknown-linux-gnu
binary.

To disable backtraces you have to use a config.toml (see
src/bootstrap/config.toml.example for details) when building rustc/std:

$ python bootstrap.py --config=config.toml

---

r? @alexcrichton
cc rust-lang/rfcs#1417
2016-07-30 00:08:24 -07:00
bors
2ad98a0b42 Auto merge of #35032 - vadimcn:rusty-ehabi, r=alexcrichton
Implement ARM personality routine in Rust.

Remove the `eh_personality_catch` lang item.
Use a simplified version of `cfg_if!` in libunwind.

Closes #34786
2016-07-29 20:29:43 -07:00
bors
f164cf5d64 Auto merge of #34842 - cgswords:attr_enc, r=nrc
Better attribute and metaitem encapsulation throughout the compiler

This PR refactors most (hopefully all?) of the `MetaItem` interactions outside of `libsyntax` (and a few inside) to interact with MetaItems through the provided traits instead of directly creating / destruct / matching against them. This is a necessary first step to eventually converting `MetaItem`s to internally use `TokenStream` representations (which will make `MetaItem` interactions much nicer for macro writers once the new macro system is in place).

r? @nrc
2016-07-29 16:26:38 -07:00
Guillaume Gomez
aeb3af898a Add doc example for Stdout 2016-07-30 00:57:20 +02:00
Guillaume Gomez
451683f0ee Add doc example for Stdin 2016-07-30 00:56:14 +02:00
Guillaume Gomez
aad5f6f912 Add doc example for io::Stderr 2016-07-30 00:53:18 +02:00
Guillaume Gomez
e805cb6374 Add io::Error doc examples 2016-07-29 14:32:35 +02:00
bors
5a7773a180 Auto merge of #35100 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #34258, #34894, #35050, #35062, #35066, #35072, #35087
- Failed merges:
2016-07-29 03:28:01 -07:00
Guillaume Gomez
5f5fdf64f1 Rollup merge of #35103 - brettcannon:patch-1, r=Manishearth
Try to clear up some awkward wording
2016-07-29 11:57:54 +02:00
Guillaume Gomez
d69161c119 Rollup merge of #35087 - GuillaumeGomez:fs_docs, r=steveklabnik
Fs docs

Fixes #29356.

r? @steveklabnik
2016-07-29 11:57:54 +02:00
Guillaume Gomez
3f06bf9afb Rollup merge of #35072 - munyari:assert_debug, r=steveklabnik
Update docs for assert! and debug_assert!

Refer to #34455
2016-07-29 11:57:54 +02:00
Guillaume Gomez
01505a3311 Rollup merge of #35066 - vadimcn:fix-typos, r=apasel422
Fix typos

r? @steveklabnik
2016-07-29 11:57:54 +02:00
Guillaume Gomez
41c8d3f630 Rollup merge of #35062 - frewsxcv:chars-as-str, r=GuillaumeGomez
Add documentation example for `str::Chars::as_str`.

None
2016-07-29 11:57:53 +02:00
Guillaume Gomez
72d1d06692 Rollup merge of #35050 - knight42:improve-fmt-doc, r=steveklabnik
More intuitive explantion of strings formatting
2016-07-29 11:57:53 +02:00
Guillaume Gomez
679f88d345 Rollup merge of #34258 - durka:patch-25, r=steveklabnik
book/ffi: nullable pointer cleanup

Expand the "nullable pointer optimization" section with a code example. Fixes #34250.

I also noticed that many of the examples use the libc crate just for types such as `c_char` and `c_int`, which are now available through `std::os::raw`. I changed the ones that don't need to rely on libc. I'm glad to revert that part of the commit if it's unwanted churn.
2016-07-29 11:57:53 +02:00
Michael Woerister
415fde498a intravisit: Fold functionality of IdVisitor into the regular Visitor. 2016-07-29 04:55:31 -04:00
Wang Xuerui
2a41b31a88
syntax_ext: format: fix ICE with bad named arguments 2016-07-29 16:40:10 +08:00
Jan-Erik Rediger
7c0cd30c4b Update LLVM again 2016-07-29 10:29:59 +02:00
Alex Crichton
52430727cd test: Fix a test on MSVC
Apparently MSVC now has namespaces in backtraces!
2016-07-29 10:29:59 +02:00
Jan-Erik Rediger
f38762a881 [LLVM-3.9] Use llvm-3.9 branch 2016-07-29 10:29:59 +02:00
Vladimir Vukicevic
330dd39bb2 Remove NO_FILE_METADATA; always use unknown_file_metadata instead of passing 0 2016-07-29 10:29:59 +02:00
Alex Crichton
2492d24baa llvm: Remove no longer existent LLVMAddTargetData binding 2016-07-29 10:29:59 +02:00
Alex Crichton
0509be1f6b Update parsing llvm-config output
Now it prints full paths on MSVC, but we're only interested in path names
2016-07-29 10:29:59 +02:00
Alex Crichton
75bcda4cf1 rustc: Update LLVM to the LLVM 3.9 release branch
The 3.9 release of LLVM isn't out yet, but this moves us onto that branch to
start tracking it.
2016-07-29 10:29:59 +02:00
Alex Crichton
5fa55781bd test: Remove the execution-engine test
We don't actually officially support this at all, and the execution engine
support in LLVM we've had to gut as it's not compiling on MinGW, so just delete
this test for now.
2016-07-29 10:29:59 +02:00
Alex Crichton
e8f76661f1 rustc: Fix data-layout for AArch64 targets
Also relax the assertion whenever we have a custom LLVM root as LLVM may
disagree about exact specifics.
2016-07-29 10:29:44 +02:00
Alex Crichton
d851428cc3 configure: Fix grep invocation for llvm-mc argument 2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
a36595ed14 Force check of error
The passed error needs to be checked.
Otherwise it will force an abort when it is deconstructed, but a
success value.
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
2c16e24643 Use C type when passing value to LLVM pass
Previously the C type LLVMRelocMode (available as RelocMode in Rust)
was passed as is to the function.
However createTargetMachine expects a Reloc::Model, which is an enum
just one value short.
Additionally, the function was marked as requiring Reloc::Model in the
C code, but RelocMode on the Rust-side.

We now use the correct C type LLVMRelocMode and convert it to an
Optional<Reloc::Model> as expected by the createTargetMachine call the
same the original LLVMCreateTargetMachine function does.
See
c9b262bfbd/lib/Target/TargetMachineC.cpp (L104-L121)

This was found by @eddyb.
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
079db4f971 Use correct error handling type 2016-07-29 10:29:44 +02:00