Re: xfsprogs-5.2.0 FTBFS: ../libxfs/.libs/libxfs.so: undefined reference to `xfs_ag_geom_health'

Dave Chinner
2019-08-12T03:12:32Z

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.

Cheers,

Dave.