I'm not really sure, even after looking at it. We develop cross-platform, so we've always just used POSIX thread calls.
Actually, it just seems I can't link statically on this linux setup.
I just tried a simple "Hello World" linked as -static, and it won't work:
test.c :
#include <stdio.h>
int main (void)
{
printf("Hello World!\n");
return 1;
}
>$ gcc -o -static test test.c
test(.rodata+0x0): multiple definition of `_fp_hw'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crt1.o(.rodata+0x0): first defined here
test(.data+0x4): In function `__data_start':
: multiple definition of `__dso_handle'
/usr/lib/gcc/i386-redhat-linux/4.0.0/crtbegin.o(.data+0x0): first defined here
test(.init+0x0): In function `_init':
: multiple definition of `_init'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crti.o(.init+0x0): first defined here
test(.text+0x0): In function `_start':
: multiple definition of `_start'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crt1.o(.text+0x0): first defined here
test(.fini+0x0): In function `_fini':
: multiple definition of `_fini'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crti.o(.fini+0x0): first defined here
test(.got.plt+0x0): multiple definition of `_GLOBAL_OFFSET_TABLE_'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crt1.o(.got.plt+0x0): first defined here
test(.rodata+0x4): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crt1.o(.rodata+0x4): first defined here
test(.data+0x0): In function `__data_start':
: multiple definition of `__data_start'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crt1.o(.data+0x0): first defined here
/tmp/ccCnqNZp.o(.text+0x0): In function `main':
test.c: multiple definition of `main'
test(.text+0xa4): first defined here
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crt1.o(.dynamic+0x0): multiple definition of `_DYNAMIC'
test(.dynamic+0x0): first defined here
collect2: ld returned 1 exit status