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

VC-WIN64-ARM build fails in VS 2019 (OpenSSL 3.0.8) #20234

Closed
slproweb opened this issue Feb 7, 2023 · 11 comments
Closed

VC-WIN64-ARM build fails in VS 2019 (OpenSSL 3.0.8) #20234

slproweb opened this issue Feb 7, 2023 · 11 comments
Labels
branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 triaged: bug The issue/pr is/fixes a bug

Comments

@slproweb
Copy link

slproweb commented Feb 7, 2023

The target VC-WIN64-ARM fails to build on VS2019. Previously built fine for 3.0.7 but the newly released 3.0.8 does not successfully build. The linker is complaining about _umul128, which appears to be an Intel x64-specific intrinsic.

This commit appears to be responsible:

b1892d2

x86 and x64 builds work fine in their respective build environments.

...
Configuring OpenSSL version 3.0.8 for target VC-WIN64-ARM
...

        "lib" /nologo /out:providers\libcommon.lib @C:\Users\Redacted\AppData\Local\Temp\nmAA8B.tmp
        IF EXIST .manifest DEL /F /Q .manifest
        IF EXIST libcrypto-3-arm64.dll DEL /F /Q libcrypto-3-arm64.dll
        cmd /C ""link" /nologo /debug /dll /NODEFAULTLIB:kernel32.lib /APPCONTAINER /nologo /debug @C:\Users\Redacted\AppData\Local\Temp\nmAACB.tmp /implib:libcrypto.lib || (DEL /Q libcrypto-3-arm64.* libcrypto.lib & EXIT 1)"
   Creating library libcrypto.lib and object libcrypto.exp
libcrypto-shlib-rsa_sup_mul.obj : error LNK2019: unresolved external symbol _umul128 referenced in function _mul_add_limb
libcrypto-3-arm64.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'cmd' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\ARM64\nmake.exe"' : return code '0x2'
Stop. 
Command line (with current working directory = .):

    D:\Perl\perl\bin\perl.exe Configure VC-WIN64-ARM shared

Perl information:

    D:\Perl\perl\bin\perl.exe
    5.32.1 for MSWin32-x86-multi-thread-64int

Enabled features:

    aria
    async
    autoalginit
    autoerrinit
    autoload-config
    bf
    blake2
    bulk
    cached-fetch
    camellia
    capieng
    cast
    chacha
    cmac
    cmp
    cms
    comp
    ct
    deprecated
    des
    dgram
    dh
    dsa
    dso
    dtls
    dynamic-engine
    ec
    ec2m
    ecdh
    ecdsa
    engine
    err
    filenames
    gost
    idea
    legacy
    loadereng
    makedepend
    md4
    mdc2
    module
    multiblock
    nextprotoneg
    ocb
    ocsp
    padlockeng
    pic
    pinshared
    poly1305
    posix-io
    psk
    rc2
    rc4
    rdrand
    rfc3779
    rmd160
    scrypt
    secure-memory
    seed
    shared
    siphash
    siv
    sm2
    sm3
    sm4
    sock
    srp
    srtp
    sse2
    ssl
    ssl-trace
    static-engine
    stdio
    tests
    threads
    tls
    ts
    ui-console
    whirlpool
    tls1
    tls1-method
    tls1_1
    tls1_1-method
    tls1_2
    tls1_2-method
    tls1_3
    dtls1
    dtls1-method
    dtls1_2
    dtls1_2-method

