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

Re: Building package,



Luca Bruno wrote:

> On Thu, Oct 02, 2008 at 03:03:40PM -0500, =?ISO-8859-1?Q?El=EDas_A._M._ wrote:
>> Hi,
> 
> Hi I'm not a developer but I try to suggest you.
> 
>> Somebody  know why when I build the package, show me:
>> dpkg-shlibdeps: warning: debian/pack/usr/games/pack shouldn't be linked with
>> libpthread.so.0 (it uses none of its symbols).
>>
> 
> Your package is linking against libpthread and it might not be used. If your
> program uses it, then ignore the warning. If your program doesn't really use
> it, add --as-needed in the LDFLAGS in your debian/rules.

When (for some reason) -pthread is passed to gcc, the -Wl,--as-needed flag won't
unlink it (newlines added for clarity):

% gcc -o test test.c
% objdump -p test | grep NEEDED
  NEEDED      libc.so.6

% gcc -pthread -o test test.c
% objdump -p test | grep NEEDED
  NEEDED      libpthread.so.0
  NEEDED      libc.so.6

% gcc -lpthread -o test test.c
% objdump -p test | grep NEEDED
  NEEDED      libpthread.so.0
  NEEDED      libc.so.6

% gcc -Wl,--as-needed -lpthread -o test test.c
% objdump -p test | grep NEEDED
  NEEDED      libc.so.6

% gcc -Wl,--as-needed -pthread -o test test.c
% objdump -p test | grep NEEDED
  NEEDED      libpthread.so.0
  NEEDED      libc.so.6

%


-- 

  Felipe Sateler


Reply to: