about summary refs log tree commit diff
path: root/mk/rt.mk
AgeCommit message (Collapse)AuthorLines
2017-02-06Delete the `mk` folderAlex Crichton-721/+0
This commit deletes the old build system located in the `mk` folder as it's now been obsoleted for two cycles and is replaced by rustbuild.
2017-01-31Don't build gcc_personality_v0.c on NetBSD eitherJonathan A. Kollasch-0/+2
2016-09-12no emutls for you, windowsJorge Aparicio-2/+0
2016-09-12crate-ify compiler-rt into compiler-builtinsJorge Aparicio-161/+179
libcompiler-rt.a is dead, long live libcompiler-builtins.rlib This commit moves the logic that used to build libcompiler-rt.a into a compiler-builtins crate on top of the core crate and below the std crate. This new crate still compiles the compiler-rt instrinsics using gcc-rs but produces an .rlib instead of a static library. Also, with this commit rustc no longer passes -lcompiler-rt to the linker. This effectively makes the "no-compiler-rt" field of target specifications a no-op. Users of `no_std` will have to explicitly add the compiler-builtins crate to their crate dependency graph *if* they need the compiler-rt intrinsics. Users of the `std` have to do nothing extra as the std crate depends on compiler-builtins. Finally, this a step towards lazy compilation of std with Cargo as the compiler-rt intrinsics can now be built by Cargo instead of having to be supplied by the user by some other method. closes #34400
2016-07-24Fix build of compiler-rt on FreeBSDAlan Somers-0/+4
Broken since ee6011fc71e02485f2dffcc25be64631c2008775 removed cmake from the process. There are likely other platforms still broken, but I didn't test on them.
2016-07-20mk: Stop using cmake for compiler-rtAlex Crichton-101/+327
The compiler-rt build system has been a never ending cause of pain for Rust unfortunately: * The build system is very difficult to invoke and configure to only build compiler-rt, especially across platforms. * The standard build system doesn't actually do what we want, not working for some of our platforms and requiring a significant number of patches on our end which are difficult to apply when updating compiler-rt. * Compiling compiler-rt requires LLVM to be compiled, which... is a big dependency! This also means that over time compiler-rt is not guaranteed to build against older versions of LLVM (or newer versions), and we often want to work with multiple versions of LLVM simultaneously. The makefiles and rustbuild already know how to compile C code, the code here is far from the *only* C code we're compiling. This patch jettisons all logic to work with compiler-rt's build system and just goes straight to the source. We just list all files manually (copied from compiler-rt's lib/builtins/CMakeLists.txt) and compile them into an archive. It's likely that this means we'll fail to pick up new files when we upgrade compiler-rt, but that seems like a much less significant cost to pay than what we're currently paying. cc #34400, first steps towards that
2016-07-07llvm: allow cleaning LLVM's Visual Studio buildsBen Boeckel-0/+7
The Visual Studio generators create a `clean` target that we can use.
2016-06-21Convert makefiles to build LLVM/compiler-rt with CMakeBrian Anderson-50/+111
2016-04-05Rollup merge of #32686 - mneumann:dragonfly_jemalloc_prefix, r=alexcrichtonManish Goregaokar-0/+2
Prefix jemalloc on DragonFly to prevent segfaults. Similar to commits ed015456a114ae907a36af80c06f81ea93182a24 (iOS) and e3b414d8612314e74e2b0ebde1ed5c6997d28e8d (Android)
2016-04-02Prefix jemalloc on DragonFly to prevent segfaults.Michael Neumann-0/+2
Similar to commits ed015456a114ae907a36af80c06f81ea93182a24 (iOS) and e3b414d8612314e74e2b0ebde1ed5c6997d28e8d (Android)
2016-03-29mk: A few build fixes for i586-pc-windows-msvcAlex Crichton-2/+2
Detect the triple in the configure script for probing MSVC shenanigans and also be sure to use `llvm-config` from the build host and not the target when configuring compiler-rt.
2016-03-05More reliable and consistent method of cancelling -Werror*Angus Lees-2/+2
Adding -Wno-error is more reliable and simple than trying to modify existing flags. We've been using this in Debian already for the past few releases. Making this change also encourages future maintainers towards "best practises". Also take the opportunity to use the same method at all places in the file.
2016-02-14std: Stop prefixing jemalloc symbolsAlex Crichton-2/+10
Now that we properly only link in jemalloc when building executables, we have far less to worry about in terms of polluting the global namespace with the `free` and `malloc` symbols on Linux. This commit will primarily allow LLVM to use jemalloc so the compiler will only be using one allocator overall. Locally this took compile time for libsyntax from 95 seconds to 89 (a 6% improvement).
2016-02-06Add the asmjs-unknown-emscripten triple. Add cfgs to libs.Brian Anderson-0/+19
Backtraces, and the compilation of libbacktrace for asmjs, are disabled. This port doesn't use jemalloc so, like pnacl, it disables jemalloc *for all targets* in the configure file. It disables stack protection.
2016-02-03compiler-rt: Handle -Werror=* arguments in CFLAGSGuillaume Bonnet-1/+1
2016-02-01Revert "mk: fix some undefined variable warnings"Alex Crichton-1/+3
This reverts commit d03712977d7c913044f2b863269c4491d7fa7c36.
2016-02-01mk: fix some undefined variable warningsTamir Duberstein-3/+1
Some of this is scary stuff. Probably time to lint against this. Found with `make --warn-undefined-variables`.
2015-12-22Auto merge of #30175 - alexcrichton:less-c-code, r=brsonbors-3/+1
All these definitions can now be written in Rust, so do so!
2015-12-21std: Remove rust_builtin C support libraryAlex Crichton-3/+1
All these definitions can now be written in Rust, so do so!
2015-12-21std: Update jemalloc versionAlex Crichton-5/+18
It's been awhile since we last updated jemalloc, and there's likely some bugs that have been fixed since the last version we're using, so let's try to update again.
2015-11-07Make sure rsbegin.o and rsend.o get packaged with target lib artifacts.Vadim Chugunov-0/+4
Also, unified libc startup objects finding logic with that of the `-musl` target, since conceptually they were doing the same thing.
2015-11-04Build compiler-rt/builtins with MSVCangelsl-15/+24
2015-09-04Add line numbers to windows-gnu backtracesDiggory Blake-6/+17
Fix formatting Remove unused imports Refactor Fix msvc build Fix line lengths Formatting Enable backtrace tests Fix using directive on mac pwd info Work-around buildbot PWD bug, and fix libbacktrace configuration Use alternative to `env -u` which is not supported on bitrig Disable tests on 32-bit windows gnu
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-6/+0
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-11Register new snapshotsAlex Crichton-3/+1
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-10Remove morestack supportAlex Crichton-5/+3
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-07-21trans: Move rust_try into the compilerAlex Crichton-18/+0
This commit moves the IR files in the distribution, rust_try.ll, rust_try_msvc_64.ll, and rust_try_msvc_32.ll into the compiler from the main distribution. There's a few reasons for this change: * LLVM changes its IR syntax from time to time, so it's very difficult to have these files build across many LLVM versions simultaneously. We'll likely want to retain this ability for quite some time into the future. * The implementation of these files is closely tied to the compiler and runtime itself, so it makes sense to fold it into a location which can do more platform-specific checks for various implementation details (such as MSVC 32 vs 64-bit). * This removes LLVM as a build-time dependency of the standard library. This may end up becoming very useful if we move towards building the standard library with Cargo. In the immediate future, however, this commit should restore compatibility with LLVM 3.5 and 3.6.
2015-06-27mk: Add support for i686-pc-windows-msvcAlex Crichton-0/+19
This commit modifies the configure script and our makefiles to support building 32-bit MSVC targets. The MSVC toolchain is now parameterized over whether it can produce a 32-bit or 64-bit binary. The configure script was updated to export more variables at configure time, and the makefiles were rejiggered to selectively reexport the relevant environment variables for the applicable targets they're going to run for.
2015-06-25msvc: Implement runtime support for unwindingAlex Crichton-3/+6
Now that LLVM has been updated, the only remaining roadblock to implementing unwinding for MSVC is to fill out the runtime support in `std::rt::unwind::seh`. This commit does precisely that, fixing up some other bits and pieces along the way: * The `seh` unwinding module now uses `RaiseException` to initiate a panic. * The `rust_try.ll` file was rewritten for MSVC (as it's quite different) and is located at `rust_try_msvc_64.ll`, only included on MSVC builds for now. * The personality function for all landing pads generated by LLVM is hard-wired to `__C_specific_handler` instead of the standard `rust_eh_personality` lang item. This is required to get LLVM to emit SEH unwinding information instead of DWARF unwinding information. This also means that on MSVC the `rust_eh_personality` function is entirely unused (but is defined as it's a lang item). More details about how panicking works on SEH can be found in the `rust_try_msvc_64.ll` or `seh.rs` files, but I'm always open to adding more comments! A key aspect of this PR is missing, however, which is that **unwinding is still turned off by default for MSVC**. There is a [bug in llvm][llvm-bug] which causes optimizations to inline enough landing pads that LLVM chokes. If the compiler is optimized at `-O1` (where inlining isn't enabled) then it can bootstrap with unwinding enabled, but when optimized at `-O2` (inlining is enabled) then it hits a fatal LLVM error. [llvm-bug]: https://llvm.org/bugs/show_bug.cgi?id=23884
2015-05-19mk: Fix building compiler-rt on MSVCAlex Crichton-5/+19
It looks like compiler-rt has a cmake build sytem inside its source, but I have been unable to figure out how to use it and actually build the right library. For now this commit hard-wires MSVC-targeting builds of libcompiler-rt to continue using `make` as the primary bulid system, but some frobbing of the flags are necessary to ensure that the right compiler is used.
2015-05-19mk: Add build system support for cl.exeAlex Crichton-3/+3
We have a number of support C/C++ files in Rust that we link into the standard library and other various locations, and these all need to be built with cl.exe instead of gcc.exe when targeting MSVC. This commit adds helper macros for this functionality to use different sets of programs/flags/invocations on MSVC than on GNU-like platforms.
2015-05-19mk: Correct names of installed libs on windowsAlex Crichton-6/+1
Previously libmorestack.a and libcompiler-rt.a were installed, but link.exe looks for morestack.lib and compiler-rt.lib by default, so we need to install these with the correct name
2015-04-28test: Fix some tests to run with muslAlex Crichton-2/+2
There were a few test cases to fix: * Dynamic libraries are not supported with MUSL right now, so all of those related test which force or require dylibs are ignored. * Looks like the default stack for MUSL is smaller than glibc, so a few stack allocations in benchmarks were boxed up (shouldn't have a perf impact). * Some small linkage tweaks here and there * Out-of-stack detection does not currently work with MUSL
2015-04-27mk: Add support for musl-based buildsAlex Crichton-1/+20
This commit adds support to the makefiles, configuration script, and build system to understand MUSL. This is broken up into a few parts: * Any target of the form `*-musl` requires the `--musl-root` option to `./configure` which will indicate the root of the MUSL installation. It is also expected that there is a libunwind build inside of that installation built against that MUSL. * Objects from MUSL are copied into the build tree for Rust to be statically linked into the appropriate Rust library. * Objects for binary startup and shutdown are included in each Rust installation by default for MUSL. This requires MUSL to only be installed on the machine compiling rust. Only a linker will be necessary for compiling against MUSL on a target machine. Eventually a MUSL and/or libunwind build may be integrated by default into the build but for now they are just always assumed to exist externally.
2015-04-08configure: Add --enable-debug-jemallocBrian Anderson-0/+4
2015-02-10Remove duplicated configuration for androidEunji Jeong-3/+1
2015-01-20Initial support for aarch64-linux-androidEunji Jeong-0/+2
2014-12-24mk: Build jemalloc with -ffunction-sectionsAlex Crichton-1/+1
It's quite possible that small programs don't use all of jemalloc, and building with -ffunction-sections and -fdata-sections allows the linker (via --gc-sections) to strip out all unused code at link time. This decreases the size of a "hello world" executable for me from 716K to 482K with no measurable impact on link time. After this patch jemalloc is still the largest portion of our hello world executables, but this helps cut down on the size at least somewhat!
2014-12-22Removed unused context-switching assembly code.Maya Nitu-3/+2
2014-11-20mk/rt: use CFG_LLVM_TARGET instead of plain target when calling llcCody P Schafer-1/+1
We add CFG_LLVM_TARGET_$(target) (which can be defined in any of the mk/cfg/* files) and supply a default to the plain target name CFG_LLVM_TARGET mirrors the value of llvm_target (aka llvm-target) in the librustc_back runtime target specification.
2014-11-17mk/rt/jemalloc: pass CFG_GCCISH_CFLAGS inside CC instead of passing ↵Cody P Schafer-2/+2
CFG_CFLAGS in EXTRA_CFLAGS - CFG_CFLAGS is gone (it was previously only used by jemalloc anyhow). - CFG_JEMALLOC_CFLAGS may contain flags needed for the compiler to function (produce a binary output). - jemalloc's configure runs $(CC) without EXTRA_CFLAGS, and (without this change) will fail if any flags are required for CC to work.
2014-11-04Implement flexible target specificationCorey Richardson-1/+1
Removes all target-specific knowledge from rustc. Some targets have changed during this, but none of these should be very visible outside of cross-compilation. The changes make our targets more consistent. iX86-unknown-linux-gnu is now only available as i686-unknown-linux-gnu. We used to accept any value of X greater than 1. i686 was released in 1995, and should encompass the bare minimum of what Rust supports on x86 CPUs. The only two windows targets are now i686-pc-windows-gnu and x86_64-pc-windows-gnu. The iOS target has been renamed from arm-apple-ios to arm-apple-darwin. A complete list of the targets we accept now: arm-apple-darwin arm-linux-androideabi arm-unknown-linux-gnueabi arm-unknown-linux-gnueabihf i686-apple-darwin i686-pc-windows-gnu i686-unknown-freebsd i686-unknown-linux-gnu mips-unknown-linux-gnu mipsel-unknown-linux-gnu x86_64-apple-darwin x86_64-unknown-freebsd x86_64-unknown-linux-gnu x86_64-pc-windows-gnu Closes #16093 [breaking-change]
2014-10-20mk/rt: "export CC" does not seem to work (gcc observed), use explicit shell ↵Cody P Schafer-6/+5
variables instead
2014-10-02remove the uv_support codeDaniel Micay-2/+1
2014-10-01Remove libuv, gypAaron Turon-136/+1
This commit removes the libuv and gyp submodules, as well as all build infrastructure related to them. For more context, see the [runtime removal RFC](https://github.com/rust-lang/rfcs/pull/230) [breaking-change]
2014-09-22Copy GYP environment variables on iOSMatt Coffin-0/+3
2014-09-22Ensure that compiler environment is passed to gypMatt Coffin-0/+3
this only affects libuv
2014-09-14mk: Don't depend on src/jemalloc/VERSIONAlex Crichton-0/+4
This file is touched during the build process and will trigger more rebuilds than necessary. Closes #17183
2014-09-07enable jemalloc debugging in unoptimized buildsDaniel Micay-1/+1
The performance hit from these checks is significant, but unoptimized builds are already incredibly slow. Enabling these checks results in better test coverage since there are bots doing unoptimized builds, and the cost is relatively small in the context of an unoptimized build. This also allows using `JEMALLOC_FLAGS` to override the default configure flags.
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-1/+5
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705