Subject: Enabling pthreads to use ll/sc instead of emulate_load_store_insn

From: Wayne Gowcher <[email-masked]>
Date: Thu, 7 Nov 2002 19:52:34 -0800 (PST)

Hi,

I have an userland application that uses pthreads and
crashes with a segmentaion due to an "unaligned access
in function 'emulate_load_store_insn' ". 

The processor is an r4k and the application is being
compiled with mips2 switch, which I thought would
allow it to generate the ll/sc instructions natively
and not have to generate system calls to emulate it.
I am guessing this is because the pthread library I
have is from the sgi ftp site and it was compiled for
mips1 ??

If someone has any insight into how to get libpthread
to use ll/sc instructions instead of the mips system
call I would really appreciate hearing from them.

Also if anyone can "put me straight" on what is
happening I'd equally appreciate it.

Wayne

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 8 Nov 2002 06:12:33 +0100

> call I would really appreciate hearing from them.

Rebuild it with -mips2.  The inline code in glibc is coded such that it'll
automatically use ll/sc then.

  Ralf

---

From: "H. J. Lu" <[email-masked]>
Date: Thu, 7 Nov 2002 21:17:59 -0800

> automatically use ll/sc then.

I believe I enabled ll/sc unconditinally in glibc. Make sure you use
a recent glibc. The one from my RedHat 7.3 port should be ok.

H.J.

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 8 Nov 2002 06:27:17 +0100

> a recent glibc. The one from my RedHat 7.3 port should be ok.

That's a relativly recent change.  Wayne's libc obviously predates this
change ...

  Ralf