This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pc-linux-gnulibc1: ucontext not supported


I got an error when trying to build gcc-3.2 on a Linux
2.0.39/glibc1 system.  The attached patch fixes the problem.

=====
-- 
Craig Groeschel  >ladder91 at yahoo dot com<  AT '00
Tread lightly.  Leave no trace.  Never forget.

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Synopsis: GNU libc 1 and Linux 2.0 do not support struct ucontext.
gcc version: 3.2, native build
System: i586-pc-linux-gnulibc1, Linux 2.0.39
severity: breaks the build
priority: your call
Suggested fix: Don't include the nonexistent header file and don't define
the macro that wants struct ucontext.  (Kernel support was added sometime
between 2.0.39 and 2.2.22.  I assume library support was added in glibc2.
Hopefully it's sufficient to check the library version and not the kernel
version too.)

Build log showing the error:
make[3]: Entering directory `/home/src/gcc-3.2-objdir/gcc'
mkdir libgcc
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
./xgcc -B./ -B/usr/i586-pc-linux-gnulibc1/bin/ \
-isystem /usr/i586-pc-linux-gnulibc1/include \
-isystem /usr/i586-pc-linux-gnulibc1/sys-include \
-O2  -DIN_GCC   -DUSE_GNULIBC_1 \
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-isystem ./include  -fPIC -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
-I. -I. -I../../gcc-3.2/gcc -I../../gcc-3.2/gcc/. \
-I../../gcc-3.2/gcc/config -I../../gcc-3.2/gcc/../include \
-DL_muldi3 -c ../../gcc-3.2/gcc/libgcc2.c -o libgcc/./_muldi3.o
In file included from tconfig.h:21,
                 from ../../gcc-3.2/gcc/libgcc2.c:36:
../../gcc-3.2/gcc/config/i386/linux.h:225:26: sys/ucontext.h: No such file or directory

See also: gcc-help message from 19 Jun 2001 "gcc-3.0 compiling problem..."
by schaecsn at gmx dot de.

Suggested patch:

gcc/ChangeLog:
2002-11-21  Craig Groeschel  <ladder91@yahoo.com>
config/i386/linux.h [USE_GNULIBC_1]: Do not try to include <sys/ucontext.h>
and do not define MD_FALLBACK_FRAME_STATE_FOR.

--- gcc/config/i386/linux.h.orig	Thu Nov 21 13:40:39 2002
+++ gcc/config/i386/linux.h	Thu Nov 21 12:24:00 2002
@@ -222,9 +222,12 @@ Boston, MA 02111-1307, USA.  */
 
 #ifdef IN_LIBGCC2
 #include <signal.h>
+#ifndef USE_GNULIBC_1
 #include <sys/ucontext.h>
 #endif
+#endif
 
+#ifndef USE_GNULIBC_1
 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS)		\
   do {									\
     unsigned char *pc_ = (CONTEXT)->ra;					\
@@ -278,3 +281,4 @@ Boston, MA 02111-1307, USA.  */
     (FS)->retaddr_column = 8;						\
     goto SUCCESS;							\
   } while (0)
+#endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]