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]

[gccgo] Don't use <linux/user.h>


Newer kernel versions don't provide <linux/user.h>.  This patch
changes the libgo build to not try to use it, but to use
<sys/user.h>.  I was using <linux/user.h> because it gives more useful
values for cs, ds, etc., so this patch also changes the sed script to
get those back.

Ian


Index: mksysinfo.sh
===================================================================
--- mksysinfo.sh	(revision 154234)
+++ mksysinfo.sh	(working copy)
@@ -41,14 +41,10 @@ cat > sysinfo.c <<EOF
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/un.h>
+#include <sys/user.h>
 #include <unistd.h>
 EOF
 
-# FIXME: GNU/Linux specific.
-cat >>sysinfo.c <<EOF
-#include <linux/user.h>
-EOF
-
 ${CC} -D_GNU_SOURCE -ggo -S -o sysinfo.s sysinfo.c
 
 echo 'package syscall' > ${OUT}
@@ -196,7 +192,8 @@ regs=`grep '^#GO type _user_regs_struct 
 if test "$regs" != ""; then
   regs=`echo $regs | sed -e 's/type _user_regs_struct struct //'`
   regs=`echo $regs | sed -e 's/\([^a-zA-Z0-9_]*\)\([a-zA-Z0-9_]\)\([a-zA-Z0-9_]* [^;]*;\)/\1\U\2\E\3/g'`
-  regs=`echo $regs | sed -e 's/ __/ X__/'g`
+  # FIXME: x86 specific.
+  regs=`echo $regs | sed -e 's/X\([a-z]\)\([a-z]\) int32/ \U\1\E\2 uint16; X\1\2 uint16/g'`
   echo "type PtraceRegs struct $regs" >> ${OUT}
 fi
 

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