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

RCORE-1993 Add toolchain files for cross-compiling to musl-based Linux #7904

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

### Internals
* Reverted the bfd linker override in the Linux-armv7 toolchain file because the upstream OpenSSL issue it was working around was resolved.
* Added CMake toolchain files for cross-compiling to Linux using the musl libc (PR [#7904](https://github.com/realm/realm-core/pull/7904)).

----------------------------------------------

Expand Down
6 changes: 5 additions & 1 deletion tools/cmake/AcquireRealmDependency.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
function(realm_acquire_dependency dep_name dep_version out_dep_cmake)
if(NOT DEFINED REALM_LINUX_LIBC)
set(REALM_LINUX_LIBC gnu)
endif()

set(_target_architecture_Android_armeabi-v7a arm)
set(_target_architecture_Android_arm64-v8a arm64)
set(_target_architecture_Android_x86 x86)
Expand All @@ -18,7 +22,7 @@ function(realm_acquire_dependency dep_name dep_version out_dep_cmake)
set(_target_platform_name_Android android)
set(_target_platform_name_Windows windows-static)
set(_target_platform_name_WindowsStore uwp-static)
set(_target_platform_name_Linux linux-gnu)
set(_target_platform_name_Linux linux-${REALM_LINUX_LIBC})

if(ANDROID)
set(_target_architecture ${CMAKE_ANDROID_ARCH_ABI})
Expand Down
1 change: 1 addition & 0 deletions tools/cmake/aarch64-linux-gnu.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set(_TRIPLET "aarch64-unknown-linux-gnu")
set(_TOOLCHAIN_MD5 a3a14d87f98904c2558b43bbd310f337)
include("${CMAKE_CURRENT_LIST_DIR}/linux.toolchain.base.cmake")
set(REALM_LINUX_LIBC gnu)
4 changes: 4 additions & 0 deletions tools/cmake/aarch64-linux-musl.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(_TRIPLET "aarch64-unknown-linux-musl")
set(_TOOLCHAIN_MD5 49df8ce5c6ba669d640cc9c096f1141e)
include("${CMAKE_CURRENT_LIST_DIR}/linux.toolchain.base.cmake")
set(REALM_LINUX_LIBC musl)
2 changes: 2 additions & 0 deletions tools/cmake/armv7-linux-gnueabihf.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set(_TRIPLET "armv7-unknown-linux-gnueabihf")
set(_TOOLCHAIN_MD5 fbf817b1428bb35c93be8e6c15f73d7d)
include("${CMAKE_CURRENT_LIST_DIR}/linux.toolchain.base.cmake")

set(REALM_LINUX_LIBC gnu)
4 changes: 4 additions & 0 deletions tools/cmake/armv7-linux-musleabihf.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(_TRIPLET "armv7-unknown-linux-musleabihf")
set(_TOOLCHAIN_MD5 e5df7301cf9138ef5cae6160878cab15)
include("${CMAKE_CURRENT_LIST_DIR}/linux.toolchain.base.cmake")
set(REALM_LINUX_LIBC musl)
1 change: 1 addition & 0 deletions tools/cmake/x86_64-linux-gnu.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set(_TRIPLET "x86_64-unknown-linux-gnu")
set(_TOOLCHAIN_MD5 aa99fc16d85adf1bb2f8b63b83542044)
include("${CMAKE_CURRENT_LIST_DIR}/linux.toolchain.base.cmake")
set(REALM_LINUX_LIBC gnu)
4 changes: 4 additions & 0 deletions tools/cmake/x86_64-linux-musl.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(_TRIPLET "x86_64-unknown-linux-musl")
set(_TOOLCHAIN_MD5 8bc7f11a3bc58acaa50c557ac6867fd9)
include("${CMAKE_CURRENT_LIST_DIR}/linux.toolchain.base.cmake")
set(REALM_LINUX_LIBC musl)
Loading