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

Re: Debian PPC install



At 23:05 -0400 1998-04-27, Klee Dienes wrote:
>I'd be happy to do a build and test of dpkg for powerpc if that would
>help.  Can you point me to the version of libc I should be using?
>
>All of the packages in unstable use glibc-2.0.92, but so far I've had
>no luck getting glibc-2.0.92 to work on my MkLinux system.

Hmm... yes, I'm told it doesn't work on CHRP either.

Geoff Keating seems to have it working on MkLinux though.

Here is the message he sent me:

<<
Envelope-to: jk@cerberus.espy.org
Date: Fri, 3 Apr 1998 17:14:00 +1000 (EST)
From: Geoffrey KEATING <geoffk@discus.anu.edu.au>
To: Andreas Jaeger <aj@arthur.rhein-neckar.de>
CC: Joel Klecker <jk@cerberus.espy.org>,
        Geoffrey KEATING
	<geoffk@discus.anu.edu.au>
Subject: Re: PowerPC Problem
Mime-Version: 1.0 (generated by tm-edit 7.105)

> From: Andreas Jaeger <aj@arthur.rhein-neckar.de>

> From: Joel Klecker <jk@cerberus.espy.org>
> To: Andreas Jaeger <aj@arthur.rhein-neckar.de>
> Subject: Re: Debian/powerpc status report
> Date: Thu, 2 Apr 1998 11:55:35 -0800

> At 16:18 +0200 1998-04-02, Andreas Jaeger wrote:
> >Are you using the right tools and right snapshot?  Geoff told me that
> >"it works" on Linux/PowerPC with the version from March 20 or so.

I spoke just a little too soon on that; it works, except for when you
actually install it.  There are 2 lines of machine-dependent code that
behave differently in 'make check' to the installed version, and one
of of those has a stupid bug :-(.

[untested fix:

diff -u -r1.9 sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
--- sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c	1998/03/04 10:33:23	1.9
+++ sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c	1998/04/03 06:40:33
@@ -42,7 +42,7 @@
 	   vector will have to be laid out to allow for this	\
 	   test :-(.  */					\
 	if (((ElfW(auxv_t) *)_test)->a_type <= AT_PHDR)		\
-	  (auxp) = (ElfW(auxv_t) *) _tmp;			\
+	  (auxp) = (ElfW(auxv_t) *) _test;			\
       }								\
   } while (0)

]

However, this is not your problem; this only appears after you do
'make install'.

> I'm using egcs 1.0.2 and binutils 2.8.1.0.25.

Good!  I'm using a patched egcs 1.0.1, and I think 2.8.1.0.24 binutils.

> I'm trying the glibc-2.0.92 test release, it currently gets further than
> any of the recent snapshots do, but it seems to produce a libpthread that
> references a symbol the libc doesn't have.

> /debian/home/espy/glibc-2.0.92/build-dir/linuxthreads/libpthread.so:
> undefined reference to `testandset'

I see.

The long story behind this is that egcs has a bug, in which clobbering
certain registers in `asm' on PowerPC causes certain other operations
to become impossible.  For instance, if you clobber cr0, you can't use
(x & 123) for a register variable x and certain constants (including
123) in the same procedure, or gcc/egcs will crash.

This bug is inherent in the current implementation of gcc's reload
code, and is not easily fixable, and the only workaround I know is to
simply avoid either those clobbers, or using those operations.
linuxthreads hits this bug in condvar.c, because of inlining a procedure.

I thought I had a temporary fix, but it appears to cause other
problems.  Thus, at the moment the workaround I suggest is to prevent
inlining in condvar.c, as described in the FAQ.  But, in
linuxthreads/sysdeps/powerpc/pt-machine.h, the affected procedures are
defined as `extern inline'.  So if you use this workaround, you probably
need to:

diff -u -r1.1 linuxthreads/sysdeps/powerpc/pt-machine.h
--- linuxthreads/sysdeps/powerpc/pt-machine.h	1998/03/11 12:42:24	1.1
+++ linuxthreads/sysdeps/powerpc/pt-machine.h	1998/04/03 07:01:08
@@ -32,7 +32,7 @@
 #endif

 /* Spinlock implementation; required.  */
-extern inline int
+static inline int
 testandset (int *spinlock)
 {
   int ret;
@@ -63,7 +63,7 @@
 /* note that test-and-set(x) is the same as compare-and-swap(x, 0, 1) */

 #define HAS_COMPARE_AND_SWAP
-extern inline int
+static inline int
 __compare_and_swap (int *p, int oldval, int newval)
 {
   int ret;

I'm thinking of also deleting the 'inline' keyword, or perhaps making
it conditional on a test in configure, for the final release.

Note, though, that I haven't tested the linuxthread stuff at all,
because I think my MkLinux kernel doesn't support it (it didn't last
time I looked).  I'm very interested in reports on this.

--
Geoff Keating <Geoff.Keating@anu.edu.au>
>>

I also use an additional patch:

--- sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c.old	Thu Apr  9 20:14:06
1998
+++ sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c	Thu Apr  9 22:06:42 1998
@@ -27,10 +27,9 @@
     (argc) = *(long *) cookie;					\
     (argv) = (char **) cookie + 1;				\
     (envp) = (argv) + (argc) + 1;				\
-    for (_tmp = (envp); *_tmp; ++_tmp)				\
+    for (_tmp = (char **) (envp); *_tmp; ++_tmp)		\
       continue;						\
-    /* The following '++' is important!  */			\
-    ++_tmp;							\
+    (auxp) = (void *) ++_tmp;					\
     if (*_tmp == 0)						\
       {							\
 	size_t _test = (size_t)_tmp;				\

Also, be sure to use at least egcs 1.0.2 and binutils 2.8.1.0.24, and read
the FAQ included with the glibc snapshot.

--
Joel "Espy" Klecker    <mailto:jk@espy.org>    <http://web.espy.org/>
Debian GNU/Linux Developer...................<http://www.debian.org/>



--
To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: