Question about clisp version naming

Ken Brown kbrown@cornell.edu
Wed Mar 18 00:54:00 GMT 2015


On 3/17/2015 8:17 PM, Jon TURNEY wrote:
> On 17/03/2015 22:40, Ken Brown wrote:
>> Yes.  But that makes me wonder if I made things too complicated and
>> could have avoided building lisp.dll.  The native Windows build of clisp
>> creates a lisp.def file, containing the symbols of lisp.exe, and it just
>> adds "lisp.def" to the gcc command line when building the modules.  But
>> that didn't work on Cygwin; the linker complained that it didn't know
>> what lisp.def was, and it tried to interpret it as a linker script.  Is
>> there a way to make this approach work?
>
> I seem to recall that you can't have any comments at the start of the
> module definition file for ld to recognize it as one.

It didn't occur to me to check the syntax of the def file, although it 
should have (see below).  The one produced by the build (before I 
changed the approach) starts like this:

EXPORTS
IMPORTS
	lisp.exe.time_t_from_filetime
	lisp.exe.time_t_to_filetime
	lisp.exe.fd_read

And the gcc command line with error message is:

gcc -ggdb -O2 -pipe -Wimplicit-function-declaration -W -Wswitch 
-Wcomment -Wpointer-arith -Wreturn-type -Wmissing-declarations 
-Wimplicit -Wno-sign-compare -Wno-format-nonliteral -O 
-falign-functions=4 -DENABLE_UNICODE -DDYNAMIC_MODULES -DDLL_EXPORT 
-DPIC -Wl,--stack,0x800000 -Wl,--export-all-symbols modules.o calls.o 
bogomips.o -lcrypt -luser32 -lole32 -loleaut32 -L/usr/lib/w32api -luuid 
-lversion gettext.o lisp.a lisp.def libgnu.a /usr/lib/libintl.dll.a 
/usr/lib/libreadline.dll.a -lncurses /usr/lib/libiconv.dll.a -o lisp.exe
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../../x86_64-pc-cygwin/bin/ld: 
lisp.def:3: syntax error
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../../x86_64-pc-cygwin/bin/ld:lisp.def: 
file format not recognized; treating as linker script

Having just (!) noticed that this says there's a syntax error in line 3, 
  I tried deleting line 2.  This resulted in a slew of errors like this:

calls.o: In function `error_OS_stream':
/home/kbrown/src/cygclisp/clisp-2.49-4.20150312hg15611.x86_64/src/clisp/modules/syscalls/calls.c:183: 
undefined reference to `__imp_OS_error'
/home/kbrown/src/cygclisp/clisp-2.49-4.20150312hg15611.x86_64/src/clisp/modules/syscalls/calls.c:183:(.text+0x11d): 
relocation truncated to fit: R_X86_64_PC32 against undefined symbol 
`__imp_OS_error'

Next I tried deleting line 1 instead.  This time the linking completed. 
  But when I ran the resulting executable, I got this:

$ ./lisp.exe --version
module 'syscalls' requires package OS.

That's the same error Achim reported.

I'm stumped.  There must be a way around this, but I don't know enough 
about .def files to know what else to try.

Ken



More information about the Cygwin-apps mailing list