[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Avoiding linking with /home/packaging/X/libxx.so



On Fri, Jun 12, 2015 at 08:11:14AM +0000, lumin wrote:
> And I'd like to package it as following:
> 
>         package: hello
>           depends: libsharedlib1
>         package: libsharedlib1
>           NOTE: libsharedlib1 has no SONAME
If it has no SONAME then this won't work. Shared libraries should have
SONAMEs (also, where that 1 does come from then?).
>         package: libsharedlib-dev

> Let's assume ./src/Makefile is:
> 
>         $ cat Makefile.bak 
>         main: hello
>         
>         hello.o: hello.c
>         	$(CC) -g -c -Wall hello.c
>         hello: hello.o
>         	$(CC) -g -o hello hello.o ../lib/libsharedlib.so <--NOTICE
>         clean:
>         	-rm hello *.o
>         
> I got stuck here:
> 
>         $ ldd hello
> 	[...]
> 	../lib/libsharedlib.so (0x00007f400a08e000) <--NOTICE
Is this a problem? ldd resolves paths at the run time.

> However I'm going to install hello to /usr/bin, libsharedlib.so to
> /usr/lib/libsharedlib.so.X
> So the generated hello is not installable.
If it has rpath set then you should fix that. Otherwise it's not clear if
the problem really exists as your example is artificial and doesn't show
real things.

> The question is, how to get hello linked to /usr/lib/libsharedlib.so,
> since in fact that lib is located at $(CUDIR)/../lib/libsharedlib.so?
There is no such thing. SONAMEs, not paths, are added to DT_NEEDED. If you
mean rpath that's another question and it depends on your build system,
among other things.

-- 
WBR, wRAR

Attachment: signature.asc
Description: Digital signature


Reply to: