[BusyBox-cvs] svn commit: trunk/busybox/util-linux
landley at busybox.net
landley at busybox.net
Tue Aug 23 20:03:18 UTC 2005
Author: landley
Date: 2005-08-23 14:03:17 -0600 (Tue, 23 Aug 2005)
New Revision: 11231
Log:
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...
Modified:
trunk/busybox/util-linux/umount.c
Changeset:
Modified: trunk/busybox/util-linux/umount.c
===================================================================
--- trunk/busybox/util-linux/umount.c 2005-08-23 01:42:23 UTC (rev 11230)
+++ trunk/busybox/util-linux/umount.c 2005-08-23 20:03:17 UTC (rev 11231)
@@ -116,7 +116,9 @@
del_loop(m->device);
if(curstat) {
- if(useMtab && m) erase_mtab(m->dir);
+ /* Yes, the ENABLE is redundant here, but the optimizer for ARM
+ * can't do simple constant propogation in local variables... */
+ if(ENABLE_FEATURE_MTAB_SUPPORT && useMtab && m) erase_mtab(m->dir);
status = EXIT_FAILURE;
bb_perror_msg("Couldn't umount %s\n", path);
}
More information about the busybox-cvs
mailing list