FAQ.txt 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. This is a collection of some of the frequently asked question
  2. about uClibc. Some of the questions even have answers. If you
  3. have additions to this FAQ document, I'd love to add them,
  4. -Erik
  5. Q: Why is it called uClibc?
  6. The letter 'u' is short for the greek letter "mu". "Mu" stands for
  7. "micro", and the "C" is for "controller". uClibc was originaly created to
  8. support uClinux, a port of Linux for MMU-less microcontrollers such as the
  9. Dragonball, Coldfire, and ARM7TDMI.
  10. Q: Can I use it on my desktop x86 system?
  11. Sure! In fact, this can be very nice during development. By using it on
  12. your development system, you can be sure that the code you are working on
  13. will actually run on your target system.
  14. Q: Why are you doing this? Whats wrong with glibc?
  15. The inital reason, is that glibc does not support MMU-les systems. But
  16. additionaly, the GNU C library has a different set of goals then uClibc.
  17. The GNU C library is a great piece of software. It complies with just
  18. about every standard ever created, and runs on just about every operating
  19. system as well -- no small task! But there is a price to be paid for that.
  20. It is quite a large library, and keeps getting larger with each release.
  21. It does not even pretend to target embedded systems. To quote from Ulrich
  22. Drepper, the maintainer of GNU libc: "...glibc is not the right thing for
  23. [an embedded OS]. It is designed as a native library (as opposed to
  24. embedded). Many functions (e.g., printf) contain functionality which is
  25. not wanted in embedded systems." 24 May 1999
  26. Q: So uClibc is smaller then glibc? Doesn't that mean it completely sucks?
  27. How could it be smaller and not suck?
  28. uClibc has been designed from the ground up to be a C library for embedded
  29. Linux. We don't need to worry about whether we support MS-DOS, or Cygwin,
  30. or any other system. This lets us cut out lots of complexity, and very
  31. carefully optimize for Linux. By very careful design, we can also make a
  32. few shotcuts. For example, glibc contains an implementation of the
  33. wordexp() function, in compliance with the Single Unix Specificaion,
  34. version 2. Well, standards are important. But so is pragmatism. The
  35. wordexp function adds almost 100k to glibc, and yet I am not aware of even
  36. one Linux application that uses wordexp. So uClibc doesn't have wordexp().
  37. Glibc is a general purpose C library, and so as policy things are optimized
  38. for speed. uClibc has a large number of routines that have been very
  39. carefuly written to optimize for size instead of speed.
  40. The end result is a C library that will compile just about everything you
  41. throw at it, thet looks like glibc to application programs when you
  42. compile, and is many times smaller.
  43. Q: Why should I use uClibc?
  44. I don't know if you should use uClibc or not. It depends on your goals.
  45. If you are building an embedded system, and you are tight on space, then
  46. using uClibc instead if glibc should allow you to use your storage for
  47. other things.
  48. If you are trying to build a ultra fast fileserver for your company that
  49. has 12 Terabytes of storage, then you probably want to use glibc...
  50. Q: I want to create a closed source commercial application and I want to
  51. protect my intellectual property. If I use uClibc, don't I have to
  52. release my source code?
  53. No, you do not need to give away your source code just because you use
  54. uClibc and/or run on Linux.
  55. Q: I want to create a closed source commercial application using uClibc.
  56. Is that legal?
  57. Yes. uClibc is licensed under the LGPL, just like GNU libc. If you are
  58. using uClibc as a shared library, then your closed source application is
  59. 100% legal. Please consider sharing some of the money you make. :-)
  60. If you are staticly linking your closed source commercial application with
  61. uClibc, then you must take additional steps to comply with the uClibc
  62. license. You can sell your application as usual, but you must also make
  63. your closed source application available to your customers as an object
  64. file which can then be linked with updated versions of uClibc. This will
  65. (in theory) allow your customers to later link with updated versions of
  66. uClibc. You do not need to make the application object file available to
  67. everyone, just to those you gave the fully linked application.
  68. Q: How do I compile stuff?
  69. The easiest way is to use the compiler wrapper built by uClibc. Instead of
  70. using your usual compiler or cross compiler, you can use i386-uclibc-gcc,
  71. (or whatever is appropriate for your architecture) and it will automagically
  72. make your program link against uClibc.
  73. Q: How do I make autoconf and automake behave?
  74. First run
  75. export PATH=/usr/i386-linux-uclibc/bin:$PATH
  76. (or similar adjusted for your target architecture) then run you can simply
  77. run autoconf/automake and it should _just work_.
  78. Q: When I run 'ldd' to get a list of the library dependancies for a uClibc
  79. binary, ldd segfault! Or it runs my application? Anyways, it doesn't
  80. work! What should I do?
  81. Use the ldd that is built by uClibc, not your system's one. When your
  82. system's ldd looks for the library dependancies, it actually tries to
  83. _execute_ that program. This works fine -- usually. I doesn't work at all
  84. when you are cross compiling (thats why ldd segfaults). The ldd program
  85. created by uClibc is cross platform and doesn't actually try to run the
  86. target program like your system one does, so it should do the right thing,
  87. and won't segfault, even when you are cross compiling.
  88. Q: I need you to add <favorite feature> now! How come you don't answer all my
  89. questions on the mailing list withing 5 minutes? I demand that you help me
  90. Right Now!
  91. You have not paid me a single cent and yet you still have the product of
  92. over year and a half of my work, and lots of work from other people. How
  93. dare you treat me that way! I work on uClibc because I find it
  94. interesting. If you go off flaming me, I will ignore you.
  95. Q: I need you to add <favorite feature>! Are the uClibc developers willing to
  96. be paid in order to add in <favorite feature>? Are you willing to provide
  97. support contracts?
  98. Sure! Now you have our attention! What you should do is contact
  99. Erik Andersen of CodePoet Consulting to bid on your project. If Erik
  100. is too busy to personally add your feature
  101. Q: I think you guys are great and I want to help support your work!
  102. Wow, that would be great! You can visit
  103. http://paypal.com/
  104. click on "Send Money" and donate to andersen@codepoet.org
  105. I hope that was helpful... If you have and comment, corrections, insults,
  106. suggestions, or bribes, email me at andersen@codepoet.org.
  107. -Erik
  108. --
  109. Erik B. Andersen
  110. andersen@codepoet.org
  111. http://codepoet-consulting.com/