Commit Graph

399 Commits

Author SHA1 Message Date
Alex Crichton 47ece1fa2c Don't use -Z prefer-dynamic at stage0
This is blocking a snapshot because the stage0 target compiler comes from a
stage1 host compiler. This means that the stage0 compiler doesn't actually
understand the -Z prefer-dynamic flag and is dying as a result.

This will get added back to stage0 after a snapshot.
2014-02-10 23:06:37 -08:00
gifnksm 1b969e1188 Makefile.in: --no-rpath => -C no-rpath 2014-02-11 00:25:10 +09:00
Alex Crichton 071ee96277 Consolidate codegen-related compiler flags
Move them all behind a new -C switch. This migrates some -Z flags and some
top-level flags behind this -C codegen option.

The -C flag takes values of the form "-C name=value" where the "=value" is
optional for some flags.

Flags affected:

* --llvm-args           => -C llvm-args
* --passes              => -C passes
* --ar                  => -C ar
* --linker              => -C linker
* --link-args           => -C link-args
* --target-cpu          => -C target-cpu
* --target-feature      => -C target-fature
* --android-cross-path  => -C android-cross-path
* --save-temps          => -C save-temps
* --no-rpath            => -C no-rpath
* -Z no-prepopulate     => -C no-prepopulate-passes
* -Z no-vectorize-loops => -C no-vectorize-loops
* -Z no-vectorize-slp   => -C no-vectorize-slp
* -Z soft-float         => -C soft-float
* -Z gen-crate-map      => -C gen-crate-map
* -Z prefer-dynamic     => -C prefer-dynamic
* -Z no-integrated-as   => -C no-integrated-as

As a bonus, this also promotes the -Z extra-debug-info flag to a first class -g
or --debuginfo flag.

* -Z debug-info         => removed
* -Z extra-debug-info   => -g or --debuginfo

Closes #9770
Closes #12000
2014-02-10 00:50:39 -08:00
Alex Crichton 91882a4c56 Remove VPATH usage in Makefiles
This is just messing up all the doc dependencies because of such similar
directory names and file names.

