Repository: rust
Issue: Linker failing when importing couch_rs using rustc version 1.54
Labels: A-linkage,T-compiler,C-bug,S-needs-repro

Problem

The linker fails during the build process while trying to compile hyper when I have included couch_rs as s a dependency.

Steps

Use rustc version 1.54. When I override version to 1.53 this error goes away

Clone https://github.com/kingledion/tokio-webserver
git couch_rs-causes-linker-failure
cargo run --verbose

This causes the error: 
```
error: linking with `cc` failed: exit status: 1
...
/usr/bin/ld: /home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libtokio-ef4f7b8172b0d9c6.rlib: error adding symbols: file format not recognized
          collect2: error: ld returned 1 exit status
```

While running:
```
rustc --crate-name hyper --edition=2018 /home/dhartig/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.11/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --crate-type staticlib --crate-type cdylib --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="client"' --cfg 'feature="default"' --cfg 'feature="h2"' --cfg 'feature="http1"' --cfg 'feature="http2"' --cfg 'feature="runtime"' --cfg 'feature="server"' --cfg 'feature="socket2"' --cfg 'feature="stream"' --cfg 'feature="tcp"' -C metadata=ff900260a07c2ad1 -C extra-filename=-ff900260a07c2ad1 --out-dir /home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps -L dependency=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps --extern bytes=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libbytes-df7cac8fc38da202.rlib --extern futures_channel=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libfutures_channel-123298ef293e503a.rlib --extern futures_core=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libfutures_core-28804fd28ce97755.rlib --extern futures_util=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libfutures_util-5bd937e798aa0904.rlib --extern h2=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libh2-f070533a1ff1cede.rlib --extern http=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libhttp-f934d99aebf29821.rlib --extern http_body=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libhttp_body-4ebb83b4133a673d.rlib --extern httparse=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libhttparse-e403a7b15ffbfc14.rlib --extern httpdate=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libhttpdate-782384c8fe29436b.rlib --extern itoa=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libitoa-9ccdb0b3e3d11258.rlib --extern pin_project_lite=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libpin_project_lite-ed06e07546a7102f.rlib --extern socket2=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libsocket2-00d658c410995721.rlib --extern tokio=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libtokio-ef4f7b8172b0d9c6.rlib --extern tower_service=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libtower_service-6686e1e00a5b1c4a.rlib --extern tracing=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libtracing-dd4242961285cdba.rlib --extern want=/home/dhartig/src/github.com/kingledion/tokio-webserver/target/debug/deps/libwant-8978c7a581707af0.rlib --cap-lints allow`
```

Possible Solution(s)

I don't really know what the problem is here

Notes

You can comment and un-comment `couch_rs` in the dependencies in carogo.toml and the program will alternately compile and not compile.

Possibly related issue, but this should be solved: https://github.com/rust-lang/cargo/issues/8239rus