FAQ.html 15 KB

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