Closes #11422
2014-02-02 10:59:14 -08:00
Corey Richardson 25fe2cadb1 Remove rustpkg.
I'm sorry :'(

Closes #11859
2014-02-02 03:08:56 -05:00
Alex Crichton dea86ca86b Fix a typo in disable rpaths
Closes #5219
2014-01-28 11:49:25 -08:00
bors 74fedf325a auto merge of #11787 : alexcrichton/rust/refactor, r=brson
It was decided a long, long time ago that libextra should not exist, but rather its modules should be split out into smaller independent libraries maintained outside of the compiler itself. The theory was to use `rustpkg` to manage dependencies in order to move everything out of the compiler, but maintain an ease of usability.

Sadly, the work on `rustpkg` isn't making progress as quickly as expected, but the need for dissolving libextra is becoming more and more pressing. Because of this, we've thought that a good interim solution would be to simply package more libraries with the rust distribution itself. Instead of dissolving libextra into libraries outside of the mozilla/rust repo, we can dissolve libraries into the mozilla/rust repo for now.

Work on this has been excruciatingly painful in the past because the makefiles are completely opaque to all but a few. Adding a new library involved adding about 100 lines spread out across 8 files (incredibly error prone). The first commit of this pull request targets this pain point. It does not rewrite the build system, but rather refactors large portions of it. Afterwards, adding a new library is as simple as modifying 2 lines (easy, right?). The build system automatically keeps track of dependencies between crates (rust *and* native), promotes binaries between stages, tracks dependencies of installed tools, etc, etc.

With this newfound buildsystem power, I chose the `extra::flate` module as the first candidate for removal from libextra. While a small module, this module is relative complex in that is has a C dependency and the compiler requires it (messing with the dependency graph a bit). Albeit I modified more than 2 lines of makefiles to accomodate libflate (the native dependency required 2 extra lines of modifications), but the removal process was easy to do and straightforward.

---

Testing-wise, I've cross-compiled, run tests, built some docs, installed, uninstalled, etc. I'm still working out a few kinks, and I'm sure that there's gonna be built system issues after this, but it should be working well for basic use!

cc #8784
2014-01-26 16:46:34 -08:00
Salem Talha cc61fc0994 Removed all instances of XXX in preparation for relaxing of FIXME rule 2014-01-26 14:42:53 -05:00
Alex Crichton 2611483894 Refactor the build system for easily adding crates
Before this patch, if you wanted to add a crate to the build system you had to
change about 100 lines across 8 separate makefiles. This is highly error prone
and opaque to all but a few. This refactoring is targeted at consolidating this
effort so adding a new crate adds one line in one file in a way that everyone
can understand it.
2014-01-26 00:53:41 -08:00
bors a1d9d9e6d2 auto merge of #11744 : alexcrichton/rust/issue-5219, r=thestinger
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.

Closes #5219
2014-01-24 10:26:33 -08: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
Alex Crichton 219478fb41 Build llvm-extract (needed by codegen tests) 2014-01-23 15:13:00 -08:00
Alex Crichton d84c3369f7 Remove no-debug-borrows from the makefiles 2014-01-21 10:02:48 -08:00
bors e6a27424ad auto merge of #11590 : vadimcn/rust/llvm-tools, r=alexcrichton
Closes #10893 - because we'll no longer build llvm-c-test
2014-01-16 04:31:52 -08:00
Vadim Chugunov 62fbd00bed Only build LLVM tools Rust needs. 2014-01-15 17:47:48 -08:00
Alex Crichton 7a37294acc Add a configure to disable libstd version injection
We'll use this when building snapshots so we can upgrade freely, but all
compilers will inject a version by default.
2014-01-15 08:22:16 -08:00
Derek Guenther a599d897fc Renamed LIBDIR_RELATIVE to CFG_LIBDIR_RELATIVE 2014-01-14 15:52:57 -06:00
Brian Anderson 46905c04f5 Bump version to 0.10-pre 2014-01-12 17:45:22 -08:00
Brian Anderson 15cbcbcc03 mk: Fix the naming of the windows installer harder
CFG_VERSION includes a bunch of VCS info in it that is not a valid
filename. CFG_RELEASE is just the version number.
2014-01-07 17:01:07 -08:00
Jan Niklas Hasse 116773a4eb Make CFG_LIBDIR configurable. Fixes #5223 2014-01-07 17:51:15 +01: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
Brian Anderson 56ec9c23a4 Bump version to 0.9 2014-01-02 12:55:20 -08:00
Alex Crichton 282f3d99a5 Test fixes and rebase problems
Note that this removes a number of run-pass tests which are exercising behavior
of the old runtime. This functionality no longer exists and is thoroughly tested
inside of libgreen and libnative. There isn't really the notion of "starting the
runtime" any more. The major notion now is "bootstrapping the initial task".
2013-12-24 19:59:53 -08:00
Alex Crichton d830fcc6eb make: Add all the make support for lib{native,green}
This should now begin distribution of lib{green,native} in rlib/dylib format as
well as building them as part of the normal build process.
2013-12-24 19:59:52 -08:00
Brian Anderson a5d26a2e37 mk: Remove obsolete source reformatting rules 2013-12-20 18:31:00 -08:00
Alex Crichton 70273bb1d6 Register new snapshots
This transitions the snapshot dependency process to understand that our
snapshots are now a single static binary rather than an array of files.
2013-12-07 23:02:39 -08:00
Alex Crichton e91ffb0710 Link rustllvm statically, and distribute a static snapshot
In order to keep up to date with changes to the libraries that `llvm-config`
spits out, the dependencies to the LLVM are a dynamically generated rust file.
This file is now automatically updated whenever LLVM is updated to get kept
up-to-date.

At the same time, this cleans out some old cruft which isn't necessary in the
makefiles in terms of dependencies.

Closes #10745
Closes #10744
2013-12-06 20:51:17 -08:00
Alex Crichton acc5e32e53 Register new snapshots 2013-12-03 14:31:54 -08:00
Alex Crichton 9fbba7b2ee Statically link librustrt to libstd
This commit alters the build process of the compiler to build a static
librustrt.a instead of a dynamic version. This means that we can stop
distributing librustrt as well as default linking against it in the compiler.

This also means that if you attempt to build rust code without libstd, it will
no longer work if there are any landing pads in play. The reason for this is
that LLVM and rustc will emit calls to the various upcalls in librustrt used to
manage exception handling. In theory we could split librustrt into librustrt and
librustupcall. We would then distribute librustupcall and link to it for all
programs using landing pads, but I would rather see just one librustrt artifact
and simplify the build process.

The major benefit of doing this is that building a static rust library for use
in embedded situations all of a sudden just became a whole lot more feasible.

Closes #3361
2013-11-29 18:36:14 -08:00
Alex Crichton e338a4154b Add generation of static libraries to rustc
This commit implements the support necessary for generating both intermediate
and result static rust libraries. This is an implementation of my thoughts in
https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html.

When compiling a library, we still retain the "lib" option, although now there
are "rlib", "staticlib", and "dylib" as options for crate_type (and these are
stackable). The idea of "lib" is to generate the "compiler default" instead of
having too choose (although all are interchangeable). For now I have left the
"complier default" to be a dynamic library for size reasons.

Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an
rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a
dynamic object. I chose this for size reasons, but also because you're probably
not going to be embedding the rustc compiler anywhere any time soon.

Other than the options outlined above, there are a few defaults/preferences that
are now opinionated in the compiler:

* If both a .dylib and .rlib are found for a rust library, the compiler will
  prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option
* If generating a "lib", the compiler will generate a dynamic library. This is
  overridable by explicitly saying what flavor you'd like (rlib, staticlib,
  dylib).
