Skip to content

Commit

Permalink
chore(releasing): Remove -Clink-self-contained=no from musl builds (#…
Browse files Browse the repository at this point in the history
…9771)

* chore(releasing): Remove `-Clink-self-contained=no` from musl builds

This was added in c7da80a but seems to break builds of Rust 1.56.0
with:

```
  = note: /usr/local/bin/../lib/gcc/arm-linux-musleabihf/6.4.0/../../../../arm-linux-musleabihf/bin/ld: cannot find -lunwind
          collect2: error: ld returned 1 exit status
```

I think this is because of these changes in Rust in 1.56.0:

rust-lang/rust@4c9896f#diff-b78a4729cc6ec9756d0e89273cb5d1b0bb906264d7d5ed5aa6f759ad07d47c62

It isn't immediately clear to me why we can't have Rust build the libraries to
link in so opening this for feedback and to see if it works for all of our
cross builds.

Signed-off-by: Jesse Szwedko <[email protected]>

* Run cross builds when .cargo changes

Signed-off-by: Jesse Szwedko <[email protected]>
  • Loading branch information
jszwedko authored Oct 26, 2021
1 parent 3b4e375 commit 924d002
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ rustflags = ["-C", "link-args=-rdynamic"]
rustflags = ["-C", "link-args=-rdynamic"]


[target.'cfg(target_env = "musl")']
# Turn off self-contained linking mode. This makes rustc rely on the installed musl toolchain to
# find and link against C and C++ runtime objects, instead of linking against the bundled C ones.
rustflags = "-Clink-self-contained=no"

# for these musl targets libstdc++ will be linked statically (that's configured in e.g. leveldb-sys)
# we provide the location of that library here
[target.x86_64-unknown-linux-musl]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
deny:
- 'deny.toml'
dependencies:
- ".cargo/**"
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain'
Expand Down

0 comments on commit 924d002

Please sign in to comment.