Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ jobs:

- run: rustup toolchain install --no-self-update --profile=minimal 1.66.0

- run: echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin" >> $GITHUB_PATH
shell: bash

- run: sh mk/package.sh
shell: bash

Expand Down Expand Up @@ -483,11 +480,6 @@ jobs:
- if: ${{ contains(matrix.host_os, 'windows') && contains(matrix.target, '86') }}
run: ./mk/install-build-tools.ps1

- if: ${{ matrix.target == 'aarch64-pc-windows-msvc' && !contains(matrix.host_os, 'arm') }}
run: |
echo "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin" >> $GITHUB_PATH
shell: bash

- if: ${{ !contains(matrix.host_os, 'windows') }}
run: |
mk/cargo.sh +${{ matrix.rust_channel }} test --lib --tests -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }} ${{ matrix.cargo_test_options }}
Expand Down
13 changes: 0 additions & 13 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@ supported.

For Windows ARM64 targets (aarch64-pc-windows-msvc), the Visual Studio Build
Tools “VS 2022 C++ ARM64 build tools” and "clang" components must be installed.
Add Microsoft's provided version of `clang` to `%PATH%`, which will allow the
build to work in GitHub Actions without installing anything:
```
$env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin"
```
If you (locally) have “Build Tools for Visual Studio 2022” instead, use:
```
$env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin"
```
Alternatively, if the host machine is already a Windows ARM64 then use:
```
$env:Path += ";C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\ARM64\bin"
```

Packaged Builds
---------------
Expand Down
11 changes: 9 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ wasm-bindgen-test = { version = "0.3.37", default-features = false, features = [
libc = { version = "0.2.172", default-features = false }

[build-dependencies]
cc = { version = "1.2.8", default-features = false }
cc = { version = "1.2.36", default-features = false }

[features]
# These features are documented in the top-level module's documentation.
Expand Down
13 changes: 5 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ fn cpp_flags(compiler: &cc::Tool) -> &'static [&'static str] {
"/Zc:forScope",
"/Zc:inline",
// Warnings.
"/Wall",
Copy link
Author

@dennisameling dennisameling Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be triggering the warnings (which are then treated as errors) that @MarijnS95 reported here. Even when adding /std:c11, they keep showing up:

warning: [email protected]: In file included from C:\repos\ring\crypto/curve25519/curve25519.c:22:
warning: [email protected]: In file included from C:\repos\ring\crypto/curve25519\internal.h:18:
warning: [email protected]: C:\repos\ring\include\ring-core/base.h(60,1): error: '_Static_assert' is incompatible with C standards before C11 [-Werror,-Wpre-c11-compat]
warning: [email protected]:    60 | OPENSSL_STATIC_ASSERT(sizeof(int32_t) == sizeof(int), "int isn't 32 bits.");
warning: [email protected]:       | ^
warning: [email protected]: C:\repos\ring\include\ring-core/type_check.h(29,42): note: expanded from macro 'OPENSSL_STATIC_ASSERT'
warning: [email protected]:    29 | #define OPENSSL_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
warning: [email protected]:       |                                          ^
warning: [email protected]: In file included from C:\repos\ring\crypto/curve25519/curve25519.c:22:
warning: [email protected]: In file included from C:\repos\ring\crypto/curve25519\internal.h:18:
warning: [email protected]: C:\repos\ring\include\ring-core/base.h(61,1): error: '_Static_assert' is incompatible with C standards before C11 [-Werror,-Wpre-c11-compat]
warning: [email protected]:    61 | OPENSSL_STATIC_ASSERT(sizeof(uint32_t) == sizeof(unsigned int), "unsigned int isn't 32 bits.");
warning: [email protected]:       | ^
warning: [email protected]: C:\repos\ring\include\ring-core/type_check.h(29,42): note: expanded from macro 'OPENSSL_STATIC_ASSERT'
warning: [email protected]:    29 | #define OPENSSL_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
warning: [email protected]:       |                                          ^
warning: [email protected]: In file included from C:\repos\ring\crypto/curve25519/curve25519.c:22:
warning: [email protected]: In file included from C:\repos\ring\crypto/curve25519\internal.h:18:
warning: [email protected]: C:\repos\ring\include\ring-core/base.h(62,1): error: '_Static_assert' is incompatible with C standards before C11 [-Werror,-Wpre-c11-compat]
warning: [email protected]:    62 | OPENSSL_STATIC_ASSERT(sizeof(size_t) == sizeof(uintptr_t), "uintptr_t and size_t differ.");
warning: [email protected]:       | ^
warning: [email protected]: C:\repos\ring\include\ring-core/type_check.h(29,42): note: expanded from macro 'OPENSSL_STATIC_ASSERT'
warning: [email protected]:    29 | #define OPENSSL_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
warning: [email protected]:       |                                          ^

Removing the /Wall flag fixes the build. This looks like a bug in clang-cl.exe to me and I could reproduce the behavior in a minimal example. Reported that here: https://developercommunity.visualstudio.com/t/Calling-clang-clexe-with-Wall-reports/10961806

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a bug in clang-cl - /Wall in CL parlance translates to -Weverything in Clang parlance. That includes these spurious warnings designed to help users migrating code forward to avoid pitfalls when their code base uses multiple C versions simultaneously.

"/wd4127", // C4127: conditional expression is constant
"/wd4464", // C4464: relative include path contains '..'
"/wd4514", // C4514: <name>: unreferenced inline function has be
Expand Down Expand Up @@ -591,13 +590,11 @@ fn obj_path(out_dir: &Path, src: &Path) -> PathBuf {

fn configure_cc(c: &mut cc::Build, target: &Target, c_root_dir: &Path, include_dir: &Path) {
let compiler = c.get_compiler();
// FIXME: On Windows AArch64 we currently must use Clang to compile C code
let compiler = if target.os == WINDOWS && target.arch == AARCH64 && !compiler.is_like_clang() {
let _ = c.compiler("clang");
c.get_compiler()
} else {
compiler
};
// On Windows AArch64 we currently must use Clang to compile C code.
// clang-cl.exe has support for MSVC-style command-line arguments.
if target.os == WINDOWS && target.arch == AARCH64 && !compiler.is_like_clang() {
c.prefer_clang_cl_over_msvc(true);
}

let _ = c.include(c_root_dir.join("include"));
let _ = c.include(include_dir);
Expand Down
2 changes: 1 addition & 1 deletion mk/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi

msrv=1.66.0
cargo clean --target-dir=target/pregenerate_asm
RING_PREGENERATE_ASM=1 CC_AARCH64_PC_WINDOWS_MSVC=clang \
RING_PREGENERATE_ASM=1 \
cargo +${msrv} build -p ring --target-dir=target/pregenerate_asm
if [[ -n "$(git status --porcelain -- ':(exclude)pregenerated/')" ]]; then
echo Repository is dirty.
Expand Down