GNU bug report logs - #54020
document libtool compile-specific flags in manual

Previous Next

Package: automake;

Reported by: Damian Szuberski <szuberskidamian <at> gmail.com>

Date: Wed, 16 Feb 2022 01:42:02 UTC

Severity: normal

Tags: confirmed, help

Full log


Message #78 received at 54020 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Damian Szuberski <szuberskidamian <at> gmail.com>
Cc: 54020 <at> debbugs.gnu.org
Subject: Re: bug#54020: Impossible to pass `-no-suppress` to `libtool` via
 automake files
Date: Thu, 18 Jan 2024 20:55:18 -0500
[Message part 1 (text/plain, inline)]
On 17 Jan 2024 00:11, Mike Frysinger wrote:
> On 15 Feb 2022 23:03, Damian Szuberski wrote:
> > A standard `libtool` invocation line generated by automake looks like:
> > ```
> > LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
> >         $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
> >         $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
> >         $(AM_CFLAGS) $(CFLAGS)
> > ```
> > Sometimes files compiled using the method above make the compiler emit
> > errors. Those errors are suppressed by default which makes troubleshooting
> > impossible. `libtool` has a command line option, `-no-suppress` which can
> > be used to make the compiler verbose. Unfortunately, there is no way to
> > inject that option since `libtool` demands that it comes after
> > `--mode=compile`. `AM_LIBTOOLFLAGS` nor `LIBTOOLFLAGS` cannot be used for
> > that purpose since "it is too early", according to `libtool`'s command line
> > parser. It is somewhat possible to use `AM_CFLAGS` for that purpose but
> > then it breaks modes other than `--mode=compile`.
> 
> i was reading the libtool manual today and was reminded that libtool processes
> some standard options straight out of the wrapped command rather than forcing
> you to split things up.  for example, it detects the -o option and parses that.
> then i was reminded that when passing libtool linker options like -no-undefined,
> you simply add them to the standard LDFLAGS.
> 
> which is to say, options like -no-suppress do not need exact placement.  put it
> in existing CFLAGS variables as makes sense for your target.
> 	AM_CFLAGS = -no-suppress
> or
> 	libfoo_la_CFLAGS = $(AM_CFLAGS) -no-suppress
> and libtool should parse & discard it before invoking the underlying compiler.

the Automake manual has libtool examples for general & linking flags,
but nothing for compiling.  we could add some to make it more clear.
-mike
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year and 208 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.