Red Hat Bugzilla – Bug 80408
glibc header is slightly broken: parse error before "__threadid"
Last modified: 2016-11-24 10:12:46 EST
Description of problem:
/usr/include/bits/sigthread.h is a little broken. This prevents a lot of
applications from building on Phoebe.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Build an app (xmms/mplayer are good examples)
2. Watch it die.
parse error before "__threadid"
Successful build of application.
Attaching patch that will resolve the issue.
Created attachment 88911 [details]
fix for sigthread compilation issue
Can you write the sequence of includes which trigger that?
There haven't been many changes in sigthread.h for a long time (last was
just renaming the first argument of pthread_kill from __thread to __threadid).
In glibc-2.3.1-21 <bits/sigthread.h> seems to be included only from signal.h:
# include <bits/pthreadtypes.h>
# include <bits/sigthread.h>
So I'd really like to know what's going on.
make: Entering directory `/usr/src/redhat/BUILD/xmms-1.2.7/Input/mpg123'
/bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../..
-I../../xmms -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2
-I/usr/lib/glib/include -D_REENTRANT -I/usr/X11R6/include -DI386_ASSEM
-I../../intl -O2 -g -march=i386 -mcpu=i686 -Wall -Wpointer-arith
-finline-functions -ffast-math -funroll-all-loops -c mpg123.c
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../xmms -I/usr/include/gtk-1.2
-I/usr/include/glib-1.2 -I/usr/lib/glib/include -D_REENTRANT
-I/usr/X11R6/include -DI386_ASSEM -I../../intl -O2 -g -march=i386 -mcpu=i686
-Wall -Wpointer-arith -finline-functions -ffast-math -funroll-all-loops
-Wp,-MD,.deps/mpg123.pp -c mpg123.c -fPIC -DPIC -o mpg123.lo
In file included from /usr/local/include/signal.h:364,
/usr/include/bits/sigthread.h:36: parse error before "__threadid"
make: *** [mpg123.lo] Error 1
I'm also going to attach the mpg123.c file
Created attachment 88927 [details]
c file that triggers glibc error
Created attachment 88928 [details]
mpg123.c from xmms 1.2.7 (CORRECT FILE)
It would help if I could upload the proper file.
Created attachment 88930 [details]
corresponding .h for mpg123.c (from xmms source tree)
This file is correct. I can attach a full SRPM if needed.
In file included from /usr/local/include/signal.h:364
I think this is the culprit. Where does it come from? It is certainly not part
of the distro.
Agreed. I don't know where that file came from, but its definitely the culprit.
diff -u /usr/local/include/signal.h /usr/include/signal.h
--- /usr/local/include/signal.h 2002-09-05 18:51:25.000000000 -0400
+++ /usr/include/signal.h 2002-12-19 05:36:23.000000000 -0500
@@ -361,6 +361,7 @@
#if defined __USE_POSIX199506 || defined __USE_UNIX98
/* Some of the functions for handling signals in threaded programs must
be defined here. */
+# include <bits/pthreadtypes.h>
# include <bits/sigthread.h>
#endif /* use Unix98 */