* If no options are passed to the command line, and no crate_type is found in
  the destination crate, then an executable is generated

With this change, you can successfully build a rust program with 0 dynamic
dependencies on rust libraries. There is still a dynamic dependency on
librustrt, but I plan on removing that in a subsequent commit.

This change includes no tests just yet. Our current testing
infrastructure/harnesses aren't very amenable to doing flavorful things with
linking, so I'm planning on adding a new mode of testing which I believe belongs
as a separate commit.

Closes #552
2013-11-29 18:36:13 -08:00
Niko Matsakis 5e54a7323d Update various tests and libraries that were incorrectly
annotated.
2013-11-08 19:45:50 -05:00
Chris Morgan 0369a41f0e Rename files to match current recommendations.
New standards have arisen in recent months, mostly for the use of
rustpkg, but the main Rust codebase has not been altered to match these
new specifications. This changeset rectifies most of these issues.

- Renamed the crate source files `src/libX/X.rs` to `lib.rs`, for
  consistency with current styles; this affects extra, rustc, rustdoc,
  rustpkg, rustuv, std, syntax.

- Renamed `X/X.rs` to `X/mod.rs,` as is now recommended style, for
  `std::num` and `std::terminfo`.

- Shifted `src/libstd/str/ascii.rs` out of the otherwise unused `str`
  directory, to be consistent with its import path of `std::ascii`;
  libstd is flat at present so it's more appropriate thus.

While this removes some `#[path = "..."]` directives, it does not remove
all of them, and leaves certain other inconsistencies, such as `std::u8`
et al. which are actually stored in `src/libstd/num/` (one subdirectory
down). No quorum has been reached on this issue, so I felt it best to
leave them all alone at present. #9208 deals with the possibility of
making libstd more hierarchical (such as changing the crate to match the
current filesystem structure, which would make the module path
`std::num::u8`).

There is one thing remaining in which this repository is not
rustpkg-compliant: rustpkg would have `src/std/` et al. rather than
`src/libstd/` et al. I have not endeavoured to change that at this point
as it would guarantee prompt bitrot and confusion. A change of that
magnitude needs to be discussed first.
2013-11-03 23:49:01 +11:00
bors b5c1b48048 auto merge of #10199 : alexcrichton/rust/no-propagate, r=brson
This commit removes the propagation of `link_args` attributes across crates. The first commit message has the reasons as to why. Additionally, this starts statically linking some C/C++ helper libraries that we have to their respective crates instead of throwing then in librustrt and then having everything depend on librustrt.

The major downside of this movement is that we're losing the ability to control visible symbols. I couldn't figure out a way to internalize symbols from a static library during the linking process, so everyone who links to librustdoc will be able to use its sundown implementation (not exactly ideal). I'm not entirely sure how to fix this (beyond generating a list of all public symbols, including rust ones, and passing that to the linker), but we may have a much easier time with this once we start using llvm's linker toolchain.

There's certainly a lot more possibilities in where this can go, but I didn't want to go too deep just yet. The main idea here is to stop propagating linker arguments and then see how we're able to start statically linking libraries as a result.

