Building readline extension would say: checking for libedit readline replacement... yes, shared even when configuring `--without-libedit`. This is because `PHP_ARG_WITH(libedit, …)`, internally calls `PHP_ALWAYS_SHARED`, which in `phpize`-generated `configure.ac` is defined as always forcing the value to shared. This will prevent `PHP_ARG_WITH(readline, …)` from being invoked so `READLINE_DIR` variable will never be defined. This was not an issue before we split the extension out of php.unwrapped inmain282337799b
, as `PHP_ALWAYS_SHARED` is empty there. ----- Additionally, because the build script passed `-L$READLINE_DIR/lib` as a flag to the compiler on PHP < 7.4 (built by the nix-phps repository), this ended up with a FHS-like path being passed to the linker. And once we bumped GCC to 11 in52f8cf58a4
, the linker would fail: gcc -shared .libs/readline.o .libs/readline_cli.o -Wl,--rpath -Wl,/lib -L/lib -ledit -lncurses -Wl,-soname -Wl,readline.so -o .libs/readline.so impure path `/lib' used in link collect2: error: ld returned 1 exit status This no longer happens with PHP ≥ 7.4, since they switched to getting the linker flags from pkg-config inb537203d20
. ---- As a compromise, let’s make the `PHP_ALWAYS_SHARED` function force `shared` status but only for flags that are not disabled. That will allow us to remove the libedit dependency and also the nasty patch for configure script due to `--with-libedit` not being passed (which would be required for PHP < 7.4 to be able to find readline.h from libedit). Thanks to Pol Dellaiera for both bisections.
parent
03e31c533c
commit
9cdbd72004
Loading…
Reference in new issue