FAQ.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>uClibc FAQ-- a C library for embedded systems</TITLE>
  5. </HEAD>
  6. <body text="#000000" alink="#660000" link="#660000" bgcolor="#dee2de" vlink="#660000">
  7. <basefont face="lucida, helvetica, arial" size="3">
  8. <CENTER>
  9. <p>
  10. <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2>
  11. <TR>
  12. <td bgcolor="#000000">
  13. <FONT FACE="lucida, helvetica" COLOR="#ccccc0">
  14. <B>µ&nbsp;C&nbsp;l&nbsp;i&nbsp;b&nbsp;c</B>
  15. </FONT>
  16. </TD>
  17. </TR>
  18. </TABLE>
  19. <p>
  20. <!-- Begin NOT Working List -->
  21. <TABLE WIDTH=95% CELLSPACING=1 CELLPADDING=4 BORDER=1>
  22. <TR><TD BGCOLOR="#ccccc0" ALIGN=center>
  23. <A NAME="notworking"> <BIG><B>
  24. uClibc Frequently Asked Questions (FAQ)
  25. </font>
  26. </A></B></BIG>
  27. </TD></TR>
  28. <TR><TD BGCOLOR="#eeeee0">
  29. <p>
  30. This is a collection of some of the frequently asked questions
  31. about uClibc. Some of the questions even have answers. If you
  32. have additions to this FAQ document, we would love to add them,
  33. <br>
  34. When you are done, <a href="http://uclibc.org/">you can click here to return
  35. to the uClibc home page.</a>
  36. <p>
  37. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  38. <B>
  39. What platforms does uClibc run on?
  40. </B>
  41. </TD></TR>
  42. <TR><TD BGCOLOR="#eeeee0">
  43. Currently uClibc runs on arm, i386, m68k, mipsel, powerpc, sh,
  44. sparc, and v850.
  45. <p>
  46. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  47. <B>
  48. Does uClibc support shared libraries?
  49. </B>
  50. </TD></TR>
  51. <TR><TD BGCOLOR="#eeeee0">
  52. Yes. uClibc has shared library support on x86, arm, and powerpc.
  53. Shared Libraries are _not_ currently supported on MMU-less systems.
  54. <p>
  55. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  56. <B>
  57. Why is it called uClibc?
  58. </B>
  59. </TD></TR>
  60. <TR><TD BGCOLOR="#eeeee0">
  61. For simplicity, uClibc is pronounced "yew-see-lib-see". The letter
  62. 'u' is short for µ (the greek letter "mu"). µ is commonly used as
  63. the abbreviation for the word "micro". The capital "C" is short
  64. for "controller". So uClibc is sortof an abbreviation for "the
  65. microcontroller C library". This is partly historical, since
  66. uClibc was originally created to support <a href="http://www.uclinux.org">µClinux</a>, a port of Linux
  67. for MMU-less microcontrollers such as the Dragonball, Coldfire, and
  68. ARM7TDMI. These days, uClibc works just fine with normal Linux
  69. system (like on x86, strongArm, and powerpc).
  70. <p>
  71. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  72. <B>
  73. Can I use it on my desktop x86 system?
  74. </B>
  75. </TD></TR>
  76. <TR><TD BGCOLOR="#eeeee0">
  77. Sure! In fact, this can be very nice during development. By
  78. installing uClibc on your development system, you can be sure that
  79. the code you are working on will actually run when you deploy it
  80. your target system.
  81. <p>
  82. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  83. <B>
  84. Why are you doing this? What's wrong with glibc?
  85. </B>
  86. </TD></TR>
  87. <TR><TD BGCOLOR="#eeeee0">
  88. Initially, the project began because glibc does not support
  89. MMU-less systems. But uClibc is also very useful because it is so
  90. much smaller then the GNU C library. The GNU C library is designed
  91. with a very different set of goals then uClibc. The GNU C library
  92. is a great piece of software, make no mistake. It is compliant to
  93. just about every standard ever created, and runs on just about
  94. every operating system and architecture -- no small task! But
  95. there is a price to be paid for that. It is quite a large library,
  96. and keeps getting larger with each release. It does not even
  97. pretend to target embedded systems. To quote from Ulrich Drepper,
  98. the maintainer of GNU libc: "...glibc is not the right thing for
  99. [an embedded OS]. It is designed as a native library (as opposed to
  100. embedded). Many functions (e.g., printf) contain functionality
  101. which is not wanted in embedded systems." 24 May 1999
  102. <p>
  103. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  104. <B>
  105. So uClibc is smaller then glibc? Doesn't that mean it completely sucks?
  106. How could it be smaller and not suck?
  107. </B>
  108. </TD></TR>
  109. <TR><TD BGCOLOR="#eeeee0">
  110. uClibc has been designed from the ground up to be a C library for
  111. embedded Linux. We don't need to worry about things like MS-DOS
  112. support, or Cygwin, or AmigaOs any other system. This lets us cut out
  113. a lot of complexity and very carefully optimize for Linux. By very
  114. careful design, we can also take a few shortcuts. For example, glibc
  115. contains an implementation of the wordexp() function, in compliance
  116. with the Single Unix Specification, version 2. Well, standards are
  117. important. But so is pragmatism. The wordexp function is huge, yet I
  118. am not aware of even one Linux application that uses it! So uClibc
  119. doesn't provide wordexp(). There are many similar examples. In other
  120. cases, uClibc leaves certain features (such as full C99 Math library
  121. support, IPV6, and RPC support) disabled by default. Those features
  122. can be enabled for people that need then, but are otherwise disabled to
  123. save space.
  124. <p>
  125. Glibc is a general purpose C library, and so as policy things are optimized
  126. for speed. Most of uClibc's routines have been very carefully written to
  127. optimize them for size instead.
  128. <p>
  129. The end result is a C library that will compile just about everything you
  130. throw at it, that looks like glibc to application programs when you
  131. compile, but is many times smaller.
  132. <p>
  133. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  134. <B>
  135. Why should I use uClibc?
  136. </B>
  137. </TD></TR>
  138. <TR><TD BGCOLOR="#eeeee0">
  139. I don't know if you should use uClibc or not. It depends on your needs.
  140. If you are building an embedded Linux system and you are tight on space, then
  141. using uClibc instead if glibc may be a very good idea.
  142. If you are trying to build a huge fileserver for your company that will
  143. have 12 Terabytes of storage, then using glibc may make more sense...
  144. <p>
  145. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  146. <B>
  147. I want to create a closed source commercial application and I want to
  148. protect my intellectual property. If I use uClibc, don't I have to
  149. release all my source code for free? Is that legal?
  150. </B>
  151. </TD></TR>
  152. <TR><TD BGCOLOR="#eeeee0">
  153. No, you do not need to give away your source code just because you use
  154. uClibc and/or run on Linux. uClibc is licensed under the LGPL, just
  155. like GNU libc. If you are using uClibc as a shared library, then your
  156. closed source application is 100% legal. Please consider sharing some
  157. of the money you make with us! :-)
  158. <p>
  159. If you are statically linking your closed source application with
  160. uClibc, then you must take additional steps to comply with the uClibc
  161. license. You may sell your statically linked application as usual, but
  162. you must also make your application available to your customers as an
  163. object file which can later be re-linked against updated versions of
  164. uClibc. This will (in theory) allow your customers to apply uClibc bug
  165. fixes to your application. You do not need to make the application
  166. object file available to everyone, just to those you gave the fully
  167. linked application.
  168. <p>
  169. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  170. <B>
  171. How do I compile stuff?
  172. </B>
  173. </TD></TR>
  174. <TR><TD BGCOLOR="#eeeee0">
  175. The easiest way is to use the compiler wrapper built by uClibc. Instead of
  176. using your usual compiler or cross compiler, you can use i386-uclibc-gcc,
  177. (or whatever is appropriate for your target architecture) and your
  178. applications will auto-magically link against uClibc.
  179. <p>
  180. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  181. <B>
  182. How do I make autoconf and automake behave?
  183. </B>
  184. </TD></TR>
  185. <TR><TD BGCOLOR="#eeeee0">
  186. First run
  187. <pre>export PATH=/usr/i386-linux-uclibc/bin:$PATH</pre>
  188. (or similar adjusted for your target architecture) then run you can simply
  189. run autoconf/automake and it should _just work_.
  190. <p>
  191. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  192. <B>
  193. When I run 'ldd' to get a list of the library dependencies for a uClibc
  194. binary, ldd segfaults! Or it runs my application! Anyways, it doesn't
  195. work! What should I do?
  196. </B>
  197. </TD></TR>
  198. <TR><TD BGCOLOR="#eeeee0">
  199. Use the ldd that is built by uClibc, not your system's one. When your
  200. system's ldd looks for library dependencies, it actually _runs_ that
  201. program. This works fine -- usually. I doesn't work at all when you
  202. have been cross compiling (which is why ldd segfaults). The ldd
  203. program created by uClibc is cross platform and doesn't even try to run
  204. the target program (like your system one does). So use the uClibc one
  205. and it will do the right thing, and it won't segfault even when you are
  206. cross compiling.
  207. <p>
  208. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  209. <B>
  210. What is the history of uClibc? Where did it come from?
  211. </B>
  212. </TD></TR>
  213. <TR><TD BGCOLOR="#eeeee0">
  214. The history and origin of uClibc is long and twisty.
  215. In the beginning, there was <a href="http://www.gnu.org/software/libc/libc.html">GNU libc</a>. Then, libc4
  216. (which later became linux libc 5) forked from GNU libc version 1.07.4, with
  217. additions from 4.4BSD, in order to support Linux. Later, the <a
  218. href="http://www.cix.co.uk/~mayday/">Linux-8086 C library</a>, which is part of
  219. the <a href="http://www.elks.ecs.soton.ac.uk/">elks project</a>, was created,
  220. which was, apparently, largely written from scratch but also borrowed code from
  221. libc4, glibc, some Atari library code, with bits and pieces from about 20 other
  222. places. Then uClibc forked off from the Linux-8086 C library in order to run
  223. on <a href="http://www.uclinux.org">µClinux</a>.
  224. <p>
  225. I had for some time been despairing over the state of C libraries in Linux.
  226. GNU libc, the standard, is very poorly suited to embedded systems and
  227. has been getting bigger with every release. I spent quite a bit of time looking over the
  228. available Open Source C libraries that I knew of (listed below), and none of them really
  229. impressed me. I felt there was a real vacancy in the embedded Linux ecology.
  230. The closest library to what I imagined an embedded C library should be was
  231. uClibc. But it had a lot of problems too -- not the least of which was that,
  232. traditionally, uClibc had a complete source tree fork in order to support each
  233. and every new platform. This resulted in a big mess of twisty versions, all
  234. different. I decided to fix it and the result is what you see here.
  235. My source tree has now become the official uClibc source tree and it now lives
  236. on cvs.uclinux.org and www.uclibc.org.
  237. <p>
  238. To start with, (with some initial help from <a
  239. href="http://www.uclinux.org/developers/index.html">D. Jeff Dionne</a>), I
  240. ported it to run on x86. I then grafted in the header files from glibc 2.1.3
  241. and cleaned up the resulting breakage. This (plus some additional work) has
  242. made it almost completely independent of kernel headers, a large departure from
  243. its traditional tightly-coupled-to-the-kernel origins. I have written and/or
  244. rewritten a number of things that were missing or broken, and sometimes grafted
  245. in bits of code from the current glibc and libc5. I have also built a proper
  246. platform abstraction layer, so now you can simply edit the file "Config" and
  247. use that to decide which architecture you will be compiling for, and whether or
  248. not your target has an MMU, and FPU, etc. I have also added a test suite,
  249. which, though incomplete, is a good start. Several people have helped by
  250. contributing ports to new architectures, and a lot of work has been done on
  251. adding support for missing features.
  252. <p>
  253. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  254. <B>
  255. I demand that you to add &lt;favorite feature&gt; right now! How come
  256. you don't answer all my questions on the mailing list instantly? I demand
  257. that you help me with all of my problems <em>Right Now</em>!
  258. </B>
  259. </TD></TR>
  260. <TR><TD BGCOLOR="#eeeee0">
  261. You have not paid us a single cent and yet you still have the
  262. product of nearly two years of work from Erik and Manuel and
  263. many other people. We are not your slaves! We work on uClibc
  264. because we find it interesting. If you go off flaming us, we will
  265. ignore you.
  266. <p>
  267. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  268. <B>
  269. I need you to add &lt;favorite feature&gt;! Are the uClibc developers willing to
  270. be paid in order to add in &lt;favorite feature&gt;? Are you willing to provide
  271. support contracts?
  272. </B>
  273. </TD></TR>
  274. <TR><TD BGCOLOR="#eeeee0">
  275. Sure! Now you have our attention! What you should do is contact <a
  276. href="mailto:andersen@codepoet.org">Erik Andersen</a> of <a
  277. href="http://codepoet-consulting.com/">CodePoet Consulting</a> to bid
  278. on your project. If Erik is too busy to personally add your feature, there
  279. are several other active uClibc contributors who will almost certainly be able
  280. to help you out. Erik can contact them and ask them about their availability.
  281. <p>
  282. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  283. <B>
  284. I think you guys are great and I want to help support your work!
  285. </B>
  286. </TD></TR>
  287. <TR><TD BGCOLOR="#eeeee0">
  288. Wow, that would be great! You can click here to help support uClibc and/or request features.
  289. <!-- Begin PayPal Logo -->
  290. <center>
  291. <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  292. <input type="hidden" name="cmd" value="_xclick">
  293. <input type="hidden" name="business" value="andersen@codepoet.org">
  294. <input type="hidden" name="item_name" value="Support uClibc and/or request features">
  295. <input type="hidden" name="image_url" value="https://codepoet-consulting.com/images/codepoet.png">
  296. <input type="hidden" name="no_shipping" value="1">
  297. <input type="image" src="images/donate.png" border="0" name="submit" alt="Make donation using PayPal">
  298. </form>
  299. </center>
  300. <!-- End PayPal Logo -->
  301. If you prefer to contact us directly for payments (Erik has a credit card machine so
  302. you can avoid making payments online), hardware donations, support requests, etc., you can
  303. contact <a href="http://codepoet-consulting.com/">CodePoet Consulting</a> here.
  304. <p>
  305. <TR><TD BGCOLOR="#ccccc0" ALIGN=left>
  306. <B>
  307. Ok, I'm done reading all these questions.
  308. </B>
  309. </TD></TR>
  310. <TR><TD BGCOLOR="#eeeee0">
  311. <a href="http://uclibc.org/">Well then, click here to return to the uClibc home page.</a>
  312. <!-- End things -->
  313. </TD></TR>
  314. </TABLE>
  315. </P>
  316. <!-- Footer -->
  317. <HR>
  318. <TABLE WIDTH="100%">
  319. <TR>
  320. <TD>
  321. <font size="-1" face="arial, helvetica, sans-serif">
  322. Mail all comments, insults, suggestions and bribes to
  323. <a href="mailto:andersen@codepoet.org">Erik Andersen</a><BR>
  324. </font>
  325. </TD>
  326. <TD>
  327. <a href="http://www.vim.org"><img border=0 width=90 height=36
  328. src="images/written.in.vi.png"
  329. alt="This site created with the vi editor"></a>
  330. </TD>
  331. <TD>
  332. <a href="http://www.gimp.org/"><img border=0 width=90 height=36
  333. src="images/gfx_by_gimp.png" alt="Graphics by GIMP"></a>
  334. </TD>
  335. <TD>
  336. <a href="http://www.linuxtoday.com"><img width=90 height=36
  337. src="images/ltbutton2.png" alt="Linux Today"></a>
  338. </TD>
  339. <TD>
  340. <p><a href="http://slashdot.org"><img width=90 height=36
  341. src="images/sdsmall.png" alt="Slashdot"></a>
  342. </TD>
  343. <TD>
  344. <a href="http://freshmeat.net"><img width=90 height=36
  345. src="images/fm.mini.png" alt="Freshmeat"></a>
  346. </TD>
  347. </TR>
  348. </TABLE>
  349. </CENTER>
  350. </BODY>
  351. </HTML>