Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <VI1PR10MB3566DAE6C74ECA7CB4CB2F45CF990@VI1PR10MB3566.EURPRD10.PROD.OUTLOOK.COM>
Date: Sat, 20 Jun 2020 00:36:11 +0000
From: Robert Skopalík <rs@...ome.cz>
To: Rich Felker <dalias@...c.org>
CC: "musl@...ts.openwall.com" <musl@...ts.openwall.com>,
	Miroslav Němeček <mn@...ome.cz>
Subject: RE: strtok

I see! Thank you.

We know fdpic. I guess we need to compile gcc toolchain with fdpic for this MCU. We tried that, no success :) I am afraid we are not experienced enough to make it right. We don't even know how the resulting gcc should be named - arm-our_os-eabi? :)

Could you pls point us to some literature - what to read to do it? And to connect it to musl the right way?

Thank you.

R

-----Original Message-----
From: Rich Felker [mailto:dalias@...c.org] 
Sent: Saturday, June 20, 2020 2:16 AM
To: Robert Skopalík
Cc: musl@...ts.openwall.com; Miroslav Němeček
Subject: Re: [musl] strtok

On Sat, Jun 20, 2020 at 12:03:12AM +0000, Robert Skopalík wrote:
> Hello,
> 
> we are working on an OS for a STM32 MCU. We like how the reentrancy
> is solved in musl, but ... when two (or more) userspace programs
> using a strtok function are run, there might be a collision (because
> strtok uses a static var to save the pointer). We did not find any
> redirection mechanism from strtok to strtok_r. How is it meant pls?
> We do not want to force the users to write strtok_r into a
> non-threaded user program.
> 
> Is there some solution to make it work right?
> 
> Thank you

If multiple programs are running, each needs its own execution context
including its own versions of all libc (and any other) global data.
Probably you should look into the ARM FDPIC ABI, which is the right
way to do this while still sharing program text for MMU-less
microcontrollers like the one you're working with. The tooling should
be mature now so that support could be added to musl, but making it
happen needs people who are interested in providing feedback and
testing.

Rich

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.