RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Segfault because librpmio is missing -lpcre

From: Arkadiusz Miskiewicz <arekm@pld-linux.org>
Date: Thu 01 Nov 2007 - 14:15:48 CET
Message-Id: <200711011415.48589.arekm@pld-linux.org>
On Thursday 01 of November 2007, Jeff Johnson wrote:
> There's a segfault reported last week by arekm when rpm is compiled
> to use PCRE because of a missing linkage from rpmmire in librpmio
> to -lpcre.
>
> No idea whether miscompiled or actually missing.
>
> Could someone take a look please?

-Wl,-as-needed is too smart here

[arekm@tarm ~]$ gcc test.c -lpcre
[arekm@tarm ~]$ objdump -p a.out | grep NEEDE
  NEEDED      libpcre.so.0
  NEEDED      libc.so.6
[arekm@tarm ~]$ gcc test.c -Wl,-as-needed -lpcre
[arekm@tarm ~]$ objdump -p a.out | grep NEEDE
  NEEDED      libc.so.6
[arekm@tarm ~]$     

but the problem is more generic one.

If a program is linked to 2 or more libraries that provide exactly the same 
symbol (function) - from which library symbol is going to be used? randomly? 

Where it's said that pcre regcomp() will be used and not glibc one if progam 
is linked to both glibc and pcre?

> 73 de Jeff

-- 
Arkadiusz Mi¶kiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/
Received on Thu Nov 1 14:16:01 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.