Bug 1214494

Summary: add -pthread to pkg-config
Product: [Fedora] Fedora Reporter: Petr Lautrbach <plautrba>
Component: pcreAssignee: Petr Pisar <ppisar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 20CC: c.david86, extras-qa, kzak, lkundrak, mgrepl, plautrba, ppisar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://bugs.exim.org/show_bug.cgi?id=1620
Whiteboard:
Fixed In Version: pcre-8.33-10.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1185266
: 1217111 (view as bug list) Environment:
Last Closed: 2015-04-29 12:58:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix proposed the upstream
none
Upstream fix none

Description Petr Lautrbach 2015-04-22 20:48:11 UTC
+++ This bug was initially created as a clone of Bug #1185266 +++

pcre.pc is incomplete and static builds against pcre are broken

Actual results:

$ pkg-config --static --libs libpcre
-lpcre

$ cat test_pcre.c 
#include <pcre.h>

int main() {
        pcre_jit_free_unused_memory();
        return 0;
}

$ gcc -static test_pcre.c `pkg-config --static --libs libpcre`               
/usr/lib/gcc/x86_64-redhat-linux/5.0.1/../../../../lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `sljit_generate_code':
(.text+0x6b1): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/5.0.1/../../../../lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `sljit_generate_code':
(.text+0x7a6): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/5.0.1/../../../../lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `sljit_generate_code':
(.text+0xb31): undefined reference to `pthread_mutex_unlock'
...


Expected results:

$ pkg-config --static --libs libpcre
-lpcre -pthread 

$ gcc -static test_pcre.c `pkg-config --static --libs libpcre`

$

Comment 1 Petr Pisar 2015-04-23 12:44:02 UTC
Created attachment 1017949 [details]
Fix proposed the upstream

This patch fixes it.

The `-static' gcc patch forces searching for static libpthread library which is provided by glibc-static. I could add glibc-static to run-time dependencies of pcre-static, however it's not really necessary because one can link against /usr/lib64/libpcre.a directly without the -static option (and pkg-config), and then the glibc-static package is not needed. Also with -static, one needs static libc because of the main program entry point. So the dependency can bee seen as a dependency of the compiled program, not pcre-static. I'm not sure about the dependency.

Comment 2 Petr Pisar 2015-04-23 14:24:24 UTC
All Fedoras are affected.

Comment 3 Petr Pisar 2015-04-24 05:56:27 UTC
Created attachment 1018309 [details]
Upstream fix

Patch accepted.

Comment 4 Fedora Update System 2015-04-24 06:52:12 UTC
pcre-8.36-6.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/pcre-8.36-6.fc22

Comment 5 Fedora Update System 2015-04-24 06:53:42 UTC
pcre-8.35-10.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/pcre-8.35-10.fc21

Comment 6 Fedora Update System 2015-04-24 07:14:23 UTC
pcre-8.33-10.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/pcre-8.33-10.fc20

Comment 7 Fedora Update System 2015-04-26 12:48:18 UTC
Package pcre-8.36-6.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing pcre-8.36-6.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-6875/pcre-8.36-6.fc22
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2015-04-29 12:58:50 UTC
pcre-8.36-6.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2015-05-12 20:35:30 UTC
pcre-8.35-10.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2015-05-12 20:38:23 UTC
pcre-8.33-10.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.