mailing list of musl libc
 help / color / mirror / code / Atom feed
* Any plans on MMU-less support?
@ 2014-03-30  6:49 Smirnov Vladimir
  2014-03-30 15:01 ` Szabolcs Nagy
  0 siblings, 1 reply; 5+ messages in thread
From: Smirnov Vladimir @ 2014-03-30  6:49 UTC (permalink / raw)
  To: musl

I wonder if MUSL have such roadmap or there is any hackish way to add 
that support (may be some unoffitial patches).
My problem that i've stucked with old gcc toolchain and uClibc 
supporting one widely used ARMv4 MMUless chip.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Any plans on MMU-less support?
  2014-03-30  6:49 Any plans on MMU-less support? Smirnov Vladimir
@ 2014-03-30 15:01 ` Szabolcs Nagy
  2014-03-30 23:17   ` Rich Felker
  2014-03-31  6:44   ` Владимир Смирнов
  0 siblings, 2 replies; 5+ messages in thread
From: Szabolcs Nagy @ 2014-03-30 15:01 UTC (permalink / raw)
  To: musl

* Smirnov Vladimir <mapron1@gmail.com> [2014-03-30 15:49:08 +0900]:
> I wonder if MUSL have such roadmap or there is any hackish way to
> add that support (may be some unoffitial patches).
> My problem that i've stucked with old gcc toolchain and uClibc
> supporting one widely used ARMv4 MMUless chip.

looking at uClibc the main differences in a no-mmu system:

fork is not available so related functions have to be changed/disabled
(vfork, daemon, wordexp, forkpty, pthread_atfork)

brk is not available so malloc needs to change

mmap may need MAP_UNINITIALIZED flag for performance
(and MAP_FIXED flag will fail)

memory management related things may need to be changed/disabled
(mprotect?,mlock,msync,..)

for dynamic linking ldso and libc startup code may need some change
(some targets (not arm) need fdpic or dsbt elf support)
(others can use a shared flat binary format)

pthread may need smaller default stack and more careful stack usage

arm startup code needs a change according to
http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/arm/crt1.S#n179

and you may need to fix various toolchain issues..


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Any plans on MMU-less support?
  2014-03-30 15:01 ` Szabolcs Nagy
@ 2014-03-30 23:17   ` Rich Felker
  2014-03-31  9:04     ` Szabolcs Nagy
  2014-03-31  6:44   ` Владимир Смирнов
  1 sibling, 1 reply; 5+ messages in thread
From: Rich Felker @ 2014-03-30 23:17 UTC (permalink / raw)
  To: musl

On Sun, Mar 30, 2014 at 05:01:39PM +0200, Szabolcs Nagy wrote:
> * Smirnov Vladimir <mapron1@gmail.com> [2014-03-30 15:49:08 +0900]:
> > I wonder if MUSL have such roadmap or there is any hackish way to
> > add that support (may be some unoffitial patches).
> > My problem that i've stucked with old gcc toolchain and uClibc
> > supporting one widely used ARMv4 MMUless chip.
> 
> looking at uClibc the main differences in a no-mmu system:
> 
> fork is not available so related functions have to be changed/disabled
> (vfork, daemon, wordexp, forkpty, pthread_atfork)

vfork does not use fork except as a default implementation when no
arch-specific file exists.

The rest are probably mostly uninteresting to nommu; in any case,
they're not something libc can fix, but things apps must avoid using
to work on nommu.

> brk is not available so malloc needs to change

Thankfully support for the case where brk fails is already on the
agenda due to the kernel bug that affects PIE.

> mmap may need MAP_UNINITIALIZED flag for performance

This is unrelated to libc and gives wrong semantics. If apps want they
can do it, but it's really a bad idea.

> (and MAP_FIXED flag will fail)

Just for MAP_SHARED.

> memory management related things may need to be changed/disabled
> (mprotect?,mlock,msync,..)

Shouldn't affect libc.

> for dynamic linking ldso and libc startup code may need some change
> (some targets (not arm) need fdpic or dsbt elf support)
> (others can use a shared flat binary format)

This is definitely a topic that needs more research. I doubt dynamic
linking could be made to work easily.

> pthread may need smaller default stack and more careful stack usage

This only matters if the machine has a tiny amount of memory; it's
orthogonal to nommu.

> arm startup code needs a change according to
> http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/arm/crt1.S#n179

This is rather hideous.

Rich


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Any plans on MMU-less support?
  2014-03-30 15:01 ` Szabolcs Nagy
  2014-03-30 23:17   ` Rich Felker
@ 2014-03-31  6:44   ` Владимир Смирнов
  1 sibling, 0 replies; 5+ messages in thread
From: Владимир Смирнов @ 2014-03-31  6:44 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1425 bytes --]

I already using uClibc so i know that i hardly ever have fork or dynamic
linkage. It's all suitable for me.
So whats up with mmap and startup code?
I wonder on minimal working set of that all :-)


2014-03-31 0:01 GMT+09:00 Szabolcs Nagy <nsz@port70.net>:

> * Smirnov Vladimir <mapron1@gmail.com> [2014-03-30 15:49:08 +0900]:
> > I wonder if MUSL have such roadmap or there is any hackish way to
> > add that support (may be some unoffitial patches).
> > My problem that i've stucked with old gcc toolchain and uClibc
> > supporting one widely used ARMv4 MMUless chip.
>
> looking at uClibc the main differences in a no-mmu system:
>
> fork is not available so related functions have to be changed/disabled
> (vfork, daemon, wordexp, forkpty, pthread_atfork)
>
> brk is not available so malloc needs to change
>
> mmap may need MAP_UNINITIALIZED flag for performance
> (and MAP_FIXED flag will fail)
>
> memory management related things may need to be changed/disabled
> (mprotect?,mlock,msync,..)
>
> for dynamic linking ldso and libc startup code may need some change
> (some targets (not arm) need fdpic or dsbt elf support)
> (others can use a shared flat binary format)
>
> pthread may need smaller default stack and more careful stack usage
>
> arm startup code needs a change according to
> http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/arm/crt1.S#n179
>
> and you may need to fix various toolchain issues..
>

[-- Attachment #2: Type: text/html, Size: 2044 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Any plans on MMU-less support?
  2014-03-30 23:17   ` Rich Felker
@ 2014-03-31  9:04     ` Szabolcs Nagy
  0 siblings, 0 replies; 5+ messages in thread
From: Szabolcs Nagy @ 2014-03-31  9:04 UTC (permalink / raw)
  To: musl

* Rich Felker <dalias@aerifal.cx> [2014-03-30 19:17:47 -0400]:
> On Sun, Mar 30, 2014 at 05:01:39PM +0200, Szabolcs Nagy wrote:
> > mmap may need MAP_UNINITIALIZED flag for performance
> 
> This is unrelated to libc and gives wrong semantics. If apps want they
> can do it, but it's really a bad idea.

i meant in malloc (and similar usage inside libc)

(i dont think inter-process information leak needs to be considered on nommu)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-31  9:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-30  6:49 Any plans on MMU-less support? Smirnov Vladimir
2014-03-30 15:01 ` Szabolcs Nagy
2014-03-30 23:17   ` Rich Felker
2014-03-31  9:04     ` Szabolcs Nagy
2014-03-31  6:44   ` Владимир Смирнов

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).