Description of problem: When trying to build a package in Fedora's koji, I am observing this: ... libtool: compile: g++ -DLOCALEDIR=\"/usr/share/locale\" -DTEST_PERFORMANCE -DPOKER_EXPORT= -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/python2.6 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I../.. -I../../include -I../../examples/poker -I/usr/include/libxml2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DCAL3D_VERSION=11 -DOSGAL_VERSION=0X000600 -I/usr/include/poker-eval -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -MT libpoker_la-PokerCard.lo -MD -MP -MF .deps/libpoker_la-PokerCard.Tpo -c PokerCard.cpp -fPIC -DPIC -o .libs/libpoker_la-PokerCard.o In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr.h:165, from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/ext/atomicity.h:39, from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/bits/basic_string.h:46, from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/string:58, from /usr/include/osg/Object:21, from /usr/include/osg/BufferObject:18, from /usr/include/osg/Array:33, from ../../include/maf/utils.h:36, from PokerCard.cpp:42: /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h: In function 'int __gthread_create(__gthread_t*, void* (*)(void*), void*)': /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:681: error: expected primary-expression before ',' token /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h: In function 'int __gthread_join(__gthread_t, void**)': /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:687: error: expected primary-expression before ',' token /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h: In function 'int __gthread_detach(__gthread_t)': /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:129: error: too few arguments to function 'int __gthrw_pthread_detach(pthread_t)' /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:693: error: at this point in file For full logs, c.f. (dist-f11-gcc44) http://koji.fedoraproject.org/koji/taskinfo?taskID=1128145 rsp. (dist-f11) http://koji.fedoraproject.org/koji/taskinfo?taskID=1128060 As this error doesn't contain any referrence to the package's source code, but only references to libstdc++, I am inclined to think this to be a bug in libstdc++ (gthr-support?). Version-Release number of selected component (if applicable): gcc-4.4.0-0.16 rsp. gcc-4.4.0-0.18 I don't have a current rawhide system, but if my assumption holds, this bug should be reproducable by compiling a c++-source file containing #include <string> alone.
This bug is caused by gcc/g++ using unsafe symbols in its gthr-* headers. In this particular case, an application's define overrides symbols from gthr*. The bug can easily be reproduced by compiling this code fragment: # cat foo.cc #define thread #include <string> # g++ -Wall -o foo foo.cc In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr.h:165, from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/ext/atomicity.h:39, from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/bits/basic_string.h:46, from /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/string:58, from foo.cc:2: /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h: In function ‘int __gthread_create(__gthread_t*, void* (*)(void*), void*)’: /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:681: error: expected primary-expression before ‘,’ token /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h: In function ‘int __gthread_join(__gthread_t, void**)’: /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:687: error: expected primary-expression before ‘,’ token /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h: In function ‘int __gthread_detach(__gthread_t)’: /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:129: error: too few arguments to function ‘int __gthrw_pthread_detach(pthread_t)’ /usr/lib/gcc/x86_64-redhat-linux/4.4.0/../../../../include/c++/4.4.0/x86_64-redhat-linux/bits/gthr-default.h:693: error: at this point in file
That testcase is invalid, see [lib.using.headers]/3: "A translation unit shall include a header only outside of any external declaration or definition, and shall include the header lexically before the first reference to any of the entities it declares or first defines in that translation unit." That said, I'll uglify the function arguments in gthr*.h soon.
(In reply to comment #2) > That testcase is invalid, see [lib.using.headers]/3: > "A translation unit shall include a header only outside of any external > declaration or definition, and shall include the header lexically before the > first reference to any of the entities it declares or first defines in that > translation unit." Errm, ... a card blanche to justify any symbol clash with libstdc++? "In case of symbol clashes libstdc++ is always right"? Pardon, but this looks like a serious defect of the standards to me.
See http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00716.html Note also the list of other headers that have non-uglified function parameters or or inline fn local variables.