[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

glibc-2.1.95 and (l)chown


while playing with glibc-2.1.95, I came across the following problem:
Debian's glibc-2.1.3 defines chown and lchown as versioned symbols (at
version GLIBC_2.1) on m68k, while upstream uses weak aliases. This means
of course, that programs linked against the old glibc won't work with
glibc-2.1.95 as it is. Now we could of course add a patch to turn the weak
aliases into versioned symbols again, but this would leave us forever with
this senseless incompatibility. Anyway, I have now come up with the

diff -urN glibc-2.1.95.orig/sysdeps/unix/sysv/linux/m68k/chown.c glibc-2.1.95/sysdeps/unix/sysv/linux/m68k/chown.c
--- glibc-2.1.95.orig/sysdeps/unix/sysv/linux/m68k/chown.c	Fri Sep  1 05:58:10 2000
+++ glibc-2.1.95/sysdeps/unix/sysv/linux/m68k/chown.c	Sat Oct 14 14:58:38 2000
@@ -72,3 +72,8 @@
 weak_alias (__chown, chown)
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+compat_symbol (libc, __chown, chown, GLIBC_2_1);
diff -urN glibc-2.1.95.orig/sysdeps/unix/sysv/linux/m68k.orig/lchown.c glibc-2.1.95/sysdeps/unix/sysv/linux/m68k/lchown.c
--- glibc-2.1.95.orig/sysdeps/unix/sysv/linux/m68k/lchown.c	Mon Jan 17 06:20:35 2000
+++ glibc-2.1.95/sysdeps/unix/sysv/linux/m68k/lchown.c	Sat Oct 14 14:59:05 2000
@@ -1 +1,6 @@
 #include <sysdeps/unix/sysv/linux/i386/lchown.c>
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+compat_symbol (libc, __lchown, lchown, GLIBC_2_1);

This is of course an evil hack, but it would give us both compatibility
with old programs (which require (l)chown@GLIBC_2.1) and also restore
binary compatibility with upstream glibc (because newly linked programs now
only require (l)chown@GLIBC_2.0).

Unless someone comes up with a better solution, I'll file a bug against
glibc asking to include this patch (and to update to the latest CVS; or
alternatively to wait for 2.1.96 and then add the patch).


Reply to: