Skip to content

Commit 483a150

Browse files
authored
Add support for building libsql-ffi on ARM (#2016)
Closes #2015
2 parents 81fa360 + 351b5a4 commit 483a150

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

libsql-ffi/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,8 @@ fn build_multiple_ciphers(target: &str, out_path: &Path) {
486486
"x86_64"
487487
} else if cc.contains("aarch64") {
488488
"arm64"
489+
} else if cc.contains("arm") {
490+
"arm"
489491
} else {
490492
panic!("Unsupported cross target {}", cc)
491493
};

libsql-ffi/bundled/SQLite3MultipleCiphers/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux"
279279
# Do not set `-maes -msee4.2` when we are on arm which doesn't support
280280
# this instruction set.
281281
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64"
282-
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
282+
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"
283+
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm")
283284
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
284285
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
285286
else()
@@ -298,7 +299,9 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux"
298299
set(SHARED_LIB_EXPORT_DEFINITION "__attribute__((visibility(\"default\")))")
299300
else()
300301
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (
301-
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"
302+
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64"
303+
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"
304+
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm"
302305
))
303306
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -maes")
304307
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2 -maes")
@@ -307,7 +310,9 @@ else()
307310
endif()
308311

309312
if (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT (
310-
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"
313+
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64"
314+
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"
315+
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm"
311316
))
312317
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -maes -Wno-error=incompatible-function-pointer-types")
313318
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2 -maes")

0 commit comments

Comments
 (0)