Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 20 Jul 2014 09:18:33 +0300
From: Stefan Kristiansson <>
To: Rich Felker <>
Subject: Re: How to build a musl toolchain for or1k

On Sat, Jul 19, 2014 at 07:06:56PM -0400, Rich Felker wrote:
> On Sun, Jul 20, 2014 at 01:26:29AM +0300, Stefan Kristiansson wrote:
> > Mainline kernel is missing support for a couple of features required
> > by musl (mostly related to the atomic instructions). I've added
> > support for them, but sending out patches for them is yet to be done.
> > In the meantime, they are all present in the smp branch of
> > git://
> What kernel features are needed for atomics to work? I figured it was
> mainly a cpu-level issue. Or were changes needed for the kernel to
> properly clear the lwa/swa flag on context switch?

It is mainly a cpu-level issue, and there's actually only two patches in that
branch that are required for musl to work.
1) There's no way on or1k to determine if a data page fault was
a read or write fault other than reading the instruction at the
faulting PC and check if it was a store instructions.
The atomic store instruction (l.swa) was missing from this check.

2) In order to get kernel support for robust_list, there need to be
arch specific implementations of the futex_atomic_* operations.
These implementations were missing.

> It would be really nice if the kernel could also trap and emulate
> l.lwa/l.swa and perhaps also l.msync so that these features could be
> used on old emulators/hardware that lack them.

I agree.

> > git clone -b smp git://
> > make ARCH=openrisc musl_defconfig
> > make ARCH=openrisc
> What's special in musl_defconfig? :)

Actually very little ;)
The support for the atomic instructions is enabled.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.