Port-mips archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkgsrc build error for g95
> >> mips1 doesn't support the ll/sc instructions.
> >>
> >> I would switch it to use the libc mutex stubs.
> >
> > I'm not what you would call a developer...
> >
> > Can you give me a hint about how to do this?
>
> This still isn't resolved and this information isn't enough for me to
> research it on my own. Can you give me something I can use to try to
> figure this out?
>
> I've been going through the work directory for g95 trying to figure
> out what you're talking about but I can't find anything.
- modern threading applications require locking primitives
(mutex, rwlock etc)
- most applications implements their own locking primitives
- locking primitive requires CPU specific "atomic" instructions
especially for SMP
- on MIPS, ll/sc instruction is required for SMP locking primitives
- only MIPS3 CPUs have ll/sc and MIPS1 CPUs don't have it
because MIPS1 CPUs are not SMP capable
- most applications don't care almost obsolete MIPS1 machines
- NetBSD still supports MIPS1 and -march=mips1 is default on gcc,
so it complains ll/sc instruction is not supported by MIPS1
workaround:
- use -march=mips3 -mabi=32 in CFLAGS (or CPUFLAGS etc)
so gcc/gas accepts ll/sc
(but generated binaries won't run on MIPS1 machines)
real fix:
- NetBSD has common APIs atomic_ops(3) for the primitives in libc
and all third party applications _should_ use them so that
they won't have to have own CPU specific implementations
pulseaudio (pkgsrc/audio/pulseaudio) supports NetBSD's atomic_ops(3)
so its implementation (pulseaudio-0.x.y/src/pulsecore/atomic.h) might help.
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index