You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
!7775773 added a CI build for 32-bit Linux, but the unit tests didn't run correctly due to a mismatch in architecture names. This PR fixes that issue and refactors a number of other things in our CMakeLists and ADO template to make it more flexible and separate out different parameters that were being used as proxies for each other.
- Removed platform and architecture from output paths. CMake requires separate top-level build directories for each platform and architecture, so including the platform and architecture as subdirectories of the build directory provides no benefit and complicates the process of invoking the unit test.
- Separated whether to use ASM optimizations from environment definition. Previously we were assuming that the Generic environment implied no ASM optimizations and vice versa, so e.g. building with the `LinuxUserMode` environment but no ASM optimizations was not well-supported. Added a new CMake variable `SYMCRYPT_USE_ASM` for this (defaults to enabled).
- Added `SYMCRYPT_FIPS_BUILD` CMake variable which can be used to specify whether or not FIPS integrity verification and self-tests will be run in the Linux modules (defaults to enabled).
- No longer running perf tests in CI builds since they take a long time and we don't use CI builds for perf comparisons.
Copy file name to clipboardExpand all lines: README.md
+13-15Lines changed: 13 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,9 @@ be portable to various architectures. However, they do not offer optimal perform
45
45
advantage of CPU-specific optimizations. To that end, we also have hand-written assembly implementations of
46
46
performance-critical internal functions. Our CMake build scripts do not currently support ASM optimizations on all
47
47
combinations of architectures and platforms; the Build Instructions section below lists some of the currently supported
48
-
combinations, and we're working on adding support for more.
48
+
combinations, and we're working on adding support for more.
49
49
50
-
The ability to build SymCrypt on any particular platform or architecture, with or without CPU optimizations, does not
50
+
The ability to build SymCrypt on any particular platform or architecture, with or without ASM optimizations, does not
51
51
imply that it has been tested for or is actively supported by Microsoft on that platform/architecture. While we make
52
52
every effort to ensure that SymCrypt is reliable, stable and bug-free on every platform we run on, the code in this
53
53
repository is provided *as is*, without warranty of any kind, express or implied, including but not limited to the
@@ -57,24 +57,22 @@ warranties of merchantability, fitness for a particular purpose and noninfringem
57
57
1. For Microsoft employees building the library internally, to include msbignum and RSA32 implementation benchmarks in the unit tests:
58
58
1. Make sure the SymCryptDependencies submodule is initialized by following the steps above (`git submodule update --init`)
59
59
1. In step 4 below, add the additional cmake argument `-DSYMCRYPT_INTERNAL_BUILD=1`
60
-
1.`mkdir bin; cd bin`
61
-
1. Use the appropriate CMake arguments to specify which architecture you want to compile for:
62
-
* For x86-64 Windows targets: `cmake .. -DCMAKE_TOOLCHAIN_FILE="../cmake-toolchain/WindowsUserMode-AMD64.cmake"`
63
-
* For x86 Windows targets: `cmake .. -DCMAKE_TOOLCHAIN_FILE="../cmake-toolchain/WindowsUserMode-X86.cmake" -A Win32`
64
-
* For x86-64 Linux targets: `cmake .. -DCMAKE_TOOLCHAIN_FILE="../cmake-toolchain/LinuxUserMode-AMD64.cmake"`
65
-
* For x86 Linux targets **no ASM optimizations**: `cmake .. -DCMAKE_TOOLCHAIN_FILE="../cmake-toolchain/LinuxUserMode-X86.cmake"`
66
-
* For ARM64 Linux targets: `cmake .. -DCMAKE_TOOLCHAIN_FILE="../cmake-toolchain/LinuxUserMode-ARM64.cmake"`
67
-
* To use the host system architecture **with no ASM optimizations**: `cmake ..`
68
-
* Optionally, for a release build, specify `-DCMAKE_BUILD_TYPE=Release`
69
-
1.`cmake --build .`
60
+
1. Run `cmake -S . -B bin` to configure your build. You can add the following optional CMake arguments to change build options:
61
+
*`-DSYMCRYPT_TARGET_ARCH=<AMD64|X86|ARM64>` to choose a target architecture. If not specified, it will default to the host system architecture.
62
+
* To cross-compile for Windows X86 from Windows AMD64, you must also use `-A Win32`
63
+
* To cross-compile for Linux ARM64, you must also use `--toolchain=cmake-configs/Toolchain-Clang-ARM64.cmake`
64
+
*`-DSYMCRYPT_USE_ASM=<ON|OFF>` to choose whether to use assembly optimizations. Defaults to `ON`.
65
+
*`-DSYMCRYPT_FIPS_BUILD=<ON|OFF>` to choose whether to enable FIPS self-tests in the SymCrypt shared object module. Defaults to `ON`. Currently only affects Linux builds.
66
+
* For a release build, specify `-DCMAKE_BUILD_TYPE=Release`
67
+
1.`cmake --build bin`
70
68
* Optionally, for a release build on Windows, specify `--config Release`
71
69
* Optionally specify `-jN` where N is the number of processes you wish to spawn for the build
72
70
73
71
After successful compilation, the generated binaries will be placed in the following directories relative
0 commit comments