Disabled features:

    acvp-tests          [cascade]        OPENSSL_NO_ACVP_TESTS
    afalgeng            [not-linux]      OPENSSL_NO_AFALGENG
    asan                [default]        OPENSSL_NO_ASAN
    asm                 [no asm_arch]    OPENSSL_NO_ASM
    buildtest-c++       [default]
    crypto-mdebug       [default]        OPENSSL_NO_CRYPTO_MDEBUG
    devcryptoeng        [default]        OPENSSL_NO_DEVCRYPTOENG
    ec_nistp_64_gcc_128 [default]        OPENSSL_NO_EC_NISTP_64_GCC_128
    egd                 [default]        OPENSSL_NO_EGD
    external-tests      [default]        OPENSSL_NO_EXTERNAL_TESTS
    fips                [default]
    fips-securitychecks [cascade]        OPENSSL_NO_FIPS_SECURITYCHECKS
    fuzz-afl            [default]        OPENSSL_NO_FUZZ_AFL
    fuzz-libfuzzer      [default]        OPENSSL_NO_FUZZ_LIBFUZZER
    ktls                [default]        OPENSSL_NO_KTLS
    md2                 [default]        OPENSSL_NO_MD2 (skip crypto\md2)
    msan                [default]        OPENSSL_NO_MSAN
    rc5                 [default]        OPENSSL_NO_RC5 (skip crypto\rc5)
    sctp                [default]        OPENSSL_NO_SCTP
    trace               [default]        OPENSSL_NO_TRACE
    ubsan               [default]        OPENSSL_NO_UBSAN
    unit-test           [default]        OPENSSL_NO_UNIT_TEST
    uplink              [no uplink_arch] OPENSSL_NO_UPLINK
    weak-ssl-ciphers    [default]        OPENSSL_NO_WEAK_SSL_CIPHERS
    zlib                [default]
    zlib-dynamic        [default]
    ssl3                [default]        OPENSSL_NO_SSL3
    ssl3-method         [default]        OPENSSL_NO_SSL3_METHOD

Config target attributes:

    AR => "lib",
    ARFLAGS => "/nologo",
    CC => "cl",
    CFLAGS => "/W3 /wd4090 /nologo /O2",
    CPP => "\$(CC) /EP /C",
    HASHBANGPERL => "/usr/bin/env perl",
    LD => "link",
    LDFLAGS => "/nologo /debug",
    MT => "mt",
    MTFLAGS => "-nologo",
    RANLIB => "CODE(0x7d600c)",
    RC => "rc",
    ar_resp_delim => "
",
    aroutflag => "/out:",
    bin_cflags => "/Zi /Fdapp.pdb",
    bin_lflags => "setargv.obj /subsystem:console /opt:ref",
    bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
    build_file => "makefile",
    build_scheme => [ "unified", "windows", "VC-common" ],
    cflags => "/Gs0 /GF /Gy /MD",
    coutflag => "/Fo",
    cppflags => "",
    defines => [ "OPENSSL_BUILDING_OPENSSL", "OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN", "UNICODE", "_UNICODE", "_CRT_SECURE_NO_DEPRECATE", "_WINSOCK_DEPRECATED_NO_WARNINGS", "_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE", "OPENSSL_SYS_WIN_CORE" ],
    disable => [  ],
    dso_cflags => "/Zi /Fddso.pdb",
    dso_scheme => "win32",
    enable => [  ],
    ex_libs => "onecore.lib",
    includes => [  ],
    ld_implib_flag => "/implib:",
    ld_resp_delim => "
",
    lddefflag => "/def:",
    ldoutflag => "/out:",
    ldpostoutflag => "",
    ldresflag => " ",
    lflags => "/NODEFAULTLIB:kernel32.lib /APPCONTAINER",
    lib_cflags => "/Zi /Fdossl_static.pdb",
    lib_cppflags => "",
    lib_defines => [ "L_ENDIAN" ],
    makedep_scheme => "VC",
    makedepcmd => "\$(CC) /Zs /showIncludes",
    module_cflags => "",
    module_cxxflags => undef,
    module_ldflags => "/dll",
    mtinflag => "-manifest ",
    mtoutflag => "-outputresource:",
    multilib => "-arm64",
    perl_platform => "Windows::MSVC",
    rcoutflag => "/fo",
    shared_cflag => "",
    shared_defflag => "",
    shared_defines => [  ],
    shared_ldflag => "/dll",
    shared_rcflag => "",
    shared_target => "win-shared",
    thread_defines => [  ],
    thread_scheme => "winthreads",
    unistd => "<unistd.h>",

Recorded environment:

    AR =
    ARFLAGS =
    AS =
    ASFLAGS =
    BUILDFILE =
    CC =
    CFLAGS =
    CPP =
    CPPDEFINES =
    CPPFLAGS =
    CPPINCLUDES =
    CROSS_COMPILE =
    CXX =
    CXXFLAGS =
    HASHBANGPERL =
    LD =
    LDFLAGS =
    LDLIBS =
    MT =
    MTFLAGS =
    OPENSSL_LOCAL_CONFIG_DIR =
    PERL =
    RANLIB =
    RC =
    RCFLAGS =
    RM =
    WINDRES =
    __CNF_CFLAGS =
    __CNF_CPPDEFINES =
    __CNF_CPPFLAGS =
    __CNF_CPPINCLUDES =
    __CNF_CXXFLAGS =
    __CNF_LDFLAGS =
    __CNF_LDLIBS =

