hatrick on Thu, 8 Feb 2001 10:27:30 +0000 (GMT+00:00)


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

Re: pari & cygwin insurmountable difficulty saga!


--Hushpart_boundary_SGeYtsaiixaOrEnOTPFkaPwZZDlHRtER
Content-type: text/plain

----- Begin Hush Signed Message from hatrick@hushmail.com -----

Hello and many thanks for the fast responses;

I have tried a number of increasingly drastic things in the past hours.
the good news:
i have learned rather more about the pari / cygwin build proc.
also: Iwao's static build suggestion works.

the bad news:
still no joy on building the dll.

i'm afraid i can't find any file where __imp_reent_data is global and *not*
extern;
could this be the prob?
Following Gerhard's suggestion I changed Makefile.DLLs to contain

extern __declspec(dllimport) struct _reent reent_data;

in the hope that this might do something. no joy ( see result below).

Sooo any enlightening comments would still be much appreciated.

Thanks & regards,
Kerr Hatrick.

# following is result of replacing appropriate line by
# echo 'extern __declspec(dllimport) struct _reent __imp_reent_data;'		>>
dll_init.c
# in makefile.DLLs:

$ make gp
echo EXPORTS > libpari.def
echo libpari_impure_ptr = _impure_ptr >> libpari.def
nm libpari.a | sed -n '/^........ [BCDRT] _/s/[^_]*_//p' >> libpari.def
dlltool                 \
        --def libpari.def                                       \
        --dllname libpari.dll                           \
        --output-exp libpari.exp                                \
        --output-lib libpari_dll.a
echo "/* automatically generated by Makefile.DLLs */"   > libpari_dll.c
echo "void *_impure_ptr;"                               >> libpari_dll.c
/usr/bin/gcc -O3 -DGCC_INLINE -Wall -Wno-implicit       -malign-loops=2
-malign-jumps=2 -malign-functions=2 -fomit-frame-pointer   -I. -I../src/head
ers  -c -o libpari_dll.o libpari_dll.c
/usr/bin/ld -shared -soname libpari.dll  --dll -o libpari.dll
        \
        -e _dll_entry@12                                        \
        libpari.exp libpari.a libpari_dll.o
        \
        dll_init.o dll_fixup.o                                  \
                                                \
        -L/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6 -L/usr/lib -L/usr/lib
-lgcc -lcygwin -lkernel32 -lgcc
Cannot export __imp_reent_data: symbol not defined
dll_init.o(.text+0x1):dll_init.c: undefined reference to `__imp_reent_data'
make: *** [libpari.dll] Error 1
rm libpari_dll.c libpari.exp libpari.def libpari_dll.o

# end attempt

At Wed, 7 Feb 2001 17:16:48 +0100 (MET), Gerhard Niklasch <nikl@mathematik.tu-
muenchen.de> wrote:

>
>In response to:
>> Message-Id: <200102071527.HAA18372@user5.hushmail.com>
>> From: hatrick@hushmail.com
>> 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 www.google.com came up
>with the following:
>
>http://www.cygwin.com/ml/cygwin/2000-09/msg00812.html
>===8<---
>Using your suggestion, I changed the following in src/utils/dllinit.c:
>
>    extern struct _reent *__imp_reent_data;
>
>to:
>
>    extern __declspec(dllimport) struct _reent reent_data;
>
>and the '__imp_reent_data' undefined reference problem was solved.
>--->8===
>
>dllinit.c is built "on the fly" in a sequence of echo commands
>which come out of config/Makefile.DLLs, at the end:
>
>===8<---
># 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'.
>dll_init.c:
>        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
>--->8===
>
>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,
>Gerhard
>

----- Begin Hush Signature v1.3 -----
Hito7T1ZUDaJhXMqNVACO2MFqFULfB2xC8cG0kOzTnUkezXq8KvQA5wmQYHRpfXNIXv8
i5XvmdarjdU2cL5gEQYTwXqckY6cKpGKeD8M+18gsdcm+/Khh/YNYIAvGRtwhN38f4k6
jkS5wnXtqxCeYNeg8PNEf0SnBjmDKrBGSjyPtQMWZpPfajQcuNT6YLhxIhVq8CIUJ79z
RNQZx8fik5OetgxQl8x7Z+Gjx+UbLTwuiB5nN+ZscE+NsNT3c+KQp1nQmG9g8qErGKqQ
mY6uWbPUvDuULGxgoAeBVKKe3DcZXK4/YqwhM1nTf5EX6twBWSL6avB2ul0WZjJh2z0i
dBJAOdbMenBsn1oS7buRK9CVIwMEH2qHRSI191ErEVqDVRuE1eMCobJuefTb54UFNBYw
UEcWDAFem52TnunklFCvYDPdx5dgSPt05qPRjqnZ/ihZcKK5fNOancxWHsHHFTP18spv
gdO5iFs6vTB46ruzOWqUMoMOJUGky9KTpi2XjUNSB+J9
----- End Hush Signature v1.3 -----
\n\nThis message has been signed with a Hush Digital Signature. \nTo verify the signature, please go to www.hush.com/tools\n\n
--Hushpart_boundary_SGeYtsaiixaOrEnOTPFkaPwZZDlHRtER--


IMPORTANT NOTICE:  If you are not using HushMail, this message could have been read easily by the many people who have access to your open personal email messages.
Get your FREE, totally secure email address at http://www.hushmail.com.