rust-lang / rustc_codegen_cranelift

Cranelift based backend for rustc
Apache License 2.0
1.61k stars 100 forks source link

MacOS Monterey build failure #1231

Closed trickster closed 6 months ago

trickster commented 2 years ago

Same installation instructions.

Rust compiler: nightly 1.63 Mac OS Version: 12.4

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/sivaram.konanki/Projects/rustc_codegen_cranelift/build_sysroot/target/x86_64-apple-darwin/release/deps/liblibc-ed5a7914adca68ac.rlib(lib.rmeta) has no symbols
   Compiling alloc v0.0.0 (/Projects/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/alloc)
   Compiling cfg-if v0.1.10
   Compiling adler v1.0.2
   Compiling memchr v2.5.0
   Compiling rustc-demangle v0.1.21
[compiler_builtins             : codegen mono items] start
error: 128bit atomics not yet supported
    --> sysroot_src/library/core/src/sync/atomic.rs:2585:24
     |
2585 |             Acquire => intrinsics::atomic_load_acq(dst),
bjorn3 commented 2 years ago

Which commit are you building? The latest commit (https://github.com/bjorn3/rustc_codegen_cranelift/commit/c431540544a03dc09577df4b97afd868deb167e5) doesn't have that error anywhere in the source code. Instead it is a runtime error if you actually call AtomicU128::load(), which is unstable and unavailable on x86_64: https://github.com/bjorn3/rustc_codegen_cranelift/blob/c431540544a03dc09577df4b97afd868deb167e5/src/intrinsics/mod.rs#L781

trickster commented 2 years ago

This is the commit I am on, it's the latest one you linked

➜ git log -n 1
commit c431540544a03dc09577df4b97afd868deb167e5 (HEAD -> master, origin/master, origin/HEAD)
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Tue Jun 14 12:34:26 2022 +0200

    Rustup to rustc 1.63.0-nightly (ca122c7eb 2022-06-13)
bjorn3 commented 2 years ago

I have no clue how that can happen. CI passes for x86_64 macOS. Can you try ./clean_all.sh && ./y.rs prepare and then build again?

trickster commented 2 years ago

Is the CI updated to latest MacOS ? This used to work in the last version of MacOS

➜ ./clean_all.sh

rustc_codegen_cranelift on  master via 🦀 v1.63.0-nightly on proj  ➜ ./y.rs prepare
[BUILD] y.rs
warning: unused variable: `command`
  --> ./build_system/mod.rs:46:9
   |
46 |     let command = match args.next().as_deref() {
   |         ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_command`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted

[COPY] sysroot src
[GIT] init
On branch main

Initial commit

nothing to commit (create/copy files and use "git add" to track)

rustc_codegen_cranelift on  master via 🦀 v1.63.0-nightly on proj  took 2s
➜ ./y.rs build
[BUILD] y.rs
warning: unused variable: `command`
  --> ./build_system/mod.rs:46:9
   |
46 |     let command = match args.next().as_deref() {
   |         ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_command`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted

[BUILD] rustc_codegen_cranelift
   Compiling libc v0.2.126
   Compiling cfg-if v1.0.0
   Compiling version_check v0.9.4
   Compiling once_cell v1.10.0
   Compiling autocfg v1.1.0
   Compiling cranelift-codegen-shared v0.84.0
   Compiling log v0.4.14
   Compiling target-lexicon v0.12.3
   Compiling byteorder v1.4.3
   Compiling smallvec v1.8.0
   Compiling cranelift-entity v0.84.0
   Compiling slice-group-by v0.3.0
   Compiling anyhow v1.0.56
   Compiling memchr v2.4.1
   Compiling crc32fast v1.3.2
   Compiling bitflags v1.3.2
   Compiling ar v0.8.0 (https://github.com/bjorn3/rust-ar.git?branch=do_not_remove_cg_clif_ranlib#de9ab0e5)
   Compiling libloading v0.6.7
   Compiling cranelift-codegen-meta v0.84.0
   Compiling ahash v0.7.6
   Compiling indexmap v1.8.0
   Compiling fxhash v0.2.1
   Compiling cranelift-bforest v0.84.0
   Compiling regalloc2 v0.1.3
   Compiling getrandom v0.2.6
   Compiling mach v0.3.2
   Compiling hashbrown v0.11.2
   Compiling region v2.2.0
   Compiling cranelift-codegen v0.84.0
   Compiling gimli v0.26.1
   Compiling object v0.28.4
   Compiling cranelift-module v0.84.0
   Compiling cranelift-native v0.84.0
   Compiling cranelift-frontend v0.84.0
   Compiling cranelift-jit v0.84.0
   Compiling cranelift-object v0.84.0
   Compiling rustc_codegen_cranelift v0.1.0 (/Users//Projects/rustc_codegen_cranelift)
    Finished release [optimized] target(s) in 1m 24s
   Compiling compiler_builtins v0.1.75
   Compiling core v0.0.0 (/Users//Projects/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/core)
   Compiling libc v0.2.126
   Compiling cc v1.0.73
   Compiling memchr v2.5.0
   Compiling autocfg v1.1.0
   Compiling std v0.0.0 (/Users//Projects/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/std)
   Compiling miniz_oxide v0.4.4
   Compiling unwind v0.0.0 (/Users//Projects/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/unwind)
   Compiling rustc-std-workspace-core v1.99.0 (/Users//Projects/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/rustc-std-workspace-core)
[rustc_std_workspace_core      : codegen mono items] start
[rustc_std_workspace_core      : codegen mono items] end time: 565.537µs
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users//Projects/rustc_codegen_cranelift/build_sysroot/target/x86_64-apple-darwin/release/deps/librustc_std_workspace_core-22fc309cd5d866c0.rlib(lib.rmeta) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users//Projects/rustc_codegen_cranelift/build_sysroot/target/x86_64-apple-darwin/release/deps/librustc_std_workspace_core-22fc309cd5d866c0.rlib(rustc_std_workspace_core-22fc309cd5d866c0.1pdh1pp1nmt34yat.rcgu.o) has no symbols
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: /Users//Projects/rustc_codegen_cranelift/build_sysroot/target/x86_64-apple-darwin/release/deps/librustc_std_workspace_core-22fc309cd5d866c0.rlib the table of contents is empty (no object file members in the library define global symbols)
[core                          : codegen mono items] start
[libc                          : codegen mono items] start
[libc                          : codegen mono items] end time: 16.029294ms
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users//Projects/rustc_codegen_cranelift/build_sysroot/target/x86_64-apple-darwin/release/deps/liblibc-ed5a7914adca68ac.rlib(lib.rmeta) has no symbols
   Compiling alloc v0.0.0 (/Users//Projects/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/alloc)
   Compiling cfg-if v0.1.10
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.21
[compiler_builtins             : codegen mono items] start
error: 128bit atomics not yet supported
    --> sysroot_src/library/core/src/sync/atomic.rs:2585:24
     |
2585 |             Acquire => intrinsics::atomic_load_acq(dst),
     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

fn sync::atomic::atomic_load(_1: *const T, _2: sync::atomic::Ordering) -> T {
    debug dst => _1;                     // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2581:32: 2581:35
    debug order => _2;                   // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2581:47: 2581:52
    let mut _0: T;                       // return place in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2581:67: 2581:68
    let mut _3: isize;                   // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2585:13: 2585:20
    let mut _4: *const T;                // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2585:52: 2585:55
    let mut _5: *const T;                // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2586:56: 2586:59
    let mut _6: *const T;                // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2587:47: 2587:50
    let mut _7: !;                       // in scope 0 at sysroot_src/library/core/src/panic.rs:57:9: 57:73
    let mut _8: fmt::Arguments;          // in scope 0 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
    let mut _9: &[&str];                 // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
    let mut _10: &[&str; 1];             // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
    let _11: &[&str; 1];                 // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
    let mut _12: &[fmt::ArgumentV1];     // in scope 0 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
    let mut _13: &[fmt::ArgumentV1; 0];  // in scope 0 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
    let _14: &[fmt::ArgumentV1; 0];      // in scope 0 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
    let mut _15: !;                      // in scope 0 at sysroot_src/library/core/src/panic.rs:57:9: 57:73
    let mut _16: fmt::Arguments;         // in scope 0 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
    let mut _17: &[&str];                // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
    let mut _18: &[&str; 1];             // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
    let _19: &[&str; 1];                 // in scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
    let mut _20: &[fmt::ArgumentV1];     // in scope 0 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
    let mut _21: &[fmt::ArgumentV1; 0];  // in scope 0 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
    let _22: &[fmt::ArgumentV1; 0];      // in scope 0 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
    scope 1 {
        let mut _23: &[fmt::ArgumentV1; 0]; // in scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        let mut _24: &[&str; 1];         // in scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
        let mut _25: &[fmt::ArgumentV1; 0]; // in scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        let mut _26: &[&str; 1];         // in scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
    }

    bb0: {
        _3 = discriminant(_2);           // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2584:15: 2584:20
        switchInt(move _3) -> [0_isize: bb5, 1_isize: bb9, 2_isize: bb3, 3_isize: bb1, 4_isize: bb7, otherwise: bb2]; // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2584:9: 2584:20
    }

    bb1: {
        StorageLive(_15);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:9: 57:73
        StorageLive(_16);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        StorageLive(_17);                // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
        StorageLive(_18);                // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
        StorageLive(_19);                // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
        _26 = const sync::atomic::atomic_load::<T>::promoted[3]; // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
                                         // + literal: Const { ty: &[&str; 1], val: Unevaluated(sync::atomic::atomic_load, [T], Some(promoted[3])) }
        _19 = _26;                       // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
        _18 = _19;                       // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
        _17 = move _18 as &[&str] (Pointer(Unsize)); // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2589:30: 2589:81
        StorageDead(_18);                // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2589:80: 2589:81
        StorageLive(_20);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        StorageLive(_21);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        StorageLive(_22);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        _25 = const sync::atomic::atomic_load::<T>::promoted[2]; // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/panic.rs:57:38: 57:72
                                         // + literal: Const { ty: &[fmt::ArgumentV1; 0], val: Unevaluated(sync::atomic::atomic_load, [T], Some(promoted[2])) }
        _22 = _25;                       // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        _21 = _22;                       // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        _20 = move _21 as &[fmt::ArgumentV1] (Pointer(Unsize)); // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        StorageDead(_21);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:71: 57:72
        _16 = fmt::Arguments::new_v1(move _17, move _20) -> bb11; // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/panic.rs:57:38: 57:72
                                         // + user_ty: UserType(1)
                                         // + literal: Const { ty: fn(&[&'static str], &[fmt::ArgumentV1]) -> fmt::Arguments {fmt::Arguments::new_v1}, val: Value(Scalar(<ZST>)) }
    }

    bb2: {
        unreachable;                     // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2584:15: 2584:20
    }

    bb3: {
        StorageLive(_4);                 // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2585:52: 2585:55
        _4 = _1;                         // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2585:52: 2585:55
        _0 = intrinsics::atomic_load_acq::<T>(move _4) -> bb4; // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2585:24: 2585:56
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/sync/atomic.rs:2585:24: 2585:51
                                         // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const T) -> T {intrinsics::atomic_load_acq::<T>}, val: Value(Scalar(<ZST>)) }
    }

    bb4: {
        StorageDead(_4);                 // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2585:55: 2585:56
        goto -> bb12;                    // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2585:55: 2585:56
    }

    bb5: {
        StorageLive(_5);                 // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2586:56: 2586:59
        _5 = _1;                         // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2586:56: 2586:59
        _0 = intrinsics::atomic_load_relaxed::<T>(move _5) -> bb6; // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2586:24: 2586:60
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/sync/atomic.rs:2586:24: 2586:55
                                         // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const T) -> T {intrinsics::atomic_load_relaxed::<T>}, val: Value(Scalar(<ZST>)) }
    }

    bb6: {
        StorageDead(_5);                 // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2586:59: 2586:60
        goto -> bb12;                    // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2586:59: 2586:60
    }

    bb7: {
        StorageLive(_6);                 // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2587:47: 2587:50
        _6 = _1;                         // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2587:47: 2587:50
        _0 = intrinsics::atomic_load::<T>(move _6) -> bb8; // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2587:23: 2587:51
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/sync/atomic.rs:2587:23: 2587:46
                                         // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const T) -> T {intrinsics::atomic_load::<T>}, val: Value(Scalar(<ZST>)) }
    }

    bb8: {
        StorageDead(_6);                 // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2587:50: 2587:51
        goto -> bb12;                    // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2587:50: 2587:51
    }

    bb9: {
        StorageLive(_7);                 // scope 1 at sysroot_src/library/core/src/panic.rs:57:9: 57:73
        StorageLive(_8);                 // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        StorageLive(_9);                 // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
        StorageLive(_10);                // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
        StorageLive(_11);                // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
        _24 = const sync::atomic::atomic_load::<T>::promoted[1]; // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
                                         // + literal: Const { ty: &[&str; 1], val: Unevaluated(sync::atomic::atomic_load, [T], Some(promoted[1])) }
        _11 = _24;                       // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
        _10 = _11;                       // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
        _9 = move _10 as &[&str] (Pointer(Unsize)); // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2588:31: 2588:73
        StorageDead(_10);                // scope 1 at sysroot_src/library/core/src/sync/atomic.rs:2588:72: 2588:73
        StorageLive(_12);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        StorageLive(_13);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        StorageLive(_14);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        _23 = const sync::atomic::atomic_load::<T>::promoted[0]; // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/panic.rs:57:38: 57:72
                                         // + literal: Const { ty: &[fmt::ArgumentV1; 0], val: Unevaluated(sync::atomic::atomic_load, [T], Some(promoted[0])) }
        _14 = _23;                       // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        _13 = _14;                       // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        _12 = move _13 as &[fmt::ArgumentV1] (Pointer(Unsize)); // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
        StorageDead(_13);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:71: 57:72
        _8 = fmt::Arguments::new_v1(move _9, move _12) -> bb10; // scope 1 at sysroot_src/library/core/src/panic.rs:57:38: 57:72
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/panic.rs:57:38: 57:72
                                         // + user_ty: UserType(0)
                                         // + literal: Const { ty: fn(&[&'static str], &[fmt::ArgumentV1]) -> fmt::Arguments {fmt::Arguments::new_v1}, val: Value(Scalar(<ZST>)) }
    }

    bb10: {
        StorageDead(_12);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:71: 57:72
        StorageDead(_9);                 // scope 1 at sysroot_src/library/core/src/panic.rs:57:71: 57:72
        _7 = panicking::panic_fmt(move _8); // scope 1 at sysroot_src/library/core/src/panic.rs:57:9: 57:73
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/panic.rs:57:9: 57:37
                                         // + literal: Const { ty: for<'r> fn(fmt::Arguments<'r>) -> ! {panicking::panic_fmt}, val: Value(Scalar(<ZST>)) }
    }

    bb11: {
        StorageDead(_20);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:71: 57:72
        StorageDead(_17);                // scope 1 at sysroot_src/library/core/src/panic.rs:57:71: 57:72
        _15 = panicking::panic_fmt(move _16); // scope 1 at sysroot_src/library/core/src/panic.rs:57:9: 57:73
                                         // mir::Constant
                                         // + span: sysroot_src/library/core/src/panic.rs:57:9: 57:37
                                         // + literal: Const { ty: for<'r> fn(fmt::Arguments<'r>) -> ! {panicking::panic_fmt}, val: Value(Scalar(<ZST>)) }
    }

    bb12: {
        return;                          // scope 0 at sysroot_src/library/core/src/sync/atomic.rs:2592:2: 2592:2
    }
}

Instance { def: Item(WithOptConstParam { did: DefId(0:9691 ~ core[cc40]::sync::atomic::atomic_load), const_param_did: None }), substs: [u128] } _ZN4core4sync6atomic11atomic_load17h82a717901a31e378E
[cfg_if                        : codegen mono items] start
[cfg_if                        : codegen mono items] end time: 623.924µs
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users//Projects/rustc_codegen_cranelift/build_sysroot/target/x86_64-apple-darwin/release/deps/libcfg_if-9249d6d1a1acf77f.rlib(lib.rmeta) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users//Projects/rustc_codegen_cranelift/build_sysroot/target/x86_64-apple-darwin/release/deps/libcfg_if-9249d6d1a1acf77f.rlib(cfg_if-9249d6d1a1acf77f.cfg_if.95b3c391-cgu.0.rcgu.o) has no symbols
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: /Users//Projects/rustc_codegen_cranelift/build_sysroot/target/x86_64-apple-darwin/release/deps/libcfg_if-9249d6d1a1acf77f.rlib the table of contents is empty (no object file members in the library define global symbols)
[adler                         : codegen mono items] start
[adler                         : codegen mono items] end time: 26.356296ms
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users//Projects/rustc_codegen_cranelift/build_sysroot/target/x86_64-apple-darwin/release/deps/libadler-708621e860efb993.rlib(lib.rmeta) has no symbols
[compiler_builtins             : codegen mono items] end time: 324.111648ms
[unwind                        : codegen mono items] start
bjorn3 commented 2 years ago

CI uses macOS 11.6.6

The latest commit (https://github.com/bjorn3/rustc_codegen_cranelift/commit/c431540544a03dc09577df4b97afd868deb167e5) doesn't have that error anywhere in the source code.

Correction, it gives an error when the current crate is not compiler-builtins. Based on the error message it looks like it happens when compiling compiler-builtins, which is weird.

trickster commented 2 years ago

This is happening since latest Monterey MacOS update

bjorn3 commented 2 years ago

I don't see how that could be related. In any case just to confirm, you are using an x86_64 based mac and not an arm64 based one, right?

bjorn3 commented 2 years ago

Also could you try adding .arg("-j1") before the final semicolon at https://github.com/bjorn3/rustc_codegen_cranelift/blob/c431540544a03dc09577df4b97afd868deb167e5/build_system/build_sysroot.rs#L186 and then build to confirm that it indeed happens while compiling compiler-builtins?

trickster commented 2 years ago

I am using Intel Mac (x86_64). I tried it with .arg("-j1"), I get the same error.

bjorn3 commented 2 years ago

I don't have a clue why compiler-builtins isn't detected as such by cg_clif for you and thus the error doesn't get downgraded to a runtime panic. The proper fix would be to implement 128bit atomics for x86_64 in Cranelift, which would entirely remove the need for this error. I don't know how hard that would be though.

bjorn3 commented 6 months ago

I'm going to close this under the assumption that whatever caused this has been resolved. If you still get this error you can use the cg_clif version distributed as rustup component instead: https://github.com/rust-lang/rustc_codegen_cranelift/#download-using-rustup