Package: check
Version: 0.9.10-2
Severity: serious
Tags: patch

Hello,

libcheck_pic.a currently can't be linked in: 

$ cat test.c
extern void pack();
int main(void) {
        return pack;
}
$ gcc test.c -o test $(pkg-config --libs check)
test.c: In function 'main':
test.c:3:2: warning: return makes integer from pointer without a cast [enabled 
by default]
  return pack;
  ^
/usr/bin/ld: 
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libcheck_pic.a(check_pack.o):
 undefined reference to symbol '__pthread_unregister_cancel@@GLIBC_2.3.3'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from 
command line
collect2: error: ld returned 1 exit status


-lpthread is indeed missing from the PTHREAD_LIBS: buildd logs show:

checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes

This seems to get through because -fPIC is passed in CFLAGS: building in
a wheezy pbuilder gives me the following details:

configure:15481: gcc -o conftest -g -O2 -fPIC -Wall -ansi -pedantic -Wextra 
-Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wno-variadic-macros   
 conftest.c  -lrt -lm  >&5
conftest.c:86:1: warning: function declaration isn't a prototype 
[-Wstrict-prototypes]
conftest.c: In function 'main':
conftest.c:89:22: warning: null argument where non-null required (argument 1) 
[-Wnonnull]
conftest.c:90:22: warning: null argument where non-null required (argument 1) 
[-Wnonnull]
conftest.c:90:22: warning: null argument where non-null required (argument 3) 
[-Wnonnull]
conftest.c:88:27: warning: 'th' is used uninitialized in this function 
[-Wuninitialized]
configure:15481: $? = 0
configure:15490: result: yes

and thus the pthread_create unresolved symbol gets through! When I
rebuild the package myself in a sid pbuilder, I however properly get

checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes

and indeed, gcc now seems to refuse the unresolved symbol.

configure:15481: gcc -o conftest -g -O2 -fPIC -Wall -ansi -pedantic -Wextra 
-Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wno-variadic-macros   
 conftest.c  -lrt -lm  >&5
conftest.c:86:1: warning: function declaration isn't a prototype 
[-Wstrict-prototypes]
 main ()
 ^
conftest.c: In function 'main':
conftest.c:89:22: warning: null argument where non-null required (argument 1) 
[-Wnonnull]
                      pthread_attr_init(0); pthread_cleanup_push(0, 0);
                      ^
conftest.c:90:22: warning: null argument where non-null required (argument 1) 
[-Wnonnull]
                      pthread_create(0,0,0,0); pthread_cleanup_pop(0);
                      ^
conftest.c:90:22: warning: null argument where non-null required (argument 3) 
[-Wnonnull]
conftest.c:88:27: warning: 'th' is used uninitialized in this function 
[-Wuninitialized]
 pthread_t th; pthread_join(th, 0);
                           ^
/usr/bin/ld: /tmp/ccJMydQP.o: undefined reference to symbol 
'pthread_create@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from 
command line
collect2: error: ld returned 1 exit status

So it looks like rebuilding with the newer toolchain
would fix the issue, but you would probably want to pass
-Wl,--no-allow-shlib-undefined along -fPIC, to avoid the issue with any
version of gcc.

Samuel

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.9.0 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages check depends on:
ii  dpkg          1.16.10
ii  install-info  5.1.dfsg.1-3

check recommends no packages.

check suggests no packages.

-- no debconf information

-- 
Samuel
void packerFlushTheToiletFirstThingInTheMorning( void* arg )
 -+- chromium's source code -+-


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to