Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh/pcre module breakage when static build enabled



>     % grep HAVE_PCRE_ config.h
>     #define HAVE_PCRE_COMPILE 1
>     #define HAVE_PCRE_EXEC 1
>     #define HAVE_PCRE_H 1
>     #define HAVE_PCRE_STUDY 1
> 

Sorry for delay, I had some troubles offline...

So, here is where our output differs. I've the following here:

> #define HAVE_PCRE_COMPILE 1
> /* #undef HAVE_PCRE_EXEC */
> #define HAVE_PCRE_H 1
> /* #undef HAVE_PCRE_STUDY */

Although, `pcre-config` works fine:

> % pcre-config --version
> 8.42

So, I looked in config.log and found following:
> configure:8361: checking for pcre_study
> configure:8361: gcc -o conftest  -Wall -Wmissing-prototypes -O2 -I/usr/
include  -L/usr/lib64 -static conftest.c -lgdbm -L/usr/lib64 -lpcre -ltinfow -
lrt -lm  -lc >&5
> /usr/lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function 
`sljit_free_exec':
> pcre_jit_compile.c:(.text+0x190c): undefined reference to 
`pthread_mutex_lock'
> /usr/lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function 
`pcre_jit_free_unused_memory':
> pcre_jit_compile.c:(.text+0x23359): undefined reference to 
`pthread_mutex_lock'
> /usr/lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function 
`sljit_free_exec':
> pcre_jit_compile.c:(.text+0x1974): undefined reference to 
`pthread_mutex_unlock'
> /usr/lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function 
`pcre_jit_free_unused_memory':
> pcre_jit_compile.c:(.text+0x233c9): undefined reference to 
`pthread_mutex_unlock'
> /usr/lib64/libpcre.a(libpcre_la-pcre_jit_compile.o): In function 
`sljit_generate_code':
> pcre_jit_compile.c:(.text.unlikely+0x1eb): undefined reference to 
`pthread_mutex_lock'
> pcre_jit_compile.c:(.text.unlikely+0x287): undefined reference to 
`pthread_mutex_unlock'
> pcre_jit_compile.c:(.text.unlikely+0x2d9): undefined reference to 
`pthread_mutex_unlock'
> pcre_jit_compile.c:(.text.unlikely+0x36f): undefined reference to 
`pthread_mutex_unlock'
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In 
function `__gthread_mutex_lock':
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:748: undefined reference to `pthread_mutex_lock'
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:748: undefined reference to `pthread_mutex_lock'
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:748: undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In 
function `__gthread_mutex_unlock':
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock'
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In 
function `__gthread_mutex_lock':
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:748: undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In 
function `__gthread_mutex_unlock':
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock'
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock'
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock'
> /var/tmp/portage/sys-devel/gcc-7.3.0-r1/work/build/x86_64-pc-linux-gnu/
libgcc/./gthr-default.h:778: undefined reference to `pthread_mutex_unlock'
> collect2: error: ld returned 1 exit status


Although, I already tried to add `-lpthread` to LDFLAGS, but it didn't fixed 
that error :'(
And also, shared version of libpcre is linked to pthread, so I guess, static 
version should be as well. Isn't it?

Attachment: signature.asc
Description: This is a digitally signed message part.



Messages sorted by: Reverse Date, Date, Thread, Author