Commit Graph

370 Commits

Author SHA1 Message Date
Patrick Walton
b265dd4156 librustc: De-@str symbol hashing 2014-02-02 01:44:49 +11:00
Patrick Walton
9869374256 librustc: Remove a bunch of @str from the compiler around metadata
handling
2014-02-02 01:44:48 +11:00
Alex Crichton
e8e0cdd73f Disable fp elim on mac64
I believe that this is leading to lots of failures on the bots.

cc #11954
2014-01-31 10:23:25 -08:00
bors
1e23c5c051 auto merge of #11879 : thestinger/rust/frame-pointer, r=alexcrichton
This is still used for Rust code (`Options.NoFramePointerElim = true`).
2014-01-29 13:36:40 -08:00
Daniel Micay
cb263e875e enable fp-elim when debug info is disabled
This can almost be fully disabled, as it no longer breaks retrieving a
backtrace on OS X as verified by @alexcrichton. However, it still
breaks retrieving the values of parameters. This should be fixable in
the future via a proper location list...

Closes #7477
2014-01-29 16:35:05 -05:00
Eduard Burtescu
e81ab4198c Removed take_glue from tydesc, inlining the equivalent refcount increment code instead. 2014-01-27 22:32:30 +02:00
Alex Crichton
e715cdba31 Allow opting-out of rpath usage
By default, the compiler and libraries are all still built with rpaths, but this
can be opted out of with --disable-rpath to ./configure or --no-rpath to rustc.

