Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build on M3 MacPro with sold linker #173

Open
fcoury opened this issue Mar 1, 2024 · 6 comments
Open

Can't build on M3 MacPro with sold linker #173

fcoury opened this issue Mar 1, 2024 · 6 comments

Comments

@fcoury
Copy link

fcoury commented Mar 1, 2024

> $ cargo install --path .
  Installing bacon v2.14.3-dev (/Users/fcoury/code/bacon)
    Updating crates.io index
   Compiling proc-macro2 v1.0.78
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.153
   Compiling autocfg v1.1.0
   Compiling thiserror v1.0.57
   Compiling cfg-if v1.0.0
   Compiling serde v1.0.197
   Compiling parking_lot_core v0.9.9
   Compiling memchr v2.7.1
   Compiling crossbeam-utils v0.8.19
   Compiling regex-syntax v0.8.2
   Compiling once_cell v1.19.0
   Compiling smallvec v1.13.1
   Compiling scopeguard v1.2.0
   Compiling tinyvec_macros v0.1.1
   Compiling gix-trace v0.1.7
   Compiling rayon-core v1.12.1
   Compiling tinyvec v1.6.0
   Compiling crc32fast v1.4.0
   Compiling fastrand v2.0.1
   Compiling adler v1.0.2
   Compiling same-file v1.0.6
   Compiling bitflags v2.4.2
   Compiling either v1.10.0
   Compiling walkdir v2.4.0
   Compiling lock_api v0.4.11
   Compiling aho-corasick v1.1.2
   Compiling miniz_oxide v0.7.2
   Compiling bytesize v1.3.0
error: failed to run custom build command for `thiserror v1.0.57`

Caused by:
  process didn't exit successfully: `/Users/fcoury/code/bacon/target/release/build/thiserror-5ab653d5974c1640/build-script-build` (signal: 10, SIGBUS: access to undefined memory)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `rayon-core v1.12.1`

Caused by:
  process didn't exit successfully: `/Users/fcoury/code/bacon/target/release/build/rayon-core-2c5ae3065a5d199f/build-script-build` (signal: 10, SIGBUS: access to undefined memory)
error: failed to run custom build command for `serde v1.0.197`

Caused by:
  process didn't exit successfully: `/Users/fcoury/code/bacon/target/release/build/serde-32f36e526d05b2fa/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
error: failed to run custom build command for `parking_lot_core v0.9.9`

Caused by:
  process didn't exit successfully: `/Users/fcoury/code/bacon/target/release/build/parking_lot_core-4a7529d07e68ff4c/build-script-build` (signal: 10, SIGBUS: access to undefined memory)
error: failed to run custom build command for `crossbeam-utils v0.8.19`

Caused by:
  process didn't exit successfully: `/Users/fcoury/code/bacon/target/release/build/crossbeam-utils-eeed6c8973fa880e/build-script-build` (signal: 10, SIGBUS: access to undefined memory)
error: failed to run custom build command for `proc-macro2 v1.0.78`

Caused by:
  process didn't exit successfully: `/Users/fcoury/code/bacon/target/release/build/proc-macro2-296ff4b34021689d/build-script-build` (signal: 10, SIGBUS: access to undefined memory)
error: failed to run custom build command for `crc32fast v1.4.0`

Caused by:
  process didn't exit successfully: `/Users/fcoury/code/bacon/target/release/build/crc32fast-57edd767e203b1e3/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
error: failed to run custom build command for `libc v0.2.153`

Caused by:
  process didn't exit successfully: `/Users/fcoury/code/bacon/target/release/build/libc-7d3c3772beff9ff0/build-script-build` (signal: 10, SIGBUS: access to undefined memory)
error: failed to run custom build command for `lock_api v0.4.11`

Caused by:
  process didn't exit successfully: `/Users/fcoury/code/bacon/target/release/build/lock_api-10916c91955e0afb/build-script-build` (signal: 10, SIGBUS: access to undefined memory)
error: failed to compile `bacon v2.14.3-dev (/Users/fcoury/code/bacon)`, intermediate artifacts can be found at `/Users/fcoury/code/bacon/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
@fcoury
Copy link
Author

fcoury commented Mar 1, 2024

For future reference, this only happened when I had the sold linker configured. Removing it worked fine.

This was my .cargo/config.toml:

> $ cat ~/.cargo/config.toml
[target.aarch64-apple-darwin]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/ld64.mold"]

@fcoury fcoury closed this as completed Mar 1, 2024
@Canop
Copy link
Owner

Canop commented Mar 1, 2024

"sold linker" ? Is that mold ?

@fcoury
Copy link
Author

fcoury commented Mar 1, 2024

Yes and no. The macOS version of mold is called sold and was a paid version until recently:

https://github.com/bluewhalesystems/sold

@Canop
Copy link
Owner

Canop commented Mar 1, 2024

Ok. You may keep the issue open if you think it could be useful for bacon to be built using this linker.
But I won't work on it myself as I don't have a mac.

@fcoury fcoury reopened this Mar 1, 2024
@fcoury
Copy link
Author

fcoury commented Mar 1, 2024

Done, thank you! BTW sold also works in Linux if you want to take a look :-)

@Canop Canop changed the title Can't build on M3 MacPro? Can't build on M3 MacPro with sold linker Mar 2, 2024
@joshka
Copy link

joshka commented Sep 19, 2024

Unrelated to the issue (forgive my curiousity). When I last tested sold it was no faster for me than the default mac linker. Has that changed, or do you have some special case where it is indeed faster?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants