Skip to content

Commit

Permalink
Merge pull request #1724 from tursodatabase/lucio/fix-musl-encryption…
Browse files Browse the repository at this point in the history
…-builds

libsql: fix musl builds failing due to fcntl64
  • Loading branch information
LucioFranco authored Sep 10, 2024
2 parents c204f8e + e83b13b commit 46f60b3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions Dockerfile.musl
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions libsql-ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 46f60b3

Please sign in to comment.