Commit graph

10 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
1e1d907e6a
pgo: Blindly try to fix Windows build. 2018-03-25 23:17:47 +02:00
Emilio Cobos Álvarez
aaeb40ab3b
profiler_builtins: Add missing ProfilingNameVar file to the profiler build.
Otherwise opt builds with pgo-gen fail, d'oh.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:05 +02:00
Emilio Cobos Álvarez
e8a1575cf6
profiler-builtins: define COMPILER_RT_HAS_UNAME on non-msvc platforms.
Otherwise lprofGetHostName, used by the PGO generator, won't be available.

This means that PGO and coverage profiling would be restricted to systems with
uname, but that seems acceptable.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:04 +02:00
Tamir Duberstein
94d02b896c
*: strip calls to cc::Build::compile
The documentation states: "The name output should be the name of the
library." and this is already done in more recently-added callers.
2017-11-28 18:15:30 -05:00
Alex Crichton
7694ca419b Update to the cc crate
This is the name the `gcc` crate has moved to
2017-09-28 07:45:50 -07:00
Ralf Jung
12d84cc009 update gcc crate
Use gcc::Build rather than deprecated gcc::Config.
Fixes #43973
2017-09-02 21:51:18 +02:00
Alex Crichton
7e6c9f3635 Switch to rust-lang-nursery/compiler-builtins
This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-05 07:08:36 -07:00
Marco Castelluccio
8748bdd353 Redefine strdup, open, fdopen as _strdup, _open, _fdopen to avoid linking errors on MSVC 2017-06-12 23:08:57 +01:00
Marco Castelluccio
900ba559b6 Compile WindowsMMap too on MSVC 2017-06-12 23:08:08 +01:00
whitequark
42754ce710 Add profiling support, through the rustc -Z profile flag.
When -Z profile is passed, the GCDAProfiling LLVM pass is added
to the pipeline, which uses debug information to instrument the IR.
After compiling with -Z profile, the $(OUT_DIR)/$(CRATE_NAME).gcno
file is created, containing initial profiling information.
After running the program built, the $(OUT_DIR)/$(CRATE_NAME).gcda
file is created, containing branch counters.

The created *.gcno and *.gcda files can be processed using
the "llvm-cov gcov" and "lcov" tools. The profiling data LLVM
generates does not faithfully follow the GCC's format for *.gcno
and *.gcda files, and so it will probably not work with other tools
(such as gcov itself) that consume these files.
2017-05-01 09:16:20 +00:00