Add minimal cross-compilation support for Windows and AArch64 Linux #78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
boring
's cross-compilation support isn't in a great state due to how manually CMake wants to be configured, but this enables at least basic cross-compilation in two cases Signal cares about:Cross-compiling to AArch64 Linux can be done with a CMake toolchain file, along with setting the correct compiler and include paths in the environment (
CC
,CXX
,CPATH
). This is similar to how cross-compiling to x86 works.Cross-compiling from X64 Windows to ARM64 Windows doesn't look at the toolchain at all, because CMake + Visual Studio can already cross-compile. Unfortunately, the Visual Studio CMake generator doesn't set
CMAKE_SYSTEM_PROCESSOR
, which is what the BoringSSL CMakeLists.txt is looking at to choose the architecture. For now, disable the use of assembly when cross-compiling on Windows (assuming that the Visual Studio generator will be used there).Recommend reviewing with whitespace disabled. I can also split this into two separate PRs if one of them is less controversial than the other.