All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spaceman: Add missing link to libuuid
@ 2017-09-07  2:19 Khem Raj
  2017-09-07  2:40 ` Dave Chinner
  0 siblings, 1 reply; 11+ messages in thread
From: Khem Raj @ 2017-09-07  2:19 UTC (permalink / raw)
  To: linux-xfs; +Cc: Khem Raj

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)

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)
 LTDEPENDENCIES = $(LIBXCMD)
 LLDFLAGS = -static
 
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  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-08 18:24   ` Khem Raj
  0 siblings, 2 replies; 11+ messages in thread
From: Dave Chinner @ 2017-09-07  2:40 UTC (permalink / raw)
  To: Khem Raj; +Cc: linux-xfs

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....

> 
> 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...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  2017-09-07  2:40 ` Dave Chinner
@ 2017-09-07  4:11   ` Khem Raj
  2017-09-07  6:59     ` Dave Chinner
  2017-09-08 18:24   ` Khem Raj
  1 sibling, 1 reply; 11+ messages in thread
From: Khem Raj @ 2017-09-07  4:11 UTC (permalink / raw)
  To: Dave Chinner; +Cc: linux-xfs

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.

>
>>
>> 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.

>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  2017-09-07  4:11   ` Khem Raj
@ 2017-09-07  6:59     ` Dave Chinner
  0 siblings, 0 replies; 11+ messages in thread
From: Dave Chinner @ 2017-09-07  6:59 UTC (permalink / raw)
  To: Khem Raj; +Cc: linux-xfs

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  2017-09-07  2:40 ` Dave Chinner
  2017-09-07  4:11   ` Khem Raj
@ 2017-09-08 18:24   ` Khem Raj
  2017-09-08 19:15     ` Eric Sandeen
  2017-09-08 22:36     ` Dave Chinner
  1 sibling, 2 replies; 11+ messages in thread
From: Khem Raj @ 2017-09-08 18:24 UTC (permalink / raw)
  To: Dave Chinner; +Cc: linux-xfs

Hi Dave

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....
>
>>
>> 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 am building with --disable-static, I wonder if thats not a supported
configuration
for xfsprogs

> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  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
  1 sibling, 1 reply; 11+ messages in thread
From: Eric Sandeen @ 2017-09-08 19:15 UTC (permalink / raw)
  To: Khem Raj, Dave Chinner; +Cc: linux-xfs

On 9/8/17 1:24 PM, Khem Raj wrote:
> Hi Dave
> 
> 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....
>>
>>>
>>> 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 am building with --disable-static, I wonder if thats not a supported
> configuration
> for xfsprogs

Still doesn't make spaceman link against libxfs or use uuids ;)

I guess I'd suggest starting w/ x86 and a standard toolchain, make
--disable-static work for you there (I see that it does need some
fixups), then try things w/ the alternate toolchain and see
if more work is needed.

-Eric

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  2017-09-08 19:15     ` Eric Sandeen
@ 2017-09-08 20:38       ` Khem Raj
  0 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2017-09-08 20:38 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Dave Chinner, linux-xfs

On Fri, Sep 8, 2017 at 12:15 PM, Eric Sandeen <sandeen@sandeen.net> wrote:
> On 9/8/17 1:24 PM, Khem Raj wrote:
>> Hi Dave
>>
>> 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....
>>>
>>>>
>>>> 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 am building with --disable-static, I wonder if thats not a supported
>> configuration
>> for xfsprogs
>
> Still doesn't make spaceman link against libxfs or use uuids ;)
>
> I guess I'd suggest starting w/ x86 and a standard toolchain, make
> --disable-static work for you there (I see that it does need some
> fixups), then try things w/ the alternate toolchain and see
> if more work is needed.

I do see indirect dependency though
libxcmd needs platform_findsizes symbol
 from libxfs

I agree, there is some work needed to get it going with --disable-static
>
> -Eric

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  2017-09-08 18:24   ` Khem Raj
  2017-09-08 19:15     ` Eric Sandeen
@ 2017-09-08 22:36     ` Dave Chinner
  2017-09-08 23:22       ` Khem Raj
  1 sibling, 1 reply; 11+ messages in thread
From: Dave Chinner @ 2017-09-08 22:36 UTC (permalink / raw)
  To: Khem Raj; +Cc: linux-xfs

On Fri, Sep 08, 2017 at 11:24:16AM -0700, Khem Raj wrote:
> Hi Dave
> 
> 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....
> >
> >>
> >> 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 am building with --disable-static, I wonder if thats not a supported
> configuration
> for xfsprogs

For what reason?

xfsprogs links it's internal libraries statically while it links to
system libraries dynamically. We do not expose internal libraries
like libxfs and libxcmd outside the build environment, and so
dynamic linking of them doesn't make any sense because they won't be
installed on any system you ship the binaries to....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  2017-09-08 22:36     ` Dave Chinner
@ 2017-09-08 23:22       ` Khem Raj
  2017-09-09  0:33         ` Eric Sandeen
  0 siblings, 1 reply; 11+ messages in thread
