aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-08-29 22:12:56 -0500
committerRob Landley <rob@landley.net>2015-08-29 22:12:56 -0500
commit8c588d822a4771420fa32571693f728e809bb2f2 (patch)
tree7a7b94434373ad6bc3a8bd71ea1016c8318ae8bc
parent9215cbc062f85cd285d8906a0b36941fa44d06c7 (diff)
downloadtoybox-8c588d822a4771420fa32571693f728e809bb2f2.tar.gz
Menuconfig option for musl-libc pretending mmu is just pining for the fijords.
-rw-r--r--Config.in26
-rwxr-xr-xscripts/genconfig.sh1
2 files changed, 27 insertions, 0 deletions
diff --git a/Config.in b/Config.in
index a2443e20..3c560f80 100644
--- a/Config.in
+++ b/Config.in
@@ -130,4 +130,30 @@ config TOYBOX_UID_USR
default 500
help
When commands like useradd/groupadd allocate user IDs, start here.
+
+config TOYBOX_MUSL_NOMMU_IS_BROKEN
+ bool "Workaround for musl-libc breakage on nommu systems."
+ default n
+ help
+ When using musl-libc on a nommu system, you'll need to say "y" here.
+
+ Although uclibc lets you detect support for things like fork() and
+ daemon() at compile time, musl intentionally includes broken versions
+ that always return -ENOSYS on nommu systems, and goes out of its way
+ to prevent any cross-compile compatible compile-time probes for a
+ nommu system.
+
+ Musl does this despite the fact that a nommu system can't even run
+ standard ELF binaries, and requires specially packaged executables.
+ (You can't even check a #define to see that you're building against
+ musl, due to its maintainer's policy that musl never has bugs that
+ require workarounds.)
+
+ So our only choice is to manually provide a musl nommu bug workaround
+ you can manually select to enable (larger, slower) nommu support with
+ musl.
+
+ You don't need this for uClibc, we have a compile time probe that
+ autodetects nommu support there.
+
endmenu
diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh
index 031e97e0..ce8c0266 100755
--- a/scripts/genconfig.sh
+++ b/scripts/genconfig.sh
@@ -89,6 +89,7 @@ EOF
#include <unistd.h>
int main(int argc, char *argv[]) { return fork(); }
EOF
+ echo -e '\tdepends on !TOYBOX_MUSL_NOMMU_IS_BROKEN'
}
genconfig()