diff options
author | Rob Landley <rob@landley.net> | 2005-08-23 20:03:17 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2005-08-23 20:03:17 +0000 |
commit | f4c684a1efcf8a602d0803c889aba610b9a5ddb8 (patch) | |
tree | 86f0ce2508401a710ac9fd0a3c4bf17b2cfa1210 | |
parent | 6417564eebe6b9591d9c001160d201194bd5e24a (diff) | |
download | busybox-w32-f4c684a1efcf8a602d0803c889aba610b9a5ddb8.tar.gz busybox-w32-f4c684a1efcf8a602d0803c889aba610b9a5ddb8.tar.bz2 busybox-w32-f4c684a1efcf8a602d0803c889aba610b9a5ddb8.zip |
When compiling with FEATURE_MTAB_SUPPORT disabled, the call to erase_mtab()
can never be made because useMtab is initialized to 0, and all the other
assignments of that variable assign 0 to it. Any compiler that can perform
simple constant propogation on local variables will optimize away if statements
testing against that variable, thus the call to erase_mtab() will never be
made.
When compiling for arm using gcc 3.3.3 with FEATURE_MTAB_SUPPORT disabled,
the linker complains that it can't find erase_mtab(). The arm optimizer isn't
exactly the brightest member of the family, and apparently needs to be hit over
the head with a hammer to get its' attention...
-rw-r--r-- | util-linux/umount.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util-linux/umount.c b/util-linux/umount.c index 6de71b4ab..dd072e7f6 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -116,7 +116,9 @@ extern int umount_main(int argc, char **argv) | |||
116 | del_loop(m->device); | 116 | del_loop(m->device); |
117 | 117 | ||
118 | if(curstat) { | 118 | if(curstat) { |
119 | if(useMtab && m) erase_mtab(m->dir); | 119 | /* Yes, the ENABLE is redundant here, but the optimizer for ARM |
120 | * can't do simple constant propogation in local variables... */ | ||
121 | if(ENABLE_FEATURE_MTAB_SUPPORT && useMtab && m) erase_mtab(m->dir); | ||
120 | status = EXIT_FAILURE; | 122 | status = EXIT_FAILURE; |
121 | bb_perror_msg("Couldn't umount %s\n", path); | 123 | bb_perror_msg("Couldn't umount %s\n", path); |
122 | } | 124 | } |