In readline-7.0, the extern variable rl_readline_state changed from int to unsigned long. This breaks compilation of clisp-2.49 with readline enabled because the expected size/alignment does not match the actual one (at least on NetBSD-7.99.38/amd64).
The fix is easy, just replace the expected type with ulong. I'm not sure how you can handle backwards compatibility to readline<7 though, I'll leave that up to you.
Same problem here:
64 x86_64 GNU/Linux
system : Distributor ID: Ubuntu
Description: Ubuntu 16.10
Release: 16.10
Codename: yakkety
base/lisp.run -B . -M base/lispinit.mem -norc -q -i i18n/i18n -i syscalls/posix -i regexp/regexp -i readline/readline -x (saveinitmem "base/lispinit.mem")
;; Loading file /home/alvis/projects/repos/clisp-bug-report/clisp-2.49/build-with-gcc/i18n/i18n.fas ...
;; Loaded file /home/alvis/projects/repos/clisp-bug-report/clisp-2.49/build-with-gcc/i18n/i18n.fas
;; Loading file /home/alvis/projects/repos/clisp-bug-report/clisp-2.49/build-with-gcc/syscalls/posix.fas ...
;; Loaded file /home/alvis/projects/repos/clisp-bug-report/clisp-2.49/build-with-gcc/syscalls/posix.fas
;; Loading file /home/alvis/projects/repos/clisp-bug-report/clisp-2.49/build-with-gcc/regexp/regexp.fas ...
;; Loaded file /home/alvis/projects/repos/clisp-bug-report/clisp-2.49/build-with-gcc/regexp/regexp.fas
;; Loading file /home/alvis/projects/repos/clisp-bug-report/clisp-2.49/build-with-gcc/readline/readline.fas ...
*** - FFI::FIND-FOREIGN-VARIABLE: foreign variable #<foreign-variable "rl_readline_state"="" #x00007f4803ecd030=""> does not have the required size or alignment
./clisp-link: failed in /home/alvis/projects/repos/clisp-bug-report/clisp-2.49/build-with-gcc
Makefile:2597: recipe for target 'base' failed make: *** [base] Error 1</foreign-variable>
Note: I have submitted this bug report only because it is the same but, but on a different platform.
Thanks for the report. This is now fixed in the hg repository.
Patch attached.