Description
The following code:
| char rl_pending_input ();
| int
| main (void)
| {
| return rl_pending_input ();
| ;
| return 0;
| }
zig-cc -o conftest -flto=thin conftest.c -lreadline >&5
Resulted in this output:
ld.lld: error: undefined symbol: rl_pending_input
>>> referenced by conftest.c:6
>>> /home/m/.cache/zig/o/b805c69c22df553bed686894c3b10bd7/conftest.lto.conftest.o:(main)
But I expected this output instead:
configure:69337: $? = 0
configure:69347: result: yes
In my understanding, this comes down to LLVM IR code embedding type information for symbols. rl_pending_output
is defined as an int
. Linking against a function char rl_pending_order()
works without lto because it ignores type information, but with lto it's a mismatch and the function is indeed undefined.
Passing ac_cv_lib_readline_rl_pending_input=yes
to compilation works around the issue and php cli and fpm compile successfully. Embed SAPI fails, but that's for a different ticket.
PHP Version
Operating System
All unix systems