File: rmake.rs

package info (click to toggle)
rustc 1.89.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 906,624 kB
  • sloc: xml: 158,148; python: 34,888; javascript: 19,595; sh: 19,221; ansic: 13,046; cpp: 7,144; asm: 4,376; makefile: 692; lisp: 174; sql: 15
file content (27 lines) | stat: -rw-r--r-- 909 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// In some cases, linking libraries with GNU used to fail due to how
// `std` and `core` possess a circular dependency with one another, and
// how the linker could not go back through its symbol processing to resolve
// the circular link. #49316 fixed this, and this test reproduces a minimal
// version of one such linking attempt which used to fail.
// See https://github.com/rust-lang/rust/issues/18807

//@ ignore-cross-compile

use run_make_support::{is_darwin, is_windows, rustc};

fn main() {
    rustc().input("bar.rs").run();

    let mut rustc_foo = rustc();
    rustc_foo.input("foo.rs");
    let mut rustc_foo_panic = rustc();
    rustc_foo_panic.input("foo.rs").panic("abort");

    if !is_darwin() && !is_windows() {
        rustc_foo.arg("-Clink-args=-Wl,--no-undefined");
        rustc_foo_panic.arg("-Clink-args=-Wl,--no-undefined");
    }

    rustc_foo.run();
    rustc_foo_panic.run();
}