r? @catamorphism, you're going to be working on linking soon, so feel free to completely throw this away for something else!
2013-11-02 22:16:02 -07:00
Alex Crichton 0ce1b2f04d Statically link libuv to librustuv
Similarly to the previous commit, libuv is only used by this library, so there's
no need for it to be linked into librustrt and available to all crates by
default.
2013-11-02 21:28:17 -07:00
bors 9ec4c1851a auto merge of #10229 : brson/rust/warnings, r=thestinger
In Rust we don't like capital letters.
2013-11-02 00:51:12 -07:00
Brian Anderson 758af60334 Fix installation with DESTDIR 2013-11-01 20:23:22 -07:00
Brian Anderson e9605dc0c9 Use consistent capitalization in makefile errors
In Rust we don't like capital letters.
2013-11-01 15:28:12 -07:00
Heather 8a593a8bdb support for GNU configure syntax 2013-10-29 16:22:08 -07:00
Alex Crichton 201cab84e8 Move rust's uv implementation to its own crate
There are a few reasons that this is a desirable move to take:

1. Proof of concept that a third party event loop is possible
2. Clear separation of responsibility between rt::io and the uv-backend
3. Enforce in the future that the event loop is "pluggable" and replacable

Here's a quick summary of the points of this pull request which make this
possible:

* Two new lang items were introduced: event_loop, and event_loop_factory.
  The idea of a "factory" is to define a function which can be called with no
  arguments and will return the new event loop as a trait object. This factory
  is emitted to the crate map when building an executable. The factory doesn't
  have to exist, and when it doesn't then an empty slot is in the crate map and
  a basic event loop with no I/O support is provided to the runtime.

* When building an executable, then the rustuv crate will be linked by default
  (providing a default implementation of the event loop) via a similar method to
  injecting a dependency on libstd. This is currently the only location where
  the rustuv crate is ever linked.

* There is a new #[no_uv] attribute (implied by #[no_std]) which denies
  implicitly linking to rustuv by default

Closes #5019
2013-10-29 08:39:22 -07:00
bors cd623e3e36 auto merge of #9919 : alexcrichton/rust/fmt-begone, r=huonw
It lived a good life, but its time has come. The groundwork is set for the
official transition after the next snapshot (removal of XXX2 macros)
2013-10-18 18:26:23 -07:00
Alex Crichton 29c58c473f Remove the fmt! syntax extension
It lived a good life, but its time has come. The groundwork is set for the
official transition after the next snapshot (removal of XXX2 macros)
2013-10-18 16:01:40 -07:00
Daniel Micay 28a6498dbf rm rusti from `Makefile.in` 2013-10-17 19:47:24 -04:00
Daniel Micay 7c92435f8f remove the rusti command
Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
2013-10-16 22:54:38 -04:00
Tim Chevalier a9dddbacde rust / build: Remove the `rust` tool
Sadly, there's a lack of resources for maintaining the `rust` tool,
and we decided in the 2013-10-08 Rust team meeting that it's better
to remove it altogether than to leave it in a broken state.

This deletion is without prejudice. If a person or people appear who
would like to maintain the tool, we will probably be happy to
resurrect it!

Closes #9775
2013-10-10 14:36:06 -07:00
klutzy 6434d0b58f Makefile: Get git revision correctly on Windows
Fixes a bug that `rustc.exe -v` didn't show git revision hash.
The bug is caused by that `$(wildcard $(CFG_GIT))` requires
space-escaped inputs while `$(CFG_GIT)` is usually
`C:\Program Files (x86)\Git\bin\git.exe`.
2013-10-09 16:38:41 +09:00
Alex Crichton aaf6cc3a84 Prevent leakage of fmt! into the compiler
We're not outright removing fmt! just yet, but this prevents it from leaking
into the compiler further (it's still turned on by default for all other code).
2013-09-30 23:21:18 -07:00
bors 92e7bb67a8 auto merge of #9542 : pnkfelix/rust/fsk-fix-issue-9531, r=thestinger
r? strcat 

(please double check that it fixes things on your chroot, if possible, before approval)

Fix #9531
2013-09-28 15:01:38 -07:00
Brian Anderson 99c1fb8c66 Update version numbers to 0.9-pre 2013-09-26 18:18:42 -07:00
Felix S. Klock II 2835df2db6 Fix for make -j race from #9531 injected by cleanup in b1a22518f0. 2013-09-26 23:56:53 +02:00
bors 03e5e96315 auto merge of #9385 : alexcrichton/rust/actually-ndebug, r=pnkfelix
Turns out that even if the default is "enabled", that doesn't mean that the
CFG_ENABLE_DEBUG variable will be defined. Instead, test whether
CFG_DISABLE_DEBUG is defined and disable debug things if that's the case.
2013-09-22 22:20:50 -07:00