bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: Reuben Thomas <rrt@sc3d.org>
Cc: Bruno Haible <bruno@clisp.org>, bug-gnulib@gnu.org
Subject: Re: [PATCH] Do not decorate symbols as dllexport on Cygwin
Date: Tue, 7 Feb 2023 16:22:25 +0100	[thread overview]
Message-ID: <Y+JssZtceDqNhBce@calimero.vinschen.de> (raw)
In-Reply-To: <Y+JQnokXvTy0xxMn@calimero.vinschen.de>

[-- Attachment #1: Type: text/plain, Size: 2256 bytes --]

Hi Reuben,

On Feb  7 14:22, Corinna Vinschen wrote:
> On Feb  6 20:50, Reuben Thomas wrote:
> > On Mon, 6 Feb 2023 at 20:38, Bruno Haible <bruno@clisp.org> wrote:
> > 
> > >   1. 'recode' is updated to a current gnulib and publish a corresponding
> > >      tarball. (Hi Reuben :) )
> > >
> > 
> > I've updated gnulib in recode git; I'd be grateful if I could have a report
> > that it's doing what's needed here before I make a release, if possible!
> > 
> > Git at: https://github.com/rrthomas/recode.git
> 
> Working on it, but this may take a while.  Stay tuned, please.

The new recode gnulib build works as desired, thank you.

However, I'm trying to build recode from the Cygwin-specific build
script, and running it with default settings I get an error before
recode even got built:

    help2man: can't get `--help' info from ./recode.exe
    Try `--no-discard-stderr' if option outputs to stderr
    WARNING: '/usr/bin/help2man' is missing on your system.
	     [...]

So even with help2man installed, it doesn't work because recode.exe
didn't get build yet.

The Cygwin build system prefers parallel make.  And that's the problem.
I think commit dcdd5d26c0c2 is wrong:

    -recode.1: main.c $(top_srcdir)/configure.ac recode$(EXEEXT)
    +recode.1: main.c $(top_srcdir)/configure.ac

This means that recode.1 doesn't depend on the built binary anymore even
though it *needs* said binary to create the man page from it.  This
breaks dependency tracking in make and so make happily runs the
recode.1: rule before recode has been built, just depending on the
existence of main.c and configure.ac.

For cross-checking I tried a Linux build with `make -j8' and help2man
gets called before recode even got built as well.

So the above change breaks parallel make.

Not sure how to fix this correctly, but I have another patch, which
would be nice to have:

In Cygwin projects using libtool, we always have to add -no-undefined
iLDFLAGS.  This is some old safe-guard in libtool to remind developers
that when creating Windows DLLs, all external symbols must be resolved.

Fortunately, libtool allows this flags also on other platforms which
don't require its usage.

Patch is attached.  It would be nice if that's ok for inclusion.


Thanks,
Corinna

[-- Attachment #2: 0001-src-Makefile.am-librecode_la_LDFLAGS-add-no-undefine.patch --]
[-- Type: text/plain, Size: 1085 bytes --]

From 9ea601d4615d8420e7cf75659b647728774f65c9 Mon Sep 17 00:00:00 2001
From: Corinna Vinschen <vinschen@redhat.com>
Date: Tue, 7 Feb 2023 16:09:29 +0100
Subject: [PATCH] src/Makefile.am: librecode_la_LDFLAGS: add -no-undefined

-no-undefined is a libtool requirement to build shared libs on
Windows-based platforms like Cygwin.
---
 src/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 93d3ed3634b1..427cc8c97fe7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,7 +52,7 @@ recode_LDADD = librecode.la
 librecode_la_SOURCES = charname.c combine.c fr-charname.c iconv.c \
 names.c outer.c recode.c request.c strip-pool.c task.c $(ALL_STEPS) \
 $(include_HEADERS) $(noinst_HEADERS) $(H_STEPS)
-librecode_la_LDFLAGS = -version-info $(VERSION_INFO) $(LTLIBINTL) \
+librecode_la_LDFLAGS = -no-undefined -version-info $(VERSION_INFO) $(LTLIBINTL) \
 	$(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) $(LIB_MBRTOWC) $(LIB_SETLOCALE_NULL)
 librecode_la_LIBADD = ../lib/libgnu.la libmerged.la
 
-- 
2.39.1


  reply	other threads:[~2023-02-07 15:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-05 19:43 [PATCH] Do not decorate symbols as dllexport on Cygwin Corinna Vinschen
2023-02-05 20:41 ` Bruno Haible
2023-02-05 20:48   ` Bruno Haible
2023-02-05 21:22   ` Corinna Vinschen
2023-02-06 15:08     ` Corinna Vinschen
2023-02-06 16:36       ` Bruno Haible
2023-02-06 17:37       ` Bruno Haible
2023-02-06 20:04         ` Corinna Vinschen
2023-02-06 20:38           ` Bruno Haible
2023-02-06 20:43             ` Corinna Vinschen
2023-02-06 20:50             ` Reuben Thomas
2023-02-07 13:22               ` Corinna Vinschen
2023-02-07 15:22                 ` Corinna Vinschen [this message]
2023-02-10 14:11                   ` Reuben Thomas
2023-02-10 14:21                     ` Bruno Haible
2023-02-11 11:36                       ` Reuben Thomas
2023-02-11 12:06                         ` Corinna Vinschen
2023-02-11 12:29                           ` Reuben Thomas
2023-02-11 12:40                             ` Corinna Vinschen
2023-02-17  9:30                               ` Reuben Thomas
2023-02-17  9:58                                 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+JssZtceDqNhBce@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=rrt@sc3d.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).