On 2024-05-21 07:18, Jon Turney via Cygwin-apps wrote:
On 17/05/2024 05:50, Brian Inglis via Cygwin-apps wrote:
On 2024-05-16 15:45, Ken Brown via Cygwin-apps wrote:
On 5/16/2024 4:24 PM, Brian Inglis via Cygwin-apps wrote:
Trying to update dateutils, autotools build fails with:
libtool: error: can't build x86_64-pc-cygwin shared library unless -no-undefined is specified
Suggestions for overrides or fixes?
Tried:
LDFLAGS="$LDFLAGS -Wl,--no-allow-shlib-undefined -Wl,--no-undefined"
CYGCONF_ARGS="
      --enable-contrib
      --enable-tzmap-fetch
      lt_no_undefined_flag=--no-undefined
      no_undefined_flag=--no-undefined
You and I discussed this a few years ago in connection with curl.  The solution there, and in most similar cases, is to add -no-undefined to the appropriate lib*_la_LDFLAGS variable(s) in Makefile.am.  See

Had to patch into lib AM_LDFLAGS variable, then found out that library was not for use in open source packages, but only required to link with a (missing) proprietary MatLab module, so dropped the config --enable-contrib option!

Yeah, building stuff for Cygwin often requires adding this flag in the appropriate places, to say "yes, I really do want a shared library".
https://www.gnu.org/software/libtool/manual/html_node/Link-mode.html#Link-mode
-no-undefined
Declare that output-file does not depend on any libraries other than
the ones listed on the command line, i.e., after linking, it will not
have unresolved symbols. Some platforms require all symbols in shared
libraries to be resolved at library creation (see Inter-library
dependencies), and using this parameter allows libtool to assume that
this will not happen.
Note that because this flag doesn't do anything for non-PE targets, it's (a) always safe to upstream, and (b) doesn't actually prevent development from unwittingly introducing unresolved symbols.

In that case, could we ask Bruno to add into gnulib somewhere appropriate?

This should probably be mentioned in the FAQ item on PE linkage peculiarities.

In libtool info?

--
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                -- Antoine de Saint-Exupéry

Reply via email to