From: Khem Raj @ 2017-09-08 23:22 UTC (permalink / raw)
  To: Dave Chinner; +Cc: linux-xfs

On Fri, Sep 8, 2017 at 3:36 PM, Dave Chinner <david@fromorbit.com> wrote:
> On Fri, Sep 08, 2017 at 11:24:16AM -0700, Khem Raj wrote:
>> Hi Dave
>>
>> 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....
>> >
>> >>
>> >> 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 am building with --disable-static, I wonder if thats not a supported
>> configuration
>> for xfsprogs
>
> For what reason?
>

this is the distro policy under which I am trying to compile. No other reason.

> xfsprogs links it's internal libraries statically while it links to
> system libraries dynamically. We do not expose internal libraries
> like libxfs and libxcmd outside the build environment, and so
> dynamic linking of them doesn't make any sense because they won't be
> installed on any system you ship the binaries to....
>

Thats what I needed to know. I will remove --disable-static and both patches
I sent I no more needed.


> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  2017-09-08 23:22       ` Khem Raj
@ 2017-09-09  0:33         ` Eric Sandeen
  2017-09-09  0:36           ` Khem Raj
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Sandeen @ 2017-09-09  0:33 UTC (permalink / raw)
  To: Khem Raj, Dave Chinner; +Cc: linux-xfs

On 9/8/17 6:22 PM, Khem Raj wrote:
> On Fri, Sep 8, 2017 at 3:36 PM, Dave Chinner <david@fromorbit.com> wrote:
>> On Fri, Sep 08, 2017 at 11:24:16AM -0700, Khem Raj wrote:
>>> Hi Dave
>>>
>>> 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....
>>>>
>>>>>
>>>>> 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 am building with --disable-static, I wonder if thats not a supported
>>> configuration
>>> for xfsprogs
>>
>> For what reason?
>>
> 
> this is the distro policy under which I am trying to compile. No other reason.

which distro has this policy?

There are certainly policies against static linking with /external/
libraries, because if libfoo has an exploit, you'd have to find
every static linker and fix it, rather than just libfoo.

But I can't imagine a policy that says a project cannot statically
link with its own /internal/ libraries which are never distributed
separately.

-Eric


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] spaceman: Add missing link to libuuid
  2017-09-09  0:33         ` Eric Sandeen
@ 2017-09-09  0:36           ` Khem Raj
  0 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2017-09-09  0:36 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Dave Chinner, linux-xfs

On Fri, Sep 8, 2017 at 5:33 PM, Eric Sandeen <sandeen@sandeen.net> wrote:
> On 9/8/17 6:22 PM, Khem Raj wrote:
>> On Fri, Sep 8, 2017 at 3:36 PM, Dave Chinner <david@fromorbit.com> wrote:
>>> On Fri, Sep 08, 2017 at 11:24:16AM -0700, Khem Raj wrote:
>>>> Hi Dave
>>>>
>>>> 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....
>>>>>
>>>>>>
>>>>>> 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 am building with --disable-static, I wonder if thats not a supported
>>>> configuration
>>>> for xfsprogs
>>>
>>> For what reason?
>>>
>>
>> this is the distro policy under which I am trying to compile. No other reason.
>
> which distro has this policy?

Custom distro based on yocto

>
> There are certainly policies against static linking with /external/
> libraries, because if libfoo has an exploit, you'd have to find
> every static linker and fix it, rather than just libfoo.
>
> But I can't imagine a policy that says a project cannot statically
> link with its own /internal/ libraries which are never distributed
> separately.
>

I think you are right, in this case we should just make --disable-static
to be no op or unsupported option in configure

> -Eric
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-09-09  0:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.