Skip to content

Commit

Permalink
Merge pull request #700 from cole-miller/readme-musl-stack
Browse files Browse the repository at this point in the history
Add README notes about static linking
  • Loading branch information
cole-miller authored Sep 3, 2024
2 parents e8e28b0 + 128985c commit 1eafacf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,28 @@ The `--enable-build-raft` option causes dqlite to use its bundled Raft
implementation instead of linking to an external libraft; the latter is a
legacy configuration that should not be used for new development.

Building for static linking
---------------------------

If you're building dqlite for eventual use in a statically-linked
binary, there are some additional considerations. You should pass
`--with-static-deps` to the configure script; this disables code that
relies on dependencies being dynamically linked. (Currently it only
affects the test suite, but you should use it even when building
`libdqlite.a` only for future compatibility.)

When linking libdqlite with musl libc, it's recommended to increase
the default stack size, which is otherwise too low for dqlite's
needs:

```
LDFLAGS="-Wl,-z,stack-size=1048576"
```

The `contrib/build-static.sh` script demonstrates building and
testing dqlite with all dependencies (including libc) statically
linked.

Usage Notes
-----------

Expand Down

0 comments on commit 1eafacf

Please sign in to comment.