[BusyBox] The mount rewrite is in.
Rob Landley
rob at landley.net
Wed Aug 17 10:02:23 MDT 2005
On Wednesday 17 August 2005 03:15, Thomas Fröhlich wrote:
> > P.S. We haven't used CVS for over a year.
>
> Oh, I meant subversion, don't be so closely ;) I think, you knew what I
> meant.
> I'm at revision 11182
Just making sure. :)
> I have in .config:
> CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
> ...
> CONFIG_FEATURE_SH_IS_ASH=y
> # CONFIG_FEATURE_SH_IS_HUSH is not set
> # CONFIG_FEATURE_SH_IS_LASH is not set
> # CONFIG_FEATURE_SH_IS_MSH is not set
> # CONFIG_FEATURE_SH_IS_NONE is not set
> ...
> CONFIG_ASH=y
> CONFIG_MOUNT=y
> CONFIG_UMOUNT=y
> # CONFIG_FEATURE_MTAB_SUPPORT is not set
Yeah, just built with that, and it worked. What compiler version are you
using? (I'm using gcc 3.3.5.)
> compilation failed with
> busybox/util-linux/util-linux.a(umount.o)(.text+0x2b8): In function
>
> `umount_main':
> : undefined reference to `erase_mtab'
And for me, it didn't.
Notice that this is a link-time error. Although this function has a
prototype, all the calls to it are optimized out by
ENABLE_FEATURE_MTAB_SUPPORT. (In the case of the umount call, the local
variable is initialized to ENABLE_FEATURE_MTAB_SUPPORT and constant
propogation zaps it.) There is no place where that variable is ever set to a
nonzero value when ENABLE_FEATURE_MTAB_SUPPORT is 0, and the compiler I'm
using is smart enough to pick up on that.
Apparently yours isn't. Now I can make a stub for it compilers, but that's
another thing that would go in a quarrantine.h file to support C libraries
and old compilers...
> if I clean the
> #ifconfig CONFIG_FEATURE_MTAB_SUPPORT
> #endif
> in mtab.c it compiles...
You need it even though both of the call sites are designed to let it be
optimized out using compiler optimization techniques that were well-known
more than 10 years ago...
> I didn't think there is a problem on the shell...
> It's great for you, if it works fine, but I had the same problem on a new
> checkout...I give you my .config, perhaps a uClibc problem?!?
It's not a library problem, it's a compiler problem. When we get to link
time, there are still calls to a function that can never be called.
I can add a broken_compilers.h file that does a version test and adds an empty
version of this function under the #ifdef...
> regards
> Thomas
Rob
More information about the busybox
mailing list