glibc/sysdeps/unix/make-syscalls.sh
Ulrich Drepper ef030f7f43 Update.
1998-02-24 08:10  H.J. Lu  <hjl@gnu.org>

	* sysdeps/unix/sysv/linux/alpha/bits/signum.h (_NSIG): Changed
	to 64.

	* sysdeps/unix/alpha/sysdep.S (_errno): Add in addition to __errno.

	* sysdeps/alpha/s_fabs.S: Added ".set noat"/".set at".
	* sysdeps/unix/sysv/linux/alpha/wait4.S: Ditto.

	* sysdeps/unix/make-syscalls.sh: Make versioned symbols only
	for shared library.

	* libc.map (adjtime, __adjtimex, adjtimex): Added for GLIBC_2.1.

	* sysdeps/unix/sysv/linux/alpha/Makefile (sysdep_routines):
	Added adjtimex and old_adjtimex.

	* sysdeps/unix/sysv/linux/alpha/syscalls.list (old_adjtimex):
	New.
	(osf_settimeofday, osf_getitimer, osf_setitimer, osf_utimes,
	osf_getrusage, osf_wait4): Added __xxxx symbol for GLIBC_2.0.

	* sysdeps/unix/sysv/linux/alpha/getitimer.S: Make versioned
	symbols only for shared library.
	* sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/select.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise.

	* sysdeps/unix/sysv/linux/alpha/getitimer.S: Fix ENOSYS branch.
	* sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/select.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise.

	* sysdeps/unix/sysv/linux/alpha/wait4.S: Check the correct
	rusage pointer.

	* sysdeps/unix/sysv/linux/adjtime.c (TIMEVAL, TIMEX, ADJTIMEX):
	New macros.
	(__adjtime): Use TIMEVAL, TIMEX and ADJTIMEX instead of timeval,
	timex and __adjtimex, respectively.

	* sysdeps/unix/sysv/linux/alpha/adjtime.c: New.

	* sysdeps/unix/sysv/linux/alpha/adjtimex.S: New.
1998-02-26 17:17:05 +00:00

142 lines
3.6 KiB
Bash

#! /bin/sh
# Usage: make-syscalls.sh ../sysdeps/unix/common
# Expects $sysdirs in environment.
thisdir=$1; shift
# Get the list of system calls for this directory.
calls=`sed 's/#.*$//
/^[ ]*$/d' $thisdir/syscalls.list`
# Check each sysdep dir with higher priority than this one,
# and remove from $calls all the functions found in other dirs.
for dir in $sysdirs; do
# Punt when we reach the directory defining these syscalls.
test $dir = $thisdir && break
# Remove each syscall that is implemented by a file in $dir.
# If a syscall specified a "caller", then only compile that syscall
# if the caller function is also implemented in this directory.
calls=`echo "$calls" | while read file caller rest; do
test -f $dir/$file.c && continue
test -f $dir/$file.S && continue
test -f $dir/$file.s && continue
if test x$caller != x-; then
test -f $dir/$caller.c && continue
test -f $dir/$caller.S && continue
test -f $dir/$caller.s && continue
fi
echo $file $caller $rest
done`
done
# Any calls left?
test -n "$calls" || exit 0
files=
# Emit rules to compile the syscalls remaining in $calls.
echo "$calls" | while read file caller syscall nargs strong weak; do
# Figure out if $syscall is defined with a number in syscall.h.
$asm_CPP - << EOF | grep "^@@@ .*$syscall" >/dev/null && continue
#include <sysdep.h>
@@@ SYS_ify ($syscall)
EOF
case $weak in
*@*)
# The versioned symbols are only in the shared library.
echo "ifneq (,\$(filter .os,\$(object-suffixes)))"
;;
esac
# Make sure only the first syscall rule is used, if multiple dirs
# define the same syscall.
echo "ifeq (,\$(filter $file,\$(unix-syscalls)))"
# Accumulate the list of syscall files for this directory.
echo "unix-syscalls += $file"
test x$caller = x- || echo "unix-extra-syscalls += $file"
# Emit a compilation rule for this syscall.
case $weak in
*@*)
# The versioned symbols are only in the shared library.
echo "\
\$(objpfx)${file}.o: \$(common-objpfx)empty.o
rm -f \$@
ln \$< \$@
\$(objpfx)${file}.op: \$(common-objpfx)empty.op
rm -f \$@
ln \$< \$@
\$(objpfx)${file}.os: \\"
;;
*)
echo "\
\$(foreach o,\$(object-suffixes),\$(objpfx)$file\$o): \\"
;;
esac
echo "\$(common-objpfx)s-proto.d
(echo '#include <sysdep.h>'; \\
echo 'PSEUDO ($strong, $syscall, $nargs)'; \\
echo ' ret'; \\
echo 'PSEUDO_END($strong)'; \\"
# Append any weak aliases or versions defined for this syscall function.
# A shortcoming in the current gas is that it will only allow one
# version-alias per symbol. So we create new strong aliases as needed.
vcount=""
for name in $weak; do
case $name in
*@@*)
base=`echo $name | sed 's/@@.*//'`
ver=`echo $name | sed 's/.*@@//'`
if test -z "$vcount" ; then
source=$strong
vcount=1
else
source="${strong}_${vcount}"
vcount=`expr $vcount + 1`
echo " echo 'strong_alias ($strong, $source)'; \\"
fi
echo " echo 'default_symbol_version($source, $base, $ver)'; \\"
;;
*@*)
base=`echo $name | sed 's/@.*//'`
ver=`echo $name | sed 's/.*@//'`
if test -z "$vcount" ; then
source=$strong
vcount=1
else
source="${strong}_${vcount}"
vcount=`expr $vcount + 1`
echo " echo 'strong_alias ($strong, $source)'; \\"
fi
echo " echo 'symbol_version($source, $base, $ver)'; \\"
;;
*)
echo " echo 'weak_alias ($strong, $name)'; \\"
;;
esac
done
# And finally, pipe this all into the compiler.
echo ' ) | $(COMPILE.S) -x assembler-with-cpp -o $@ -'
echo endif
case $weak in
*@*)
# The versioned symbols are only in the shared library.
echo endif
;;
esac
done