about summary refs log tree commit diff
path: root/src/test/run-make
AgeCommit message (Collapse)AuthorLines
2017-05-15Remove rustc_llvm dependency from librustcRobin Kruppe-0/+1
Consequently, session creation can no longer initialize LLVM. The few places that use the compiler without going through rustc_driver/CompilerCalls thus need to be careful to manually initialize LLVM (via rustc_trans!) immediately after session creation. This means librustc is not rebuilt when LLVM changes.
2017-05-14Remove rustc_llvm dependency from rustc_metadataRobin Kruppe-1/+2
Move the code for loading metadata from rlibs and dylibs from rustc_metadata into rustc_trans, and introduce a trait to avoid introducing a direct dependency on rustc_trans. This means rustc_metadata is no longer rebuilt when LLVM changes.
2017-05-08Rollup merge of #41520 - estebank:trace-macro, r=nikomatsakisCorey Farwell-24/+0
Use diagnostics for trace_macro instead of println When using `trace_macro`, use `span_label`s instead of `println`: ```rust note: trace_macro --> $DIR/trace-macro.rs:14:5 | 14 | println!("Hello, World!"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expands to `println! { "Hello, World!" }` = note: expands to `print! { concat ! ( "Hello, World!" , "\n" ) }` ``` Fix #22597.
2017-05-05Use diagnostics for trace_macro instead of printlnEsteban Küber-24/+0
2017-05-04Reload nameserver information on lookup failureJon Gjengset-0/+1
As discussed in #41570, UNIX systems often cache the contents of /etc/resolv.conf, which can cause lookup failures to persist even after a network connection becomes available. This patch modifies lookup_host to force a reload of the nameserver entries following a lookup failure. This is in line with what many C programs already do (see #41570 for details). On systems with nscd, this should not be necessary, but not all systems run nscd. Introduces an std linkage dependency on libresolv on macOS/iOS (which also makes it necessary to update run-make/tools.mk). Fixes #41570. Depends on rust-lang/libc#585.
2017-05-01Add profiling support, through the rustc -Z profile flag.whitequark-0/+18
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-04-25Do not check if libclang_rt.?san_*_dynamic.dylib is an unstable crate.kennytm-3/+4
These are not even crates...
2017-04-25Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin.kennytm-15/+23
ASan and TSan are supported on macOS, and this commit enables their support. The sanitizers are always built as *.dylib on Apple platforms, so they cannot be statically linked into the corresponding `rustc_?san.rlib`. The dylibs are directly copied to `lib/rustlib/x86_64-apple-darwin/lib/` instead. Note, although Xcode also ships with their own copies of ASan/TSan dylibs, we cannot use them due to version mismatch. There is a caveat: the sanitizer libraries are linked as @rpath, so the user needs to additionally pass `-C rpath`: rustc -Z sanitizer=address -C rpath file.rs ^~~~~~~~ Otherwise there will be a runtime error: dyld: Library not loaded: @rpath/libclang_rt.asan_osx_dynamic.dylib Referenced from: /path/to/executable Reason: image not found Abort trap: 6 The next commit includes a temporary change in compiler to force the linker to emit a usable @rpath.
2017-04-21Update #[no_core] users with the "freeze" lang item.Eduard-Mihai Burtescu-2/+10
2017-04-19rustc_trans: do not treat byval as using up registers.Eduard-Mihai Burtescu-0/+23
2017-04-11Fix pairs of doubles using an illegal <8 x i8> vector.Eduard-Mihai Burtescu-0/+30
2017-04-07-Z linker-flavorJorge Aparicio-0/+3
This patch adds a `-Z linker-flavor` flag to rustc which can be used to invoke the linker using a different interface. For example, by default rustc assumes that all the Linux targets will be linked using GCC. This makes it impossible to use LLD as a linker using just `-C linker=ld.lld` because that will invoke LLD with invalid command line arguments. (e.g. rustc will pass -Wl,--gc-sections to LLD but LLD doesn't understand that; --gc-sections would be the right argument) With this patch one can pass `-Z linker-flavor=ld` to rustc to invoke the linker using a LD-like interface. This way, `rustc -C linker=ld.lld -Z linker-flavor=ld` will invoke LLD with the right arguments. `-Z linker-flavor` accepts 4 different arguments: `em` (emcc), `ld`, `gcc`, `msvc` (link.exe). `em`, `gnu` and `msvc` cover all the existing linker interfaces. `ld` is a new flavor for interfacing GNU's ld and LLD. This patch also changes target specifications. `linker-flavor` is now a mandatory field that specifies the *default* linker flavor that the target will use. This change also makes the linker interface *explicit*; before, it used to be derived from other fields like linker-is-gnu, is-like-msvc, is-like-emscripten, etc. Another change to target specifications is that the fields `pre-link-args`, `post-link-args` and `late-link-args` now expect a map from flavor to linker arguments. ``` diff - "pre-link-args": ["-Wl,--as-needed", "-Wl,-z,-noexecstack"], + "pre-link-args": { + "gcc": ["-Wl,--as-needed", "-Wl,-z,-noexecstack"], + "ld": ["--as-needed", "-z,-noexecstack"], + }, ``` [breaking-change] for users of custom targets specifications
2017-04-07Auto merge of #39987 - japaric:used, r=arielb1bors-0/+28
#[used] attribute (For an explanation of what this feature does, read the commit message) I'd like to propose landing this as an experimental feature (experimental as in: no clear stabilization path -- like `asm!`, `#[linkage]`) as it's low maintenance (I think) and relevant to the "Usage in resource-constrained environments" exploration area. The main use case I see is running code before `main`. This could be used, for instance, to cheaply initialize an allocator before `main` where the alternative is to use `lazy_static` to initialize the allocator on its first use which it's more expensive (atomics) and doesn't work on ARM Cortex-M0 microcontrollers (no `AtomicUsize` on that platform) Here's a `std` example of that: ``` rust unsafe extern "C" fn before_main_1() { println!("Hello"); } unsafe extern "C" fn before_main_2() { println!("World"); } #[link_section = ".init_arary"] #[used] static INIT_ARRAY: [unsafe extern "C" fn(); 2] = [before_main_1, before_main_2]; fn main() { println!("Goodbye"); } ``` ``` $ rustc -C lto -C opt-level=3 before_main.rs $ ./before_main Hello World Goodbye ``` In general, this pattern could be used to let *dependencies* run code before `main` (which sounds like it could go very wrong in some cases). There are probably other use cases; I hope that the people I have cc-ed can comment on those. Note that I'm personally unsure if the above pattern is something we want to promote / allow and that's why I'm proposing this feature as experimental. If this leads to more footguns than benefits then we can just axe the feature. cc @nikomatsakis ^ I know you have some thoughts on having a process for experimental features though I'm fine with writing an RFC before landing this. - `dead_code` lint will have to be updated to special case `#[used]` symbols. - Should we extend `#[used]` to work on non-generic functions? cc rust-lang/rfcs#1002 cc rust-lang/rfcs#1459 cc @dpc @JinShil
2017-04-06don't pass -C to nmJorge Aparicio-1/+1
the nm in our macOS bots don't support that flag and it's not really required
2017-04-05don't test for the absence of BAR in the rmake testJorge Aparicio-1/+0
it's not related to this feature
2017-04-05Auto merge of #40348 - nrc:save-extern-fn, r=eddybbors-0/+5
Handle extern functions and statics in save-analysis r? @eddyb
2017-04-05fix location of the emitted object fileJorge Aparicio-2/+2
2017-04-05add tracking issue and feature-gate and run-make testsJorge Aparicio-0/+29
2017-04-05Rollup merge of #41085 - nagisa:fix-output-properg, r=alexcrichtonCorey Farwell-0/+18
Properly adjust filenames when multiple emissions Fixes #40993 Should backport just fine to beta but not sure if we want to do this since this is quite old stable regression.
2017-04-05Rollup merge of #40870 - alexcrichton:stabilize-windows-subsystem, r=aturonCorey Farwell-2/+0
rustc: Stabilize the `#![windows_subsystem]` attribute This commit stabilizes the `#![windows_subsystem]` attribute which is a conservative exposure of the `/SUBSYSTEM` linker flag on Widnows platforms. This is useful for creating applications as well as console programs. Closes #37499
2017-04-05Properly adjust filenames when multiple emissionsSimonas Kazlauskas-0/+18
Fixes #40993
2017-04-04save-analysis: index extern blocksNick Cameron-0/+5
2017-04-03Auto merge of #40915 - nrc:save-assoc, r=eddybbors-0/+17
save-analysis: track associated types r? @eddyb
2017-04-01rustc: Stabilize the `#![windows_subsystem]` attributeAlex Crichton-2/+0
This commit stabilizes the `#![windows_subsystem]` attribute which is a conservative exposure of the `/SUBSYSTEM` linker flag on Widnows platforms. This is useful for creating applications as well as console programs. Closes #37499
2017-03-30kill the graphviz-flowgraph testsNiko Matsakis-1963/+0
They are so annoying to update, and haven't caught any bugs afaik.
2017-03-30save-analysis: track associated typesNick Cameron-0/+17
2017-03-21Regression test for rust-lang/rust#40535Austin Bonander-0/+49
2017-03-12Auto merge of #40446 - arielb1:rollup, r=alexcrichtonbors-1/+23
Rollup of 12 pull requests - Successful merges: #40146, #40299, #40315, #40319, #40344, #40345, #40372, #40373, #40400, #40404, #40419, #40431 - Failed merges:
2017-03-11Auto merge of #40220 - jseyfried:ast_macro_def, r=nrcbors-0/+1
syntax: add `ast::ItemKind::MacroDef`, simplify hygiene info This PR - adds a new variant `MacroDef` to `ast::ItemKind` for `macro_rules!` and eventually `macro` items, - [breaking-change] forbids macro defs without a name (`macro_rules! { () => {} }` compiles today), - removes `ast::MacroDef`, and - no longer uses `Mark` and `Invocation` to identify and characterize macro definitions. - We used to apply (at least) two `Mark`s to an expanded identifier's `SyntaxContext` -- the definition mark(s) and the expansion mark(s). We now only apply the latter. r? @nrc
2017-03-11Rollup merge of #40373 - TimNN:test-ub-packed, r=arielb1Ariel Ben-Yehuda-1/+23
Fix UB in repr(packed) tests r? @arielb1 cc #37609 and #27060
2017-03-10rustc: Exit quickly on only `--emit dep-info`Alex Crichton-0/+19
This commit alters the compiler to exit quickly if the only output being emitted is `dep-info`, which doesn't need a lot of other information to generate. Closes #40328
2017-03-10Refactor out `ast::ItemKind::MacroDef`.Jeffrey Seyfried-0/+1
2017-03-08fix UB in repr(packed) testsTim Neumann-1/+23
2017-03-04run-make on MSVC: Do not generate object files in the source directoryVadim Petrochenkov-1/+1
2017-03-02Rollup merge of #40173 - er-1:master, r=alexcrichtonGuillaume Gomez-2/+2
Add a reference to the dl library to the Makefile of the test issue-2… …4445. It prevents the test to fail on ppc64el at least. Part of #39015
2017-03-01Auto merge of #39803 - brson:fpic, r=alexcrichtonbors-0/+24
Add a test that -fPIC is applied r? @alexcrichton Can it really be this simple? I've tested it works, but still testing that it used to fail.
2017-03-01Don't run test on darwinAlex Crichton-2/+6
2017-03-01Add a reference to the dl library to the Makefile of the test issue-24445.er-1-2/+2
It prevents the test to fail on ppc64el at least. Part of #39015
2017-02-25Rollup merge of #39864 - cramertj:normalize-breaks, r=nikomatsakisEduard-Mihai Burtescu-32/+32
Normalize labeled and unlabeled breaks Part of #39849.
2017-02-21test: Verify all sysroot crates are unstableAlex Crichton-0/+34
As we continue to add more crates to the compiler and use them to implement various features we want to be sure we're not accidentally expanding the API surface area of the compiler! To that end this commit adds a new `run-make` test which will attempt to `extern crate foo` all crates in the sysroot, verifying that they're all unstable. This commit discovered that the `std_shim` and `test_shim` crates were accidentally stable and fixes the situation by deleting those shims. The shims are no longer necessary due to changes in Cargo that have happened since they were originally incepted.
2017-02-18Add tests for control flow in while conditionTaylor Cramer-32/+32
2017-02-15Add a test that -fPIC is appliedBrian Anderson-0/+20
2017-02-14Rollup merge of #39785 - alexcrichton:no-thread-sanitizer, r=japaricCorey Farwell-31/+0
test: Remove sanitizer-thread test Unfortunately it appears to spuriously fail so we can't gate on it
2017-02-13test: Remove sanitizer-thread testAlex Crichton-31/+0
Unfortunately it appears to spuriously fail so we can't gate on it
2017-02-11Add tested item in the rustdoc --test outputGuillaume Gomez-1/+1
2017-02-08sanitizer-dylib: only run where std for x86_64-linux is availableJorge Aparicio-1/+5
2017-02-08fix the sanitizer-dylib test on non x86_64 linux hostsJorge Aparicio-1/+1
2017-02-08build/test the sanitizers only when --enable-sanitizers is usedJorge Aparicio-49/+4
2017-02-08sanitizer supportJorge Aparicio-0/+187
2017-02-06Revert "Add 128-bit atomics"Alex Crichton-9/+1
This reverts commit 9903975003276cc42a1ed5f21eee292b7c62c331.