Skip to content

Draft: build: link readline-8.0 dynamically

Feodor Alexandrov requested to merge dynamic-linking into picodata-submodule
  1. Readline depends on ncurses build. libtinfo.so which appears on libncurses build need to be linked into the libreadline.so. This is the reason of adding --with-shared flag to cmake description of the ncurses building process.

  2. By default the readline builds both as static and shared. Here the flag --disable-static allow to discard off static artifacts.

  3. The process of linking libtinfo.so to readline on the build stage is a bit tricky, because of unable to edit cmake to add the correct path to target library. As described here[1] and as looking through the Makefile.in may be seen - most compiling and linking flags are out of standard GNU convention and adding its to the cmake has no effect.

This is the reason of patching the Makefile.in as described here[1] but for shared build (with -shared flag).

  1. To avoid undefined reference to main on building libreadline.so and libhistory.so here the -nostartfiles added[2].

  2. Add -L in build.rs to resolve path on configure stage (-rpath is for build stage).

Edited by Feodor Alexandrov

Merge request reports