FAQ.txt 7.3 KB

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