This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: Question about clisp version naming
- From: Yaakov Selkowitz <yselkowitz at cygwin dot com>
- To: cygwin-apps at cygwin dot com
- Date: Tue, 17 Mar 2015 20:47:23 -0500
- Subject: Re: Question about clisp version naming
- Authentication-results: sourceware.org; auth=none
- References: <5500B536 dot 4050108 at cornell dot edu> <87bnju6wox dot fsf at Rainer dot invalid> <5505C36F dot 5030802 at cornell dot edu> <1426443595 dot 8104 dot 9 dot camel at cygwin dot com> <5505D57C dot 3040005 at cornell dot edu> <87twxm5azp dot fsf at Rainer dot invalid> <55060BF6 dot 80801 at cornell dot edu> <87k2ygbw7v dot fsf at Rainer dot invalid> <87fv94bveq dot fsf at Rainer dot invalid> <87bnjsbuhm dot fsf at Rainer dot invalid> <55073E93 dot 2030902 at cornell dot edu> <87vbhzph1g dot fsf at Rainer dot invalid> <5508998A dot 6040903 at cornell dot edu> <1426628400 dot 12464 dot 38 dot camel at cygwin dot com> <5508AD6F dot 60309 at cornell dot edu> <5508C42B dot 6030804 at dronecode dot org dot uk> <5508CCB4 dot 6080108 at cornell dot edu> <5508D02D dot 3080506 at cornell dot edu>
On Tue, 2015-03-17 at 21:09 -0400, Ken Brown wrote:
> On 3/17/2015 8:54 PM, Ken Brown wrote:
> > 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.
>
> Maybe this will work after all. I continued the build process with the
> modified lisp.def (line 1 removed), and the resulting clisp.exe (which
> is a wrapper that calls lisp.exe with suitable arguments) seems to work.
>
> I'll keep playing with this, but if anyone can explain to me what's
> going on, I'd appreciate it. I'm not happy just randomly modifying
> lisp.def without really knowing what I'm doing.
A .def file can be used for two purposes:
1) to specify which symbols to export in a DLL/EXE, in place of
dllexport or -Wl,--export-all-symbols (EXPORTS)
2) to resolve symbols by declaring them in other DLL/EXE(s), in place of
a .dll.a (IMPORTS)
It appears that they were trying to use the same .def file for both
linking lisp.exe (EXPORTS) and the dynmods (IMPORTS), and that is
invalid syntax. However, according to your paste, lisp.exe is already
linked with -Wl,--export-all-symbols, so lisp.def EXPORTS isn't needed
when linking lisp.exe, only when linking the dynmods. So removing
EXPORTS and leaving in IMPORTS should work.
--
Yaakov