Gerhard Niklasch on Wed, 7 Feb 2001 17:16:48 +0100 (MET)

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: pari & cygwin insurmountable difficulty saga!

In response to:
> Message-Id: <>
> From:
> Date: Wed, 7 Feb 2001 15:18:28 +0000 (GMT+00:00)

> Cannot export __imp_reent_data: symbol not defined
> dll_init.o(.text+0x1):dll_init.c: undefined reference to `__imp_reent_data'
> Make[1]: *** [libpari.dll] Error 1

Disclaimer: I know nothing at all about CygWin.

However, pasting __imp_reent_data into came up
with the following:
Using your suggestion, I changed the following in src/utils/dllinit.c:

    extern struct _reent *__imp_reent_data;


    extern __declspec(dllimport) struct _reent reent_data;

and the '__imp_reent_data' undefined reference problem was solved.

dllinit.c is built "on the fly" in a sequence of echo commands
which come out of config/Makefile.DLLs, at the end:

# Windows requires each DLL to have an initialization function
# that is called at certain points (thread/process attach/detach).
# This one just initializes `_impure_ptr'.
        echo '#include <stdio.h>'                               > dll_init.c
        echo 'extern struct _reent *_impure_ptr;'               >> dll_init.c
        echo 'extern struct _reent *__imp_reent_data;'          >> dll_init.c
        echo '__attribute__((stdcall))'                         >> dll_init.c
        echo 'int dll_entry(int handle, int reason, void *ptr)' >> dll_init.c
        echo '{ _impure_ptr=__imp_reent_data; return 1; }'      >> dll_init.c

# The following rule is just there to convince gcc
# to keep otherwise unused intermediate targets around.
dont_throw_away: dll_fixup.o dll_init.o

So you may try changing the third of these echo lines as indicated,
and rebuild  (I guess you have to re-run the configure phase?).

(Karim -- any idea whether this change won't break older cygwins?)

Hope this helps,