Makevars:

    AR              = lib
    ARFLAGS         = /nologo
    CC              = cl
    CFLAGS          = /W3 /wd4090 /nologo /O2
    CPP             = $(CC) /EP /C
    CPPDEFINES      =
    CPPFLAGS        =
    CPPINCLUDES     =
    CXXFLAGS        =
    HASHBANGPERL    = /usr/bin/env perl
    LD              = link
    LDFLAGS         = /nologo /debug
    LDLIBS          =
    MT              = mt
    MTFLAGS         = -nologo
    PERL            = D:\Perl\perl\bin\perl.exe
    RC              = rc
    RCFLAGS         =

NOTE: These variables only represent the configuration view.  The build file
template may have processed these variables further, please have a look at the
build file for more exact data:
    makefile

build file:

    makefile

build file templates:

    Configurations\common0.tmpl
    Configurations\windows-makefile.tmpl
@slproweb slproweb added the issue: bug report The issue was opened to report a bug label Feb 7, 2023
@paulidale
Copy link
Contributor

This intrinsic only appears to be defined for x86/64 and shouldn't be used for ARM, AARCH64 or x86.

@paulidale paulidale added branch: master Merge to master branch triaged: bug The issue/pr is/fixes a bug branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 and removed issue: bug report The issue was opened to report a bug labels Feb 7, 2023
@jbekkema
Copy link

jbekkema commented Feb 8, 2023

I ran into the same issue: it affects both the 1.1.1 and 3.0 branches. It's a regression caused by b1892d2. I submitted PR #20235 that should resolve it.

@paulidale paulidale added branch: 1.0.2 Merge to OpenSSL_1_0_2-stable branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch labels Feb 8, 2023
@paulidale
Copy link
Contributor

Thanks for the fix.

@rsbeckerca
Copy link
Contributor

Thanks for the fix.

Would it be possible to publish when this will be released, even approximately?

@t8m
Copy link
Member

t8m commented Feb 8, 2023

Would it be possible to publish when this will be released, even approximately?

In an official release? There is no date set for the next release, even approximately. The VC-WIN64-ARM is an unadopted platform which means any regressions in it won't trigger a release.

@nibanks
Copy link

nibanks commented Feb 9, 2023

Would it be possible to publish when this will be released, even approximately?

In an official release? There is no date set for the next release, even approximately. The VC-WIN64-ARM is an unadopted platform which means any regressions in it won't trigger a release.

So, OpenSSL isn't officially supported on Windows arm64? MsQuic has been building/using it there with no issues until now. We're currently blocked on consuming the latest release because of this build break.

@paulidale
Copy link
Contributor

The project's platform policy is clear: unadopted does not mean unsupported. It does mean that the project will have problems testing and fixing issues with the platform and that such fixes might take longer than they otherwise would.

Consider volunteering as a community maintainer for the platform if it really is a blocker.

@rsbeckerca
Copy link
Contributor

The project's platform policy is clear: unadopted does not mean unsupported. It does mean that the project will have problems testing and fixing issues with the platform and that such fixes might take longer than they otherwise would.

Consider volunteering as a community maintainer for the platform if it really is a blocker.

I can personally vouch for this. There is a lot of satisfaction that comes from helping a community that would otherwise not get to benefit from OpenSSL.

@MonkeybreadSoftware
Copy link

I can report that this problem exists in openssl 1.1.1t and the fix helps indeed there.
We successfully compile for Windows ARM for a few months and use openssl without issues there.

We currently build openssl for 13 platforms including various combinations of 32/64bit, Intel/ARM and Linux/Windows/iOS/MacOS combinations.

@nibanks
Copy link

nibanks commented Feb 9, 2023

Understood. Thanks for the clarification and suggestions.

@mattcaswell
Copy link
Member

This was fixed by #20244. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants