Skip to content

nasm support for msvc? #59

@KaneGreen

Description

@KaneGreen

I've noticed this code in the lib.rs, which indicates that no-asm is enabled for msvc toolchain no matter nasm.exe is installed or not.

As far as I know, assembly language routines of OpenSSL provide hardware acceleration support such as AES-NI, which is a performance booster.

Installing nasm.exe is easy. So, I think we should consider the users who installed it and disable no-asm for them.

You can consider this code:

use std::process::Command;
let wherenasm = Command::new("cmd")
    .args(&["/C", "where nasm"])
    .output()
    .expect("failed to exec cmd");
if !wherenasm.status.success() {
    configure.arg("no-asm");
}

This modification works on Windows 10 64bit (1909), VS Community 2019 (16.5.2), rustc 1.42.0 (stable-x86_64-pc-windows-msvc), NASM version 2.14.02.

[dependencies]
openssl = { version = "0.10", features = ["vendored"] }
[patch.crates-io]
openssl-src = { path = '../PatchedCrates/openssl-src-111.8.1+1.1.1f' }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions