From: Dave Chinner <david@fromorbit.com>
To: Thomas Deutschmann <whissi@gentoo.org>
Cc: "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: Mon, 12 Aug 2019 14:30:46 +1000 [thread overview]
Message-ID: <20190812043046.GB6129@dread.disaster.area> (raw)
In-Reply-To: <20190812031123.GA6129@dread.disaster.area>
On Mon, Aug 12, 2019 at 01:11:23PM +1000, Dave Chinner wrote:
> On Mon, Aug 12, 2019 at 03:21:28AM +0200, Thomas Deutschmann wrote:
> > On 2019-08-12 02:23, Dave Chinner wrote:
> > > That still doesn't explain where all the whacky gcc options are
> > > coming from - that's got to be something specific to your build or
> > > distro environment.
> >
> > Mh, at the moment it looks like xfsprogs' build system is adding
> > $LDFLAGS multiple times when LDFLAGS is set in environment.
> >
> > 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
.....
$ make -j32
<builds successfully>
$ touch copy/xfs_copy.c
$ make Q=
....
Building copy
/usr/bin/make --no-print-directory Q= -q -C copy || /usr/bin/make --no-print-directory Q= -C copy
gcc -MM -g -O2 -D_FILE_OFFSET_BITS=64 -g -O2 -DDEBUG -DVERSION=\"5.2.0\" -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"xfsprogs\" -I../include -I../libxfs -DENABLE_GETTEXT -D_GNU_SOURCE -funsigned-char -fno-strict-aliasing -Wall -DHAVE_MNTENT -DHAVE_FSETXATTR -DENABLE_BLKID -DHAVE_GETFSMAP xfs_copy.c > .dep
rm -f .dep
[CC] xfs_copy.o
gcc -g -O2 -D_FILE_OFFSET_BITS=64 -g -O2 -DDEBUG -DVERSION=\"5.2.0\" -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"xfsprogs\" -I../include -I../libxfs -DENABLE_GETTEXT -D_GNU_SOURCE -funsigned-char -fno-strict-aliasing -Wall -DHAVE_MNTENT -DHAVE_FSETXATTR -DENABLE_BLKID -DHAVE_GETFSMAP -c xfs_copy.c
[LD] xfs_copy
/bin/bash ../libtool --quiet --tag=CC --mode=link gcc -o xfs_copy -Wl,-O1 -Wl,--as-needed -static-libtool-libs xfs_copy.o ../libxfs/libxfs.la ../libxlog/libxlog.la ../libfrog/libfrog.la -luuid -lpthread -lrt
Building db
....
So, before you try to build, start with
$ make realclean; make configure
to make sure you are running a configure script that is built from
the release tarball source code, then run your custom build and
see what happens.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-08-12 4:31 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 [this message]
2019-08-12 10:57 ` Thomas Deutschmann
2019-08-12 16:34 ` Eric Sandeen
2019-08-12 22:03 ` Dave Chinner
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=20190812043046.GB6129@dread.disaster.area \
--to=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
--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