public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Khem Raj <raj.khem@gmail.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] spaceman: Add missing link to libuuid
Date: Thu, 7 Sep 2017 16:59:26 +1000	[thread overview]
Message-ID: <20170907065926.GY17782@dastard> (raw)
In-Reply-To: <CAMKF1souYmZRaQuBoOv-xR6+S8kj9oHpzZ_rN6V4ecnOr=RuFQ@mail.gmail.com>

On Wed, Sep 06, 2017 at 09:11:11PM -0700, Khem Raj wrote:
> On Wed, Sep 6, 2017 at 7:40 PM, Dave Chinner <david@fromorbit.com> wrote:
> > On Wed, Sep 06, 2017 at 07:19:00PM -0700, Khem Raj wrote:
> >> When uuid is enabled then we see linking failures with gold linker e.g.
> >>
> >> libxfs/.libs/libxfs.so: error: undefined reference to 'uuid_compare'
> >> libxfs/.libs/libxfs.so: error: undefined reference to 'uuid_copy'
> >> clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
> >
> > That's libxfs, not xfs_spaceman....
> 
> yes its libxfs but its linking spaceman, I chopped the error logs too
> much I guess.

xfs_spaceman does not link against libuuid:

$ ldd spaceman/xfs_spaceman 
	linux-vdso.so.1 (0x00007ffca4f68000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa36f358000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fa36f6f7000)

Nor libxfs - if it linked against libxfs, it would have to pull in
4 other libraries, including libuuid:

$ ldd repair/xfs_repair 
	linux-vdso.so.1 (0x00007ffd96bb4000)
	libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f5da2d4f000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5da2b47000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5da292a000)
	libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f5da26e4000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5da2345000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f5da2f54000)

So whatever build error you are having has nothing to do with
xfs_spaceman. Have you installed all the necessary libraries?

> >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> >> ---
> >>  spaceman/Makefile | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/spaceman/Makefile b/spaceman/Makefile
> >> index 95ec3c0..060e0af 100644
> >> --- a/spaceman/Makefile
> >> +++ b/spaceman/Makefile
> >> @@ -9,7 +9,7 @@ LTCOMMAND = xfs_spaceman
> >>  HFILES = init.h space.h
> >>  CFILES = init.c file.c prealloc.c trim.c
> >>
> >> -LLDLIBS = $(LIBXCMD)
> >> +LLDLIBS = $(LIBXCMD) $(LIBUUID)
> >
> > And spaceman doesn't link against libxfs, nor does libxcmd or
> > spaceman use uuids so I don't see why this fixes a problem with
> > libxfs...
> 
> I was just following what other binaries were doing, otherwise I agree
> libuuid should appear in DT_NEEDED flags in libxfs.so so linkers can
> pull it in automatically.
> 
> try using
> 
> LDFLAGS = "-fuse-ld=gold" if you want to reproduce the problem on your end.

$ gold -V
GNU gold (GNU Binutils for Debian 2.29) 1.14
$ make distclean
....
$ LDFLAGS="-fuse-ld=gold" make -j8 Q=
....
[LD]     xfs_spaceman
/bin/bash ../libtool --quiet --tag=CC --mode=link gcc -o xfs_spaceman -fuse-ld=gold -fuse-ld=gold  -fuse-ld=gold  -fuse-ld=gold -static  init.o file.o prealloc.o trim.o freesp.o   ../libxcmd/libxcmd.la
.....
$ ldd spaceman/xfs_spaceman 
	linux-vdso.so.1 (0x00007ffc943e4000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2def2e2000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f2def681000)

TOT builds just fine here on debian unstable using the gold linker,
and again this shows that spaceman does not link against libuuid.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2017-09-07  6:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07  2:19 [PATCH] spaceman: Add missing link to libuuid Khem Raj
2017-09-07  2:40 ` Dave Chinner
2017-09-07  4:11   ` Khem Raj
2017-09-07  6:59     ` Dave Chinner [this message]
2017-09-08 18:24   ` Khem Raj
2017-09-08 19:15     ` Eric Sandeen
2017-09-08 20:38       ` Khem Raj
2017-09-08 22:36     ` Dave Chinner
2017-09-08 23:22       ` Khem Raj
2017-09-09  0:33         ` Eric Sandeen
2017-09-09  0:36           ` Khem Raj

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=20170907065926.GY17782@dastard \
    --to=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=raj.khem@gmail.com \
    /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