Is ARCH_HAS_MMU going away?

Rob Landley rob at landley.net
Tue Jul 28 01:36:48 UTC 2009


I don't understand the difference between ARCH_HAS_MMU and ARCH_USE_MMU.  (For 
a kernel, sure.  For a C library, not so much.)  As far as I can tell, there 
isn't one, and ARCH_HAS_MMU has been obsoleted in favor of ARCH_USE_MMU.

I'll start by noting that test/build/check_config_options.sh has a line:

  # Make sure nothing uses the ARCH_HAS_MMU option anymore

That was in 0.9.30.1.  The current .git still has ARCH_HAS_MMU in it.

In theory ARCH_HAS_MMU means the system physically has a memory management 
unit, and ARCH_USE_MMU means uClibc should make use of it.  But that 
distinction only matters for the kernel (which has to set the hardware up even 
if it's not going to use it), not for the C library which is either using it 
or it isn't.  I don't know how this distinction could mean anything to 
userspace, and uClibc is only ever using it in the config system.

Currently, ARCH_HAS_MMU is auto-selected by various architectures, but when it 
isn't automatically selected via the architecture you can still select it 
manually.  (So when you haven't got an MMU, you can pretend you do, but still 
choose not to use it by keeping ARCH_USE_MMU switched off.  Um, ok?)

More to the point, since ARCH_USE_MMU is a dependent symbol on the one that's 
selected, you can switch ARCH_USE_MMU off for any architectures, including ones 
like x86_64 where ARCH_HAS_MMU is forced on.  So I can treat x86_64 as a nommu 
platform even though it never is, but when you actually do this the result is 
a build break.  Specifically:

  GEN include/bits/uClibc_config.h
  make: *** No rule to make target `libc/sysdeps/linux/x86_64/crtreloc.c',
  needed by `lib/crtreloc.o'.  Stop.

So the ability to do that isn't currently very useful (and the straightforward 
way to implement it would be to have one symbol that's freely selectable for 
all architectures anyway).

Does anybody know anything about the future of this symbol?  Is this something 
that fell on the floor when Erik and Manuel and Glenn and everybody wandered 
off, or is there an actual reason to have two different symbols that seem to 
mean the same thing?

Confused,

Rob
-- 
Latency is more important than throughput. It's that simple. - Linus Torvalds


More information about the uClibc mailing list