Skip to content

Compile Windows releases with a static CRT#247

Merged
tschneidereit merged 1 commit intobytecodealliance:masterfrom
alexcrichton:windows-static
Aug 6, 2019
Merged

Compile Windows releases with a static CRT#247
tschneidereit merged 1 commit intobytecodealliance:masterfrom
alexcrichton:windows-static

Conversation

@alexcrichton
Copy link
Member

This commit compiles all Rust code for the Windows release with
-Ctarget-feature=+crt-static. This is targeted at increasing the
binary compatibility of the binaries built to not rely on DLLs that
aren't always installed on Windows. Notably this statically links the C
runtime (notably used by the C++ code) and means that the final binary
relies on fewer dlls.

This in theory means that the binaries are only limited by the number of
APIs they use from Windows. Note that this also matches how we build
releases of Rust for MSVC.

This commit compiles all Rust code for the Windows release with
`-Ctarget-feature=+crt-static`. This is targeted at increasing the
binary compatibility of the binaries built to not rely on DLLs that
aren't always installed on Windows. Notably this statically links the C
runtime (notably used by the C++ code) and means that the final binary
relies on fewer dlls.

This in theory means that the binaries are only limited by the number of
APIs they use from Windows. Note that this also matches how we build
releases of Rust for MSVC.
@alexcrichton
Copy link
Member Author

This is basically the same as #246 but for Windows, and like that I'd like to actually test the releases that get built to make sure this actually is recognized and the right place to configure this

@alexcrichton
Copy link
Member Author

Ok verified working too!

Before this PR:

$ objdump -p wasmtime.exe | rg 'DLL Name'
    DLL Name: ADVAPI32.dll
    DLL Name: KERNEL32.dll
    DLL Name: ole32.dll
    DLL Name: SHELL32.dll
    DLL Name: MSVCP140.dll
    DLL Name: VCRUNTIME140.dll
    DLL Name: api-ms-win-crt-math-l1-1-0.dll
    DLL Name: api-ms-win-crt-runtime-l1-1-0.dll
    DLL Name: api-ms-win-crt-stdio-l1-1-0.dll
    DLL Name: api-ms-win-crt-string-l1-1-0.dll
    DLL Name: api-ms-win-crt-convert-l1-1-0.dll
    DLL Name: api-ms-win-crt-environment-l1-1-0.dll
    DLL Name: api-ms-win-crt-locale-l1-1-0.dll
    DLL Name: api-ms-win-crt-heap-l1-1-0.dll

After this PR:

$ objdump -p wasmtime.exe | rg 'DLL Name'
    DLL Name: ADVAPI32.dll
    DLL Name: KERNEL32.dll
    DLL Name: ole32.dll
    DLL Name: SHELL32.dll

@tschneidereit
Copy link
Member

LGTM!

@tschneidereit tschneidereit merged commit 8ce6873 into bytecodealliance:master Aug 6, 2019
@alexcrichton alexcrichton deleted the windows-static branch August 6, 2019 17:27
grishasobol pushed a commit to grishasobol/wasmtime that referenced this pull request Nov 29, 2021
needless_lifetimes:

Clippy suggests that the lifetime is not needed and suggests eliding it.
While that is true, making this implicit would hide the fact that the
returned value borrows. While some may think this is obvious, I don't
think this is obvious for everyone.

If I could I would change the default to the opposite.

upper_case_acronyms:

While clippy is right here, this is how the instructions were named
historically. That said, I don't mind renaming it just think that it's
not worth it.
avanhatt pushed a commit to wellesley-prog-sys/wasmtime that referenced this pull request Apr 9, 2025
Move the `error_at_pos` method on `ConditionsBuilder` to a shared
location as a method of `Program`.

This is intended to allow us to generate positional errors from other
parts of the verifier codebase.

Updates bytecodealliance#169
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.

2 participants