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.sh35
1 files changed, 32 insertions, 3 deletions
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index e9d0f508b4..c7ddb88999 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -47,6 +47,13 @@ echo "$calls" | while read file caller syscall nargs strong weak; do
 @@@ 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)))"
@@ -56,9 +63,24 @@ EOF
   test x$caller = x- || echo "unix-extra-syscalls += $file"
 
   # Emit a compilation rule for this syscall.
-  echo "\
-\$(foreach o,\$(object-suffixes),\$(objpfx)$file\$o): \\
-\$(common-objpfx)s-proto.d
+  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'; \\
@@ -109,4 +131,11 @@ EOF
 
   echo endif
 
+  case $weak in
+  *@*)
+    # The versioned symbols are only in the shared library.
+    echo endif
+    ;;
+  esac
+
 done