problem compiling 64-bit application that uses posix threads
Hello,
I have some code that I compile and build on Linux IA32 and AMD64. It compiles and works with GCC 4.1.1, Intel 9.1. WIth Sun Studio Express 2 I can build it and test it on IA32 but when I try to compile on AMD64 I get this error:
suncc -xMMD -xO1 -fast -m64 -xc99=all -xCC -Xc -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include-Kpic -Delement_t=uint16_t -DELEMENT_MAX=UINT16_MAX -DELEMENT_MIN=0-c -o graph_metrics.o graph_metrics.c
"/usr/include/pthread.h", line 660: syntax error before or at: __attribute
"/usr/include/pthread.h", line 662: identifier redefined: __attribute
current : function() returning int
previous: function() returning int : "/usr/include/pthread.h", line 660
cc: acomp failed for graph_metrics.c
The IA32 box is using Ubuntu 6.10 and the AMD64 box is using Debian Testing/Unstable 4.0 .
The compilation flags for suncc are identical except "-m64".
The pthread.h relevant lines:
658 /* Internal interface to initiate cleanup. */
659 extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
660__cleanup_fct_attribute __attribute ((__noreturn__))
661 # ifndef SHARED
662__attribute ((__weak__))
663 # endif
664;
665 #endif
The version number is:
$ dpkg -S /usr/include/pthread.h
libc6-dev: /usr/include/pthread.h
$ dpkg -l libc6-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ NameVersionDescription
+++-==============-==============-============================================
ii libc6-dev2.3.6.ds1-8GNU C Library: Development Libraries and Hea

