Skip to content

Fix linker issues #2 #6

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

Closed

Conversation

xMAC94x
Copy link

@xMAC94x xMAC94x commented Jun 3, 2025

The Problem

This MR tries to fix #2

The Solution

I noticed that removing the bindings get rid of this linker errors.
Assuming we dont need those bindings if we have native codepath running we can use a cfg which is set in build.rs and consumed on compiling to disable those.

Changes

We are removing the bindings if they are not used because they can cause problems. Idk if this is a problem

Planned version bump

As the bindings did not belong to the external api we might make this a bugfix or ? if bindings where external we might need to make this a breaking change.

Links

#2

```
= note: /usr/bin/ld: /root/project/target/debug/deps/libcrc_fast-957a5ad644ad740d.rlib(crc_fast-957a5ad644ad740d.crc_fast.326ef549280914c9-cgu.1.rcgu.o): in function `crc_fast::bindings::crc32_iso_hdlc':
          /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crc-fast-1.2.1/src/bindings/mod.rs:22: undefined reference to `crc32_iso_hdlc_impl'
          /usr/bin/ld: /root/project/target/debug/deps/libcrc_fast-957a5ad644ad740d.rlib(crc_fast-957a5ad644ad740d.crc_fast.326ef549280914c9-cgu.1.rcgu.o): in function `crc_fast::bindings::crc32_iscsi':
          /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crc-fast-1.2.1/src/bindings/mod.rs:36: undefined reference to `crc32_iscsi_impl'
          /usr/bin/ld: /root/project/target/debug/deps/libcrc_fast-957a5ad644ad740d.rlib(crc_fast-957a5ad644ad740d.crc_fast.326ef549280914c9-cgu.1.rcgu.o): in function `crc_fast::bindings::get_iso_hdlc_target':
          /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crc-fast-1.2.1/src/bindings/mod.rs:44: undefined reference to `get_iso_hdlc_target'
          /usr/bin/ld: /root/project/target/debug/deps/libcrc_fast-957a5ad644ad740d.rlib(crc_fast-957a5ad644ad740d.crc_fast.326ef549280914c9-cgu.1.rcgu.o): in function `crc_fast::bindings::get_iscsi_target':
          /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crc-fast-1.2.1/src/bindings/mod.rs:49: undefined reference to `get_iscsi_target'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
```

I noticed that removing the bindings get rid of this linker errors.
Assuming we dont need those bindings if we have native codepath running we can use a cfg which is set in `build.rs` and consumed on compiling to disable those.
The result now works with tarpaulin.
@ix-xMAC94x
Copy link

fixed via #9

@xMAC94x xMAC94x closed this Jun 11, 2025
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

Successfully merging this pull request may close these issues.

version 1.2.1 now has linker errors on x86_64-unknown-linux-gnu
2 participants