RFA: --enable-oldest-abi is badly broken.

H. J. Lu hjl@lucon.org
Tue Aug 20 11:24:00 GMT 2002


On Tue, Aug 20, 2002 at 10:07:19AM -0700, H. J. Lu wrote:
> On Tue, Aug 20, 2002 at 08:02:00AM -0700, H. J. Lu wrote:
> > Please take a look at libc.map generated with --enable-oldest-abi=2.3.
> > It is totally broken. I am looking into it now.
> > 
> 
> It seems --enable-oldest-abi almost completely broken. I haven't
> figured a clean way to fix it. Ulrich, there are at least problems:
> 
> 1. Only GLIBC_2.3 appears in libc.map. Every symbol has version
> GLIBC_2.3.
> 2. GCC_3.0 and related versions/symbols are gone.
> 
> 

Here is my first attempt to fix it. It is incomplete.


H.J.
-------------- next part --------------
2002-08-20  H.J. Lu  <hjl@gnu.org>

	* scripts/versions.awk: Work around the oldest ABI bug.

	* scripts/abi-versions.awk: Never change VERSION_libx_xxx.

	* sysdeps/unix/make-syscalls.sh: Support the oldest ABI.

	* sysdeps/unix/sysv/linux/i386/syscalls.list: Add GLIBC_2.2 as
	the current ABI for getrlimit and setrlimit.

--- libc/scripts/abi-versions.awk.oldest	Fri Dec  1 15:12:34 2000
+++ libc/scripts/abi-versions.awk	Tue Aug 20 10:27:41 2002
@@ -29,7 +29,7 @@ $2 == "=" {
   oldid = $1; newid = $3;
 
   printf "#define ABI_%s_%s\tABI_%s_%s\n", libid, oldid, libid, newid;
-  printf "#define VERSION_%s_%s\t%s\n", libid, oldid, new;
+  printf "#define VERSION_%s_%s\t%s\n", libid, oldid, old;
   next;
 }
 
--- libc/scripts/versions.awk.oldest	Thu Feb  7 08:49:19 2002
+++ libc/scripts/versions.awk	Tue Aug 20 08:52:47 2002
@@ -46,8 +46,10 @@ BEGIN {
 
 # This matches the beginning of a new version for the current library.
 /^  [A-Za-z_]/ {
-  if (renamed[actlib "::" $1])
-    actver = renamed[actlib "::" $1];
+  if (renamed[actlib "::" $1]) {
+    firstver = renamed[actlib "::" $1];
+    actver = $1;
+  }
   else if (!versions[$1]) {
     printf("version %s not defined for %s\n", $1, actlib) > "/dev/stderr";
     exit 1;
--- libc/sysdeps/unix/make-syscalls.sh.oldest	Wed Aug  7 11:35:20 2002
+++ libc/sysdeps/unix/make-syscalls.sh	Tue Aug 20 10:40:41 2002
@@ -118,6 +118,23 @@ while read file srcfile caller syscall a
   echo "unix-syscalls += $file"
   test x$caller = x- || echo "unix-extra-syscalls += $file"
 
+  # Find the first verion and the version which obsoletes it. 
+  introduced=
+  obsoleted=
+  for name in $weak; do
+    name=`echo $name | sed 's/\./_/g'`
+    case $name in
+    *@@*)
+      ;;
+    *@*)
+      introduced=`echo $name | sed 's/.*@//'`
+      ;;
+    GLIBC_*)
+      obsoleted=$name
+      ;;
+    esac
+  done
+
   # Emit a compilation rule for this syscall.
   case $weak in
   *@*)
@@ -141,10 +158,17 @@ shared-only-routines += $file
   x*)
   echo "\
 	(echo '#include <sysdep.h>'; \\
+	 if test x != x"$introduced" && test x != x"$obsoleted"; then \\
+	   echo '#include <shlib-compat.h>'; \\
+	   echo '#if SHLIB_COMPAT (libc, $introduced, $obsoleted)'; \\
+	 fi; \\
 	 echo 'PSEUDO ($strong, $syscall, $nargs)'; \\
 	 echo '	ret'; \\
 	 echo 'PSEUDO_END($strong)'; \\
-	 echo 'libc_hidden_def ($strong)'; \\"
+	 echo 'libc_hidden_def ($strong)'; \\
+	 if test x != x"$introduced" && test x != x"$obsoleted"; then \\
+	   echo '#endif'; \\
+	 fi; \\"
   ;;
   esac
 
@@ -156,6 +180,8 @@ shared-only-routines += $file
 
   for name in $weak; do
     case $name in
+      GLIBC_*)
+	;;
       *@@*)
 	base=`echo $name | sed 's/@@.*//'`
 	ver=`echo $name | sed 's/.*@@//'`
--- libc/sysdeps/unix/sysv/linux/i386/syscalls.list.oldest	Tue Jun 13 00:26:57 2000
+++ libc/sysdeps/unix/sysv/linux/i386/syscalls.list	Tue Aug 20 09:20:10 2002
@@ -2,5 +2,5 @@
 
 modify_ldt	EXTRA	modify_ldt	i:ipi	__modify_ldt	modify_ldt
 vm86		-	vm86		i:p	__vm86		vm86
-oldgetrlimit	EXTRA	getrlimit	i:ip	__old_getrlimit	getrlimit@GLIBC_2.0
-oldsetrlimit	EXTRA	setrlimit	i:ip	__old_setrlimit	setrlimit@GLIBC_2.0
+oldgetrlimit	EXTRA	getrlimit	i:ip	__old_getrlimit	getrlimit@GLIBC_2.0 GLIBC_2.2
+oldsetrlimit	EXTRA	setrlimit	i:ip	__old_setrlimit setrlimit@GLIBC_2.0 GLIBC_2.2


More information about the Libc-alpha mailing list