cc #5219
2014-01-24 09:24:45 -08:00
bors
918a7314a8 auto merge of #11129 : SimonSapin/rust/foo-vs-foo_opt, r=alexcrichton
[On 2013-12-06, I wrote to the rust-dev mailing list](https://mail.mozilla.org/pipermail/rust-dev/2013-December/007263.html):

> Subject: Let’s avoid having both foo() and foo_opt()
>
> We have some functions and methods such as [std::str::from_utf8](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8.html) that may succeed and give a result, or fail when the input is invalid.
>
> 1. Sometimes we assume the input is valid and don’t want to deal with the error case. Task failure works nicely.
>
> 2. Sometimes we do want to do something different on invalid input, so returning an `Option<T>` works best.
>
> And so we end up with both `from_utf8` and `from_utf8`. This particular case is worse because we also have `from_utf8_owned` and `from_utf8_owned_opt`, to cover everything.
>
> Multiplying names like this is just not good design. I’d like to reduce this pattern.
>
> Getting behavior 1. when you have 2. is easy: just call `.unwrap()` on the Option. I think we should rename every `foo_opt()` function or method to just `foo`, remove the old `foo()` behavior, and tell people (through documentation) to use `foo().unwrap()` if they want it back?
>
> The downsides are that unwrap is more verbose and gives less helpful error messages on task failure. But I think it’s worth it.


The email discussion has gone around long enough. Let’s discuss a concrete proposal. For the following functions or methods, I removed `foo` (that caused task failure) and renamed `foo_opt` (that returns `Option`) to just `foo`.

Vector methods:

* `get_opt` (rename only, `get` did not exist as it would have been just `[]`)
* `head_opt`
* `last_opt`
* `pop_opt`
* `shift_opt`
* `remove_opt`

`std::path::BytesContainer` method:

* `container_as_str_opt`

`std::str` functions:

* `from_utf8_opt`
* `from_utf8_owned_opt` (also remove the now unused `not_utf8` condition)

Is there something else that should recieve the same treatement?

I did not rename `recv_opt` on channels based on @brson’s [feedback](https://mail.mozilla.org/pipermail/rust-dev/2013-December/007270.html).

Feel free to pick only some of these commits.
2014-01-21 15:56:16 -08:00
Simon Sapin
05ae134ace [std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old from_utf8_owned() behavior 2014-01-21 15:48:48 -08:00
Simon Sapin
b8c4149293 [std::str] Rename from_utf8_opt() to from_utf8(), drop the old from_utf8() behavior 2014-01-21 15:48:48 -08:00
bors
505572b3f8 auto merge of #11700 : bharrisau/rust/thumb, r=alexcrichton
To build for the cortex-M series ARM processors LLC needs to be told to build for the thumb instruction set. There are two ways to do this, either with the triple "thumb\*-\*-\*" or with -march=thumb (which just overrides the triple anyway). I chose the first way.

The following will fail because the local cc doesn't know what to do with -mthumb.
````
rustc test.rs --lib --target thumb-linux-eab
error: linking with `cc` failed: exit code: 1
note: cc: error: unrecognized command line option ‘-mthumb’
````

Changing the linker works as expected.
````
rustc test.rs --lib --target thumb-linux-eabi --linker arm-none-eabi-gcc
````

Ideally I'd have the triple thumb-none-eabi, but adding a new OS looks like much more work (and I'm not familiar enough with what it does to know if it is needed).
2014-01-21 11:26:13 -08:00
Alex Crichton
254e35c268 Capitalize debugging opts and make them u64 2014-01-21 09:23:56 -08:00
Alex Crichton
57f8073b5e Remove obsoleted -Z options
* borrowck_note_pure - unused
* borrowck_note_loan - unused
* no_debug_borrows - unused
* lint_llvm - equivalent to -Z no-prepopulate-passes + --llvm-passes lint
2014-01-21 09:23:56 -08:00
Ben Harris
50d0e07065 Add support for ARM thumb architecture 2014-01-21 18:27:49 +08:00
chromatic
0578c15abd Fixed typos in comments of librustc backend. 2014-01-17 17:14:47 -08:00
bors
aa67e13498 auto merge of #11604 : alexcrichton/rust/issue-11162, r=brson
Apparently this isn't necessary, and it's just causing problems.

Closes #11162
2014-01-17 13:36:43 -08:00
klutzy
ec6aba37d7 rustc::metadata: Remove trait FileSearch 2014-01-17 13:27:47 +09:00
klutzy
f30a9b3d5b rustc::driver: Capitalize structs and enums
driver::session::crate_metadata is unused; removed.
2014-01-17 13:27:47 +09:00
Alex Crichton
11dcd9a097 Don't run 'ar s' on OSX
Apparently this isn't necessary, and it's just causing problems.

Closes #11162
2014-01-16 12:18:22 -08:00
Daniel Micay
6809b172e0 remove borrow_offset as ~ is now free of headers 2014-01-14 22:01:44 -05:00
Eduard Burtescu
7a305f9e83 Removed free_glue from tydesc (the code is still generated, but inlined in drop_glue). 2014-01-11 16:40:23 +02:00
Brian Anderson
520c82e0e9 rustc: Fix style of OutputType enum 2014-01-09 18:46:21 -08:00
Eduard Burtescu
6b221768cf libsyntax: Renamed types, traits and enum variants to CamelCase. 2014-01-09 22:25:28 +02:00
bors
4e622becdc auto merge of #11118 : jhasse/rust/patch-rustlibdir, r=alexcrichton
...stlib. Fixes #3319
2014-01-06 02:01:49 -08:00
Young-il Choi
635002a350 librustc: tidy cleanup 2014-01-06 13:06:06 +09:00
Young-il Choi
e6490cbdb0 librustc: add get_system_tools for target specific environment 2014-01-06 13:04:26 +09:00
Young-il Choi
c8c99429d2 librustc: move target dependent logic to back::link 2014-01-06 13:04:26 +09:00
Young-il Choi
19e97f5c5d librustc: ar call fix to support android cross compile on mac 2014-01-06 13:04:26 +09:00
Jan Niklas Hasse
6abe0ef32e Make rustc's own lib directory configurable and change the default to rustlib. Fixes #3319 2014-01-05 12:06:20 +01:00
bors
736f5a8ea8 auto merge of #11247 : eddyb/rust/symbol-cleanup, r=alexcrichton 2014-01-01 02:51:53 -08:00
bors
03b510297c auto merge of #11215 : alexcrichton/rust/metadata-filename, r=pcwalton
Right now if you have concurrent builds of two libraries in the same directory
(such as rustc's bootstrapping process), it's possible that two libraries will
stomp over each others' metadata, producing corrupt rlibs.

By placing the metadata file in a tempdir we're guranteed to not conflict with
ay other builds happening concurrently. Normally this isn't a problem because
output filenames are scoped to the name of the crate, but metadata is special in
that it has the same name across all crates.
2013-12-31 22:26:55 -08:00
bors
e61937a6bf auto merge of #11187 : alexcrichton/rust/once, r=brson
Rationale can be found in the first commit, but this is basically the same thing as `pthread_once`
2013-12-31 20:41:56 -08:00
Alex Crichton
c22fed9424 Convert relevant static mutexes to Once 2013-12-31 20:15:03 -08:00
Eduard Burtescu
4e752651f4 Truncate symbol hashes to 64 bits. 2014-01-01 01:42:24 +02:00
bors
bd52e6acc6 auto merge of #11157 : alexcrichton/rust/issue-11154, r=pcwalton
Closes #11154
2013-12-31 13:52:03 -08:00
Alex Crichton
870024a160 Disallow LTO with a preference to dynamic linking
Closes #11154
2013-12-31 11:48:47 -08:00
Vadim Chugunov
856222987d Revert "Embed Windows application manifest." 2013-12-30 13:22:54 -08:00
Alex Crichton
fe30087080 Add metadata from a tempdir instead of a build dir
Right now if you have concurrent builds of two libraries in the same directory
(such as rustc's bootstrapping process), it's possible that two libraries will
stomp over each others' metadata, producing corrupt rlibs.

By placing the metadata file in a tempdir we're guranteed to not conflict with
ay other builds happening concurrently. Normally this isn't a problem because
output filenames are scoped to the name of the crate, but metadata is special in
that it has the same name across all crates.
2013-12-30 08:21:41 -08:00
Luis de Bethencourt
f872c47278 Rename PkgId to CrateId 2013-12-29 15:25:32 -05:00
Luis de Bethencourt
4bc09713df Rename pkgid variables 2013-12-29 15:25:26 -05:00
Alex Crichton
b6a7463526 Initialize LLVM only once
This also appears to fix a race in LLVM that was causing a deadlock on the bots
during the doc-test tests (where we use rustc in parallel).
2013-12-27 23:39:33 -08:00
Patrick Walton
f62faa89ed librustc: De-@mut outputs in the session 2013-12-26 15:54:37 -08:00
Patrick Walton
02d31b7d1a librustc: De-@mut the additional library search paths 2013-12-26 15:54:31 -08:00
Patrick Walton
79d97ca4aa librustc: De-@mut CStore::used_link_args 2013-12-26 15:54:29 -08:00
Patrick Walton
af1184030b librustc: De-@mut CStore::used_libraries 2013-12-26 15:54:29 -08:00
Patrick Walton
b941677ea3 librustc: De-@mut the crate context 2013-12-26 13:01:26 -08:00
Patrick Walton
303a39477b librustc: De-@mut CrateContext::symbol_hasher. 2013-12-26 13:01:25 -08:00
Patrick Walton
25337a7f9f librustc: De-@mut CrateContext::type_hashcodes 2013-12-26 13:01:24 -08:00
bors
9477c49a7b auto merge of #10965 : alexcrichton/rust/libgreen, r=brson
This pull request extracts all scheduling functionality from libstd, moving it into its own separate crates. The new libnative and libgreen will be the new way in which 1:1 and M:N scheduling is implemented. The standard library still requires an interface to the runtime, however, (think of things like `std::comm` and `io::println`). The interface is now defined by the `Runtime` trait inside of `std::rt`.

The booting process is now that libgreen defines the start lang-item and that's it. I want to extend this soon to have libnative also have a "start lang item" but also allow libgreen and libnative to be linked together in the same process. For now though, only libgreen can be used to start a program (unless you define the start lang item yourself). Again though, I want to change this soon, I just figured that this pull request is large enough as-is.

This certainly wasn't a smooth transition, certain functionality has no equivalent in this new separation, and some functionality is now better enabled through this new system. I did my best to separate all of the commits by topic and keep things fairly bite-sized, although are indeed larger than others.

As a note, this is currently rebased on top of my `std::comm` rewrite (or at least an old copy of it), but none of those commits need reviewing (that will all happen in another pull request).
2013-12-26 01:01:54 -08:00
Alex Crichton
6cad8f4f14 Test fixes and rebase conflicts
* vec::raw::to_ptr is gone
* Pausible => Pausable
* Removing @
* Calling the main task "<main>"
* Removing unused imports
* Removing unused mut
* Bringing some libextra tests up to date
* Allowing compiletest to work at stage0
* Fixing the bootstrap-from-c rmake tests
* assert => rtassert in a few cases
* printing to stderr instead of stdout in fail!()
2013-12-25 23:10:46 -08:00