[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#428741: linking shared libs on mips: -pthread doesn't imply pthread



Package: gcc-4.1

When linking shared libraries on mips, it turns out that gcc fails to
link a shared object when not being given "-lpthread" on the command
line. This occurs only on mips, and leads to funny FTBFS bugs as seen in 
http://buildd.debian.org/fetch.cgi?pkg=xine-lib;ver=1.1.6-2;arch=mips;stamp=1180615925,
wheras
http://buildd.debian.org/fetch.cgi?pkg=xine-lib;ver=1.1.6-2;arch=amd64;stamp=1180615604
is fine.

Thiemo Seufer and me managed to craft a patch against current gcc
upstream. Find that patch at:
http://gcc.gnu.org/ml/gcc-patches/2007-06/msg00914.html

It would be great if this longstanding bug could be backported to
debian's gcc.

Find attached a minimal testcase to verify the problem:

Attachment: Makefile
Description: Binary data

#include <pthread.h>

void *fakethread(void *arg) { return NULL; }
pthread_t fakevariable;

void foo()  {
  pthread_create(&fakevariable, NULL, &fakethread, NULL);
}
#ifndef LIBRARY

int main() {
foo();
}

#endif

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

Reply to: