[tex-k] web2c build failure with slibtool

Michael Orlitzky michael at orlitzky.com
Sat Jan 15 19:28:41 CET 2022


(This is a forwarded copy of a bug[0] reported on Gentoo)

Using slibtool[1] to build web2c results in a link failure,

  /usr/lib/blah/blah/blah/ld: cannot find -lweb2c

from the command

  libtool --tag=CC --mode=link ... -o fixwrites fixwrites.o -L. -lweb2c

In short, this is due to mixing libtool and non-libtool (libweb2c.a)
parts, and it can be fixed by replacing "-L. -lweb2c" with the already-
known, fixed name of the library to be linked -- namely libweb2c.a.

The relevant section[2] of Makefile.in is,

  web2c_LDADD = -L. -lweb2c

and I am suggesting it be changed to 

  web2c_LDADD = libweb2c.a

This not only fixes the build with slibtool, but I believe it is The
Right Thing To Do. Using "-L. -lweb2c" leaves open the possibility that
some other wonky piece of the build system or environment will prepend
-L<foo> to the linker flags, where <foo> is a directory that happens to
contain another version of libweb2c. And in that case you'll link with
the wrong copy of the library. You know precisely which one you want to
link with: it's libweb2c.a in the current directory. So passing that
value directly is the easy thing to do here.


[0]https://bugs.gentoo.org/775170
[1]https://github.com/midipix-project/slibtool
[2]https://tug.org/svn/texlive/trunk/Build/source/texk/web2c/web2c/Makefile.in?view=markup#l419




More information about the tex-k mailing list.