Code Monkey home page Code Monkey logo

Comments (6)

haaawk avatar haaawk commented on August 16, 2024 1

I successfully ran libsql on Android. I don't think I had to do anything special. What I do though is having a new Rust lib project that depends on libsql.

from libsql.

ospfranco avatar ospfranco commented on August 16, 2024

Running lipo on the generated .a for x86_64 allowed me to pin point the problem:

lipo -info ../../target/x86_64-apple-ios/release/libsql_experimental.a                                                                                   
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: archive member ../../target/x86_64-apple-ios/release/libsql_experimental.a(sqlite3mc.c.o) cputype (16777228) and cpusubtype (0) does not match previous archive members cputype (16777223) and cpusubtype (3) (all members must match)

Indeed it seems the cargo build is targeting apple ios x86_64 but the generated sqlite object file has been compiled for another arch. Looking at the build script I find nothing weird. The cc crate is used for compiling the sqlite source file which should handle cross compilation gracefully. So it seems this path with a cmake build is happening (maybe due the encryption feature being turned on?).

I've added the following to try to make cross compilation work, but it doesn't seem to be doing anything:

if target.contains("x86_64-apple-ios") {
    cmake_opts.push(&cmake_toolchain_opt);
    writeln!(toolchain_file, "set(CMAKE_SYSTEM_NAME \"iOS\")").unwrap();
    writeln!(toolchain_file, "set(CMAKE_SYSTEM_PROCESSOR \"x86_64\")").unwrap();
}

Edit: turning off the encryption feature does indeed allow the crate to compile successfully. Seems indeed the cmake compilation is off for non-host architectures.

from libsql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.