Bug 1214494 - add -pthread to pkg-config
Summary: add -pthread to pkg-config
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pcre
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL: http://bugs.exim.org/show_bug.cgi?id=...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-22 20:48 UTC by Petr Lautrbach
Modified: 2015-05-12 20:38 UTC (History)
7 users (show)

Fixed In Version: pcre-8.33-10.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of: 1185266
: 1217111 (view as bug list)
Environment:
Last Closed: 2015-04-29 12:58:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Fix proposed the upstream (2.11 KB, patch)
2015-04-23 12:44 UTC, Petr Pisar
no flags Details | Diff
Upstream fix (1.61 KB, patch)
2015-04-24 05:56 UTC, Petr Pisar
no flags Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.