Skip to content

Support Linux ARM #2015

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

Closed
kaaax0815 opened this issue Apr 4, 2025 · 2 comments · Fixed by #2016
Closed

Support Linux ARM #2015

kaaax0815 opened this issue Apr 4, 2025 · 2 comments · Fixed by #2016

Comments

@kaaax0815
Copy link
Contributor

Related tursodatabase/libsql-js#169 and cross-rs/cross#1646

I am using libsql-js in a larger open source project which I want to make available for older systems that use Armv7 like Raspberry Pis.

I am trying trying to add arm support but something does not support it yet

$ cross build -p libsql --features encryption --target arm-unknown-linux-gnueabihf
...
warning: [email protected]: CC_var_name=CC_arm_unknown_linux_gnueabihf

error: failed to run custom build command for `libsql-ffi v0.9.2 (/Users/berndstorath/Documents/X_Projekte/libsql/libsql-ffi)`

Caused by:
  process didn't exit successfully: `/target/debug/build/libsql-ffi-b172bf69f5b8099f/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=bundled/src/sqlite3.c
  cargo:rerun-if-changed=/target/arm-unknown-linux-gnueabihf/debug/build/libsql-ffi-f30780d0f93b66bc/out/sqlite3mc/libsqlite3mc_static.a
  cargo:lib_dir=/target/arm-unknown-linux-gnueabihf/debug/build/libsql-ffi-f30780d0f93b66bc/out
  cargo:warning=CC_var_name=CC_arm_unknown_linux_gnueabihf

  --- stderr
  [libsql-ffi/build.rs:435:9] format!("{BUNDLED_DIR}/SQLite3MultipleCiphers") = "bundled/SQLite3MultipleCiphers"
  thread 'main' panicked at libsql-ffi/build.rs:485:13:
  Unsupported cross target arm-unknown-linux-gnueabihf-gcc
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
@kaaax0815
Copy link
Contributor Author

After adding arm to the system_processor at libsql-ffi/build.rs:485:13 I get theses logs

warning: [email protected]: CC_var_name=CC_arm_unknown_linux_gnueabihf

error: failed to run custom build command for `libsql-ffi v0.9.2 (/Users/berndstorath/Documents/X_Projekte/libsql/libsql-ffi)`

Caused by:
  process didn't exit successfully: `/target/debug/build/libsql-ffi-b172bf69f5b8099f/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=bundled/src/sqlite3.c
  cargo:rerun-if-changed=/target/arm-unknown-linux-gnueabihf/debug/build/libsql-ffi-f30780d0f93b66bc/out/sqlite3mc/libsqlite3mc_static.a
  cargo:lib_dir=/target/arm-unknown-linux-gnueabihf/debug/build/libsql-ffi-f30780d0f93b66bc/out
  cargo:warning=CC_var_name=CC_arm_unknown_linux_gnueabihf
  Running `cmake` with options: -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DSQLITE3MC_STATIC=ON -DCODEC_TYPE=AES256 -DSQLITE3MC_BUILD_SHELL=OFF -DSQLITE_SHELL_IS_UTF8=OFF -DSQLITE_USER_AUTHENTICATION=OFF -DSQLITE_SECURE_DELETE=OFF -DSQLITE_ENABLE_COLUMN_METADATA=ON -DSQLITE_USE_URI=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
  -- The C compiler identification is GNU 8.5.0
  -- The CXX compiler identification is GNU 8.5.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /x-tools/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-gcc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /x-tools/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-g++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /target/arm-unknown-linux-gnueabihf/debug/build/libsql-ffi-f30780d0f93b66bc/out/sqlite3mc
  [ 50%] Building C object CMakeFiles/sqlite3mc_static.dir/src/sqlite3mc.c.o

  --- stderr
  [libsql-ffi/build.rs:435:9] format!("{BUNDLED_DIR}/SQLite3MultipleCiphers") = "bundled/SQLite3MultipleCiphers"
  Will build sqlite3mc_static as STATIC
  arm-unknown-linux-gnueabihf-gcc: error: unrecognized command line option '-msse4.2'
  arm-unknown-linux-gnueabihf-gcc: error: unrecognized command line option '-maes'; did you mean '-mapcs'?
  make[2]: *** [CMakeFiles/sqlite3mc_static.dir/build.make:76: CMakeFiles/sqlite3mc_static.dir/src/sqlite3mc.c.o] Error 1
  make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/sqlite3mc_static.dir/all] Error 2
  make: *** [Makefile:136: all] Error 2
  thread 'main' panicked at libsql-ffi/build.rs:543:9:
  Failed to run make
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

@kaaax0815
Copy link
Contributor Author

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 a pull request may close this issue.

1 participant