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

Add minimal cross-compilation support for Windows and AArch64 Linux #78

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

jrose-signal
Copy link
Contributor

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.

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.

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).
@inikulin inikulin merged commit 3059ba6 into cloudflare:master Sep 27, 2022
@jrose-signal jrose-signal deleted the aarch64-cross-compilation branch October 11, 2022 17:15
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