Skip to content

Commit

Permalink
build/separate.md: polish
Browse files Browse the repository at this point in the history
Closes #368
  • Loading branch information
bagder committed Dec 21, 2023
1 parent 2e2309d commit 5e2f68f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions build/separate.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ It can look like this when you have installed your new curl build in

### `rpath`

An often times better way to instead forcible load your separate libcurl
instead of the system one, is to set the `rpath` of the specific `curl`
executable you build. That gives the runtime linker a specific path to check
for this specific executable.
Often, a better way to forcible load your separate libcurl instead of the
system one, is to set the `rpath` of the specific `curl` executable you
build. That gives the runtime linker a specific path to check for this
specific executable.

This is done at link time, and if you build your own libcurl using
application, you can make that load your custom libcurl build like this:

gcc -g example.c -L$HOME/install/lib -lcurl -Wl,-rpath=$HOME/install/lib

With this, the `a.out` executable linked against
`$HOME/install/lib/libcurl.so` then uses that specific library at runtime,
while other binaries will continue to use the system libcurl.
With `rpath` set, the executable linked against `$HOME/install/lib/libcurl.so`
then makes the runtime linker use that specific path and library, while other
binaries in your system will continue to use the system libcurl.

When you want to make your custom build of `curl` use its own libcurl and you
install them into `$HOME/install`, then a configure command line for this
Expand Down

0 comments on commit 5e2f68f

Please sign in to comment.