public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] bi-arch <bits/syscall.h> for ppc/s390
@ 2002-10-10  7:22 Jakub Jelinek
  2002-10-16  3:12 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2002-10-10  7:22 UTC (permalink / raw)
  To: Roland McGrath, Ulrich Drepper; +Cc: Glibc hackers

Hi!

I noticed s390 and ppc don't generate bi-arch bits/syscall.h like
x86-64 and sparc already do.

2002-10-10  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/powerpc/Makefile: Generate bits/syscall.h
	with biarch support.
	* sysdeps/unix/sysv/linux/s390/Makefile: New file.
	* sysdeps/unix/sysv/linux/sparc/Makefile (syscall-%.h): Run comm
	in C locale.
	* sysdeps/unix/sysv/linux/x86_64/Makefile (syscall-%.h): Likewise.

--- libc/sysdeps/unix/sysv/linux/s390/Makefile.jj	2002-10-10 12:34:57.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/s390/Makefile	2002-10-10 12:40:00.000000000 +0200
@@ -0,0 +1,43 @@
+ifeq ($(subdir),misc)
+no_syscall_list_h = 1
+
+# Generate the list of SYS_* macros for the system calls (__NR_* macros).
+$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
+	rm -f $(@:.h=.d)-t
+	{ \
+	 echo '/* Generated at libc build time from kernel syscall list.  */';\
+	 echo ''; \
+	 echo '#ifndef _SYSCALL_H'; \
+	 echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
+	 echo '#endif'; \
+	 echo ''; \
+	 SUNPRO_DEPENDENCIES='$(@:.h=.d)-t $@' \
+	 $(CC) -E -x c $(sysincludes) $< -U__s390x__ -D_LIBC -dM | \
+	 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
+	 LC_ALL=C sort > $(@:.d=.h).new32; \
+	 SUNPRO_DEPENDENCIES='$(@:.h=.d)-t $@' \
+	 $(CC) -E -x c $(sysincludes) $< -D__s390x__ -D_LIBC -dM | \
+	 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
+	 LC_ALL=C sort > $(@:.d=.h).new64; \
+	 if cmp -s $(@:.d=.h).new32 $(@:.d=.h).new64; then \
+	   cat $(@:.d=.h).new32; \
+	 else \
+	   echo '#include <bits/wordsize.h>'; \
+	   echo ''; \
+	   LC_ALL=C comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   echo '#if __WORDSIZE == 64'; \
+	   LC_ALL=C comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   echo '#else'; \
+	   LC_ALL=C comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   echo '#endif'; \
+	 fi; \
+	 rm -f $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	} > $(@:.d=.h).new
+	mv -f $(@:.d=.h).new $(@:.d=.h)
+	sed < $(@:.h=.d)-t > $(@:.h=.d)-t2 \
+	    -e 's,$(subst .,\.,$@),$(patsubst $(objpfx)%,$$(objpfx)%,\
+					      $(@:.d=.h) $(@:.h=.d)),'
+	rm -f $(@:.h=.d)-t
+	mv -f $(@:.h=.d)-t2 $(@:.h=.d)
+
+endif
--- libc/sysdeps/unix/sysv/linux/powerpc/Makefile.jj	2002-09-05 12:29:54.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/powerpc/Makefile	2002-10-10 12:41:28.000000000 +0200
@@ -2,3 +2,47 @@ ifeq ($(subdir),signal)
 sysdep_routines += rt_sigsuspend rt_sigprocmask rt_sigtimedwait	\
 		   rt_sigqueueinfo rt_sigaction rt_sigpending
 endif
+
+ifeq ($(subdir),misc)
+no_syscall_list_h = 1
+
+# Generate the list of SYS_* macros for the system calls (__NR_* macros).
+$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
+	rm -f $(@:.h=.d)-t
+	{ \
+	 echo '/* Generated at libc build time from kernel syscall list.  */';\
+	 echo ''; \
+	 echo '#ifndef _SYSCALL_H'; \
+	 echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
+	 echo '#endif'; \
+	 echo ''; \
+	 SUNPRO_DEPENDENCIES='$(@:.h=.d)-t $@' \
+	 $(CC) -E -x c $(sysincludes) $< -U__powerpc64__ -D_LIBC -dM | \
+	 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
+	 LC_ALL=C sort > $(@:.d=.h).new32; \
+	 SUNPRO_DEPENDENCIES='$(@:.h=.d)-t $@' \
+	 $(CC) -E -x c $(sysincludes) $< -D__powerpc64__ -D_LIBC -dM | \
+	 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
+	 LC_ALL=C sort > $(@:.d=.h).new64; \
+	 if cmp -s $(@:.d=.h).new32 $(@:.d=.h).new64; then \
+	   cat $(@:.d=.h).new32; \
+	 else \
+	   echo '#include <bits/wordsize.h>'; \
+	   echo ''; \
+	   LC_ALL=C comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   echo '#if __WORDSIZE == 64'; \
+	   LC_ALL=C comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   echo '#else'; \
+	   LC_ALL=C comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   echo '#endif'; \
+	 fi; \
+	 rm -f $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	} > $(@:.d=.h).new
+	mv -f $(@:.d=.h).new $(@:.d=.h)
+	sed < $(@:.h=.d)-t > $(@:.h=.d)-t2 \
+	    -e 's,$(subst .,\.,$@),$(patsubst $(objpfx)%,$$(objpfx)%,\
+					      $(@:.d=.h) $(@:.h=.d)),'
+	rm -f $(@:.h=.d)-t
+	mv -f $(@:.h=.d)-t2 $(@:.h=.d)
+
+endif
--- libc/sysdeps/unix/sysv/linux/sparc/Makefile.jj	2002-04-07 17:46:25.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/sparc/Makefile	2002-10-10 13:10:53.000000000 +0200
@@ -25,11 +25,11 @@ $(objpfx)syscall-%.h $(objpfx)syscall-%.
 	 else \
 	   echo '#include <bits/wordsize.h>'; \
 	   echo ''; \
-	   comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   LC_ALL=C comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
 	   echo '#if __WORDSIZE == 64'; \
-	   comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   LC_ALL=C comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
 	   echo '#else'; \
-	   comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   LC_ALL=C comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
 	   echo '#endif'; \
 	 fi; \
 	 rm -f $(@:.d=.h).new32 $(@:.d=.h).new64; \
--- libc/sysdeps/unix/sysv/linux/x86_64/Makefile.jj	2002-09-01 09:34:48.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/x86_64/Makefile	2002-10-10 13:10:31.000000000 +0200
@@ -27,11 +27,11 @@ $(objpfx)syscall-%.h $(objpfx)syscall-%.
 	 else \
 	   echo '#include <bits/wordsize.h>'; \
 	   echo ''; \
-	   comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   LC_ALL=C comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
 	   echo '#if __WORDSIZE == 64'; \
-	   comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   LC_ALL=C comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
 	   echo '#else'; \
-	   comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+	   LC_ALL=C comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
 	   echo '#endif'; \
 	 fi; \
 	 rm -f $(@:.d=.h).new32 $(@:.d=.h).new64; \

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] bi-arch <bits/syscall.h> for ppc/s390
  2002-10-10  7:22 [PATCH] bi-arch <bits/syscall.h> for ppc/s390 Jakub Jelinek
@ 2002-10-16  3:12 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2002-10-16  3:12 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Ulrich Drepper, Glibc hackers

I consolidated the code for all the platforms that use it, and included
your changes.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-16  3:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-10  7:22 [PATCH] bi-arch <bits/syscall.h> for ppc/s390 Jakub Jelinek
2002-10-16  3:12 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).