diff --git a/Dockerfile.musl b/Dockerfile.musl new file mode 100644 index 0000000000..8c9f2fee9c --- /dev/null +++ b/Dockerfile.musl @@ -0,0 +1,17 @@ +# A dockerfile that can be used to build musl targets +# currently this is setup to run the most basic libsql example +# to force the linker to resolve. This was able to reproduce the +# fcntl64 issues + other issues that require custom flags for musl. + +FROM messense/rust-musl-cross:x86_64-musl +RUN rustup target add x86_64-unknown-linux-musl + +COPY . . + +RUN rm rust-toolchain.toml + +ENV LIBSQL_DEV=1 + +RUN apt-get install -y cmake + +RUN cargo run -p libsql --example example --features encryption diff --git a/libsql-ffi/build.rs b/libsql-ffi/build.rs index d56093de86..f6be344c1a 100644 --- a/libsql-ffi/build.rs +++ b/libsql-ffi/build.rs @@ -349,8 +349,8 @@ fn build_multiple_ciphers(target: &str, out_path: &Path) { cmake_opts.push("-DCMAKE_POSITION_INDEPENDENT_CODE=ON"); if target.contains("musl") { - cmake_opts.push("-DCMAKE_C_FLAGS=\"-U_FORTIFY_SOURCE\""); - cmake_opts.push("-DCMAKE_CXX_FLAGS=\"-U_FORTIFY_SOURCE\""); + cmake_opts.push("-DCMAKE_C_FLAGS=\"-U_FORTIFY_SOURCE\" -D_FILE_OFFSET_BITS=32"); + cmake_opts.push("-DCMAKE_CXX_FLAGS=\"-U_FORTIFY_SOURCE\" -D_FILE_OFFSET_BITS=32"); } let mut cmake = Command::new("cmake");