about summary refs log tree commit diff
path: root/sysdeps/unix/make-syscalls.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/make-syscalls.sh')
-rw-r--r--sysdeps/unix/make-syscalls.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index fbf96605e0..bbef3eb360 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -81,12 +81,9 @@ emit_weak_aliases()
 
   # We use the <shlib-compat.h> macros to generate the versioned aliases
   # so that the version sets can be mapped to the configuration's
-  # minimum version set as per shlib-versions DEFAULT lines.  But note
-  # we don't generate any "#if SHLIB_COMPAT (...)" conditionals.  To do
-  # that we'd need to change the syscalls.list format so that it can
-  # list the "obsoleted" version set too.  If it ever arises that we
-  # have a syscall entry point that is obsoleted by a newer version set,
-  # we'll have to revamp all this.
+  # minimum version set as per shlib-versions DEFAULT lines.  If an
+  # entry point is specified in the form NAME@VERSION:OBSOLETED, a
+  # SHLIB_COMPAT conditional is generated.
   if [ $any_versioned = t ]; then
     echo "	 echo '#include <shlib-compat.h>'; \\"
   fi
@@ -113,7 +110,17 @@ emit_weak_aliases()
       *@*)
 	base=`echo $name | sed 's/@.*//'`
 	ver=`echo $name | sed 's/.*@//;s/\./_/g'`
-	echo "	 echo '#if defined SHARED && IS_IN (libc)'; \\"
+	case $ver in
+	  *:*)
+	    compat_ver=${ver#*:}
+	    ver=${ver%%:*}
+	    compat_cond=" && SHLIB_COMPAT (libc, $ver, $compat_ver)"
+	    ;;
+	  *)
+	    compat_cond=
+	    ;;
+	esac
+	echo "	 echo '#if defined SHARED && IS_IN (libc)$compat_cond'; \\"
 	if test -z "$vcount" ; then
 	  source=$strong
 	  vcount=1