Unverified Commit 10bcea62 authored by Steven Fackler's avatar Steven Fackler Committed by GitHub
Browse files

Merge pull request #1547 from sfackler/fix-static-libatomic

Link to libatomic for static 32 bit 3.0.0 builds
parents 5b1813fb 778868a1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -128,10 +128,10 @@ jobs:
          path: ~/.cargo/registry/cache
          key: registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
      - run: cargo fetch
      - uses: actions/cache@v1
        with:
          path: target
          key: target-${{ github.job }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
      # - uses: actions/cache@v1
      #   with:
      #     path: target
      #     key: target-${{ github.job }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
      - run: cargo run -p systest
      - run: cargo test -p openssl
      - run: cargo test -p openssl-errors
+15 −2
Original line number Diff line number Diff line
@@ -19,7 +19,9 @@ mod find_normal;
#[cfg(feature = "vendored")]
mod find_vendored;

#[derive(PartialEq)]
enum Version {
    Openssl3xx,
    Openssl11x,
    Openssl10x,
    Libressl,
@@ -94,7 +96,9 @@ fn main() {
        }
        None => match version {
            Version::Openssl10x if target.contains("windows") => vec!["ssleay32", "libeay32"],
            Version::Openssl11x if target.contains("windows-msvc") => vec!["libssl", "libcrypto"],
            Version::Openssl3xx | Version::Openssl11x if target.contains("windows-msvc") => {
                vec!["libssl", "libcrypto"]
            }
            _ => vec!["ssl", "crypto"],
        },
    };
@@ -104,6 +108,15 @@ fn main() {
        println!("cargo:rustc-link-lib={}={}", kind, lib);
    }

    // https://github.com/openssl/openssl/pull/15086
    if version == Version::Openssl3xx
        && kind == "static"
        && env::var("CARGO_CFG_TARGET_OS").unwrap() == "linux"
        && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32"
    {
        println!("cargo:rustc-link-lib=dylib=atomic");
    }

    if kind == "static" && target.contains("windows") {
        println!("cargo:rustc-link-lib=dylib=gdi32");
        println!("cargo:rustc-link-lib=dylib=user32");
@@ -253,7 +266,7 @@ See rust-openssl README for more information:
        if openssl_version >= 0x4_00_00_00_0 {
            version_error()
        } else if openssl_version >= 0x3_00_00_00_0 {
            Version::Openssl11x
            Version::Openssl3xx
        } else if openssl_version >= 0x1_01_01_00_0 {
            println!("cargo:version=111");
            Version::Openssl11x