From: Dave Chinner <david@fromorbit.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Thomas Deutschmann <whissi@gentoo.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Subject: Re: xfsprogs-5.2.0 FTBFS: ../libxfs/.libs/libxfs.so: undefined reference to `xfs_ag_geom_health'
Date: Tue, 13 Aug 2019 08:03:42 +1000 [thread overview]
Message-ID: <20190812220342.GD6129@dread.disaster.area> (raw)
In-Reply-To: <5aff83b5-2ff3-4c2c-e0ef-c04bc506fe4f@sandeen.net>
On Mon, Aug 12, 2019 at 11:34:56AM -0500, Eric Sandeen wrote:
>
>
> On 8/12/19 5:57 AM, Thomas Deutschmann wrote:
> > Hi,
> >
> > On 2019-08-12 06:30, Dave Chinner wrote:
> >>>> In a clear environment, do:
> >>>>
> >>>>> tar -xaf xfsprogs-5.2.0.tar.xz
> >>>>> cd xfsprogs-5.2.0
> >>>>> export CFLAGS="-O2 -pipe -march=ivybridge -mtune=ivybridge -mno-xsaveopt"
> >>>>> export LDFLAGS="-Wl,-O1 -Wl,--as-needed"
> >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >>> Don't do this.
> >>>
> >>> "--as-needed" is the default linker behaviour since gcc 4.x. You do
> >>> not need this. As for passing "-O1" to the linker, that's not going
> >>> to do anything measurable for you. Use --enable-lto to turn on link
> >>> time optimisations if they are supported by the compiler.
> >>
> >> Ok, I could reproduce your link time failure for a while with
> >> --enable-lto, but I ran 'make distclean' and the problem went away
> >> completely. And I can build with your options successfully, too:
> >>
> >> $ make realclean
> >> $ make configure
> >> <builds new configure script>
> >> $ LDFLAGS="-Wl,-O1 -Wl,--as-needed" ./configure
> >
> > That's not the correct way to reproduce. It's really important to
> > _export_ the variable to trigger the problem and _this_ is a problem in
> > xfsprogs' build system.
> >
> > But keep in mind that 3x "-Wl,-O1 -Wl,--as-needed" don't cause a failure
> > without "--disable-static" for me... that's just the answer for your
> > question where this is coming from.
>
> My takeaway here is that I should probably stub out some things to make
> this issue go away altogether,
The linker should be taking care of eliding dead code from
statically linked libraries.
The issue here is that a shared library can't have undefined symbols
elided at link time because the linker has no idea if they will be
used or not. Hence it fails to link against binaries that don't
specify all possible external library dependencies, even when the
library dependency is brought in by another library.
> but that it can also be remedied by adjusting
> compiler/linker flags. Correct? I'm not sure if this warrants a 5.2.1 release.
If you don't use the non-default --disable-static configure option
then there is no problem. That option appears to have been broken
for a while now, so lets just get rid of it.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-08-12 22:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-11 13:06 xfsprogs-5.2.0 FTBFS: ../libxfs/.libs/libxfs.so: undefined reference to `xfs_ag_geom_health' Thomas Deutschmann
2019-08-11 22:53 ` Dave Chinner
2019-08-11 23:30 ` Thomas Deutschmann
2019-08-12 0:23 ` Dave Chinner
2019-08-12 1:21 ` Thomas Deutschmann
2019-08-12 3:11 ` Dave Chinner
2019-08-12 4:30 ` Dave Chinner
2019-08-12 10:57 ` Thomas Deutschmann
2019-08-12 16:34 ` Eric Sandeen
2019-08-12 22:03 ` Dave Chinner [this message]
2019-08-12 21:44 ` Dave Chinner
2019-08-12 22:18 ` Thomas Deutschmann
2019-08-13 1:04 ` Dave Chinner
2019-08-13 13:52 ` Thomas Deutschmann
2019-08-14 3:42 ` Dave Chinner
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190812220342.GD6129@dread.disaster.area \
--to=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
--cc=whissi@gentoo.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