bug-gawk
[Top][All Lists]
Advanced

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

Re: Avoid gawkextlib as a separate shared library


From: Eli Zaretskii
Subject: Re: Avoid gawkextlib as a separate shared library
Date: Thu, 19 May 2022 12:28:02 +0300

> Cc: aschorr@telemetry-investments.com, arnold@skeeve.com, bug-gawk@gnu.org
> From: Manuel Collado <mcollado2011@gmail.com>
> Date: Wed, 18 May 2022 23:54:19 +0200
> 
> > What version of ld do you have there?  What does "ld --version"
> > display?
> 
> $ ld --version
> GNU ld (GNU Binutils) 2.32

Not sure if this is related, but if nothing else helps, try the one
from ezwinports, I have the latest v2.38 there.

> >  Can you show the output of the gawk-mpfr linking command, if
> > you add the -v switch to its command line, and remove the DLL from the
> > lib/ directory, leaving there only the import library?
> 
> Don't know how to add the -v switch. The linker is invoked by libtool.

The way to do that is to configure the package with CC='gcc -v', and
then rebuild.

> mcollado@PC6 /c/Temp/gawextlib-mingw/gawk-mpfr-1.1.0
> $ ls -l /c/gnu/bin
> total 18779
> -rwxr-xr-x 1 mcollado Administradores 6476300 May  7  2021 awk.exe
> -rwxr-xr-x 1 mcollado Administradores 6794462 May 11  2021 gawk.exe
> -rwxr-xr-x 1 mcollado Administradores    1632 May  7  2021 igawk
> -rwxr-xr-x 1 mcollado Administradores      36 May  7  2021 igawk.bat
> -rw-r--r-- 1 mcollado Administradores    1670 May  7  2021 igawk.cmd
> -rwxr-xr-x 1 mcollado Administradores  242747 May 16 15:30 
> libgawkextlib-0.dll
> -rwxr-xr-x 1 mcollado Administradores 1036415 May  7  2021 
> libgcc_s_dw2-1.dll
> -rwxr-xr-x 1 mcollado Administradores 1415068 May  7  2021 libiconv-2.dll
> -rwxr-xr-x 1 mcollado Administradores  484613 Apr 30  2014 libintl-8.dll
> -rwxr-xr-x 1 mcollado Administradores 2770620 May  7  2021 libmpfr-6.dll
> 
> mcollado@PC6 /c/Temp/gawextlib-mingw/gawk-mpfr-1.1.0
> $ ls -l /c/gnu/lib
> total 10
> drwxr-xr-x 2 mcollado Administradores 4096 May  7  2021 gawk
> -rw-r--r-- 1 mcollado Administradores 5454 May 16 15:30 libgawkextlib.dll.a
> 
> mcollado@PC6 /c/Temp/gawextlib-mingw/gawk-mpfr-1.1.0
> $ ls -l /c/gnu/include
> total 45
> -rw-r--r-- 1 mcollado Administradores 40645 May  7  2021 gawkapi.h
> -rw-r--r-- 1 mcollado Administradores  4494 May 16 15:30 gawkextlib.h

It sounds like your include/ and lib/ directories only include files
specific to gawkextlib?  This could be part of the problem; I use the
directories with all the header files I have installed in include/ and
all the library files in lib/.  Maybe try that way as well, to make
sure this isn't related.

> -- First attempt to build gawk-mpfr ===>> FAIL
> 
> mcollado@PC6 /c/Temp/gawextlib-mingw/gawk-mpfr-1.1.0
> $ ./configure --prefix=/c/gnu --with-gawk=/c/gnu --with-gawkextlib=/c/gnu
> ...
> checking for ld used by GCC... c:/mingw/mingw32/bin/ld.exe
> checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
> ...
> checking whether the gcc linker (c:/mingw/mingw32/bin/ld.exe) supports 
> shared libraries... yes
> ...
> mcollado@PC6 /c/Temp/gawextlib-mingw/gawk-mpfr-1.1.0
> $ make
> make  all-recursive
> ...
> /bin/sh ./libtool  --tag=CC   --mode=link gcc  -g -O2 -Wall -Wextra 
> -Wpointer-arith -Wmissing-prototypes -Wcast-qual -Wwrite-strings 
> -Wshadow -module -avoid-version -no-undefined -L/c/gnu/lib -L/c/gnu/lib 
>   -o mpfr.la -rpath /c/gnu/lib/gawk mpfr.lo -lmpfr -lgmp -lgawkextlib -lintl
> 
> *** Warning: linker path does not have real file for library -lgawkextlib.
> *** I have the capability to make that library automatically link in when
> *** you link to this library.  But I can only do this if you have a
> *** shared version of the library, which you do not appear to have
> *** because I did check the linker path looking for a file starting
> *** with libgawkextlib and none of the candidates passed a file format test
> *** using a file magic. Last file checked: /c/gnu/lib/libgawkextlib.dll.a

This seems to say that libtool didn't like your libgawkextlib.dll.a
import library for some reason or other.  I have no idea why that
happened.  I can suggest two things to try:

  . rebuild and reinstall the gawkextlib DLL, then try again with the
    newly rebuilt import library;
  . add debug printouts to libtool where it looks for the libraries
    (start by searching libtool script for the above warning text),
    and try to understand why that search fails, even though it seems
    to examine the import library, which should have satisfied the
    search -- maybe some of the programs libtool invokes (like 'ls' or
    Grep) fails to DTRT?

> -- Dirty hack: copy libgawkextlib-0.dll to c:\gnu\lib.
> Please note that the build succeeds also by adding -L/c/gnu/bin to the 
> link flags in addition to -L/c/gnu/lib, instead of copying the DLL file.

Yes, because the linker can link against the DLL itself.  But that
shouldn't be necessary if you have a good import library.

> > Also, can you verify that the input library is valid: not an empty
> > file, in the ar format, and that it includes the __imp__* symbols as
> > an import library should?  (I suggest to use "nm -A" to see that.)
> 
> It looks ok.

I suggest to rebuild gawkextlib, to make sure the import library is
not the culprit.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]