diet libc FAQ.


Q: How do I compile this beast?  I don't see a configure?
A: Just type make.


Q: How do I install it?  make install?
A: You don't install it at all.  The diet libc comes with a wrapper
   called "diet", which can be found in $(ARCH)-bin/diet, i.e.
   i386-bin/diet for most of us.  Copy this wrapper somewhere in your
   path (for example ~/bin) and then just compile stuff by prepending
   diet to the command line, e.g. "diet gcc -pipe -g -o t t.c".


Q: How do I compile programs using autoconf with the diet libc?
A: Set CC in the environment properly.  For Bourne Shells:

     $ CC="diet gcc -static" ./configure --disable-nls

   That should be enough, but you might also want to set
   --disable-shared and --enable-static for packages using libtool.


Q: Do you have cross compiling support?
A: Yes.  Just type something like "make ARCH=arm CROSS=arm-linux- all".
   For arm, alpha, mips, ppc, sparc and i386, shortcuts exist.  You can
   also use "make arm", for example.  You still use the same "diet"
   program as for normal compilation, but you can then say

     $ diet sparc-linux-gcc -pipe -g -o t t.c

   Programs using autoconf can be configured like this:

     $ CC="diet sparc-linux-gcc -static" ./configure --disable-nls


Q: There are a few warnings about possibly uninitialized variables when
   compiling the diet libc.  Can't you remove them?
A: This type of warning can only be removed by a) compiling without
   warnings or b) initializing the variables in question.  In all cases,
   the variables won't actually be used uninitialized, but adding an
   explicit initializer will add a few bytes of code.  As you know, the
   goal of the diet libc is to not waste a single byte of code, so we
   don't add initializers ;-)


Q: When linking binaries, I get warnings about stdio and printf all the
   time.  What gives?
A: Since the diet libc was written to make writing small programs
   possible, it also tries to assist in the process of seeing causes of
   bloat.  Premier causes for bloat are stdio and the printf family of
   functions.  The diet libc will also warn you if you still use
   assert() (which is normally not enabled in production code) or if you
   use functions that use static buffers (like gethostbyname and
   friends).


Q: My program stopped parsing command line arguments properly!  Now what?
A: The getopt in the diet libc adheres to the Single Unix Specification.
   In particular, it initialized optind to 1 (not 0) and breaks if
   someone sets optint to 0 (as some misguided legacy programs to).
   Also, it does not reorder arguments, i.e. something like "rm -f foo -v"
   will not see -v as option but rather as non-option argument.  If you
   need GNU getopt behaviour, please use GNU getopt instead of the diet
   libc code.
