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

Exported symbols conflict with boring-sys crate #446

Closed
Diggsey opened this issue Jun 18, 2024 · 2 comments
Closed

Exported symbols conflict with boring-sys crate #446

Diggsey opened this issue Jun 18, 2024 · 2 comments
Assignees
Labels
build problem Build failure

Comments

@Diggsey
Copy link

Diggsey commented Jun 18, 2024

Problem:

The libaws_lc_sys crate exports symbols which conflict with other crates, such as libboring_sys.

Relevant details

AWS-LC for Rust versions or commit: (6b1bce0...)

System information: for linux, below info can be collected by running uname -srvmp

  • CPU architecture: x86-64
  • OS: Windows 10

Build log:

= note: libboring_sys-85d2b9b1e2fceefe.rlib(crypto.obj) : error LNK2005: library_init_constructor already defined in libaws_lc_sys-adbe0a2ef2d693b0.rlib(crypto.obj)
          libboring_sys-85d2b9b1e2fceefe.rlib(thread_win.obj) : error LNK2005: p_thread_callback_boringssl already defined in libaws_lc_sys-adbe0a2ef2d693b0.rlib(thread_win.obj)
             ...
          fatal error LNK1169: one or more multiply defined symbols found
@justsmth
Copy link
Contributor

justsmth commented Aug 13, 2024

I believe this problem will be resolved for Windows once we have a release for PR #486

I've been using the following basic setup to successfully test on MacOS, Linux, and now Windows (using that PR branch):

Cargo.toml

[package]
name = "aws-lc-rs-test"
version = "0.1.0"
edition = "2021"

[dependencies]
aws-lc-rs = "1.8.1"
boring = "4.9.1"

src/main.rs

fn main() {
    const MESSAGE: &[u8] = b"Hello Technician!";

    let output = aws_lc_rs::digest::digest(&aws_lc_rs::digest::SHA256, MESSAGE);

    print!("\nAWS-LC: ");
    for v in output.as_ref() {
        print!("{:02x}", *v);
    }
    print!("\nBoringSSL: ");
    let digest = boring::hash::MessageDigest::sha256();
    let boring_output = boring::hash::hash(digest, MESSAGE).unwrap();
    for v in boring_output.as_ref() {
        print!("{:02x}", *v);
    }
    println!();
}

I'll follow up once we've merged the relevant PRs.

@justsmth justsmth self-assigned this Aug 13, 2024
@justsmth justsmth added the build problem Build failure label Aug 14, 2024
@justsmth
Copy link
Contributor

justsmth commented Sep 6, 2024

This is resolved with the release of aws-lc-rs v1.9.0.

@justsmth justsmth closed this as completed Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build problem Build failure
Projects
None yet
Development

No branches or pull requests

2 participants