From: Jakub Jelinek <jakub@redhat.com>
To: Roland McGrath <roland@redhat.com>, Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] bi-arch <bits/syscall.h> for ppc/s390
Date: Thu, 10 Oct 2002 07:22:00 -0000 [thread overview]
Message-ID: <20021010130447.X3451@sunsite.ms.mff.cuni.cz> (raw)
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
next reply other threads:[~2002-10-10 11:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-10 7:22 Jakub Jelinek [this message]
2002-10-16 3:12 ` Roland McGrath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021010130447.X3451@sunsite.ms.mff.cuni.cz \
--to=jakub@redhat.com \
--cc=drepper@redhat.com \
--cc=libc-hacker@sources.redhat.com \
--cc=roland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).