update from main archive 970124
[glibc.git] / FAQ
blob642dfee9a6aa3fcf2f26d05134cef899fd2ad845
1                 Frequently Asked Question on GNU C Library
3 As every FAQ this one also tries to answer questions the user might have
4 when using the package.  Please make sure you read this before sending
5 questions or bug reports to the maintainers.
7 The GNU C Library is very complex.  The building process exploits the
8 features available in tools generally available.  But many things can
9 only be done using GNU tools.  Also the code is sometimes hard to
10 understand because it has to be portable but on the other hand must be
11 fast.  But you need not understand the details to use GNU C Library.
12 This will only be necessary if you intend to contribute or change it.
14 If you have any questions you think should be answered in this document,
15 please let me know.
17                                                   --drepper@cygnus.com
19 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
20 [Q1]    ``What systems does the GNU C Library run on?''
22 [Q2]    ``What compiler do I need to build GNU libc?''
24 [Q3]    ``When starting make I get only error messages.
25           What's wrong?''
27 [Q4]    ``After I changed configure.in I get `Autoconf version X.Y.
28           or higher is required for this script'.  What can I do?''
30 [Q5]    ``Do I need a special linker or archiver?''
32 [Q6]    ``Do I need some more things to compile GNU C Library?''
34 [Q7]    ``When I run `nm -u libc.so' on the produced library I still
35           find unresolved symbols?  Can this be ok?''
37 [Q8]    ``Can I replace the libc on my Linux system with GNU libc?''
39 [Q9]    ``I expect GNU libc to be 100% source code compatible with
40           the old Linux based GNU libc.  Why isn't it like this?''
42 [Q10]   ``Why does getlogin() always return NULL on my Linux box?''
44 [Q11]   ``Where are the DST_* constants found in <sys/time.h> on many
45           systems?''
47 [Q12]   ``The `gencat' utility cannot process the input which are
48           successfully used on my Linux libc based system.  Why?''
50 [Q13]   ``How do I configure GNU libc so that the essential libraries
51           like libc.so go into /lib and the other into /usr/lib?''
53 [Q14]   ``When linking with the new libc I get unresolved symbols
54           `crypt' and `setkey'.  Why aren't these functions in the
55           libc anymore?''
57 [Q15]   ``What are these `add-ons'?''
59 [Q16]   ``When I use GNU libc on my Linux system by linking against
60           to libc.so which comes with glibc all I get is a core dump.''
62 [Q17]   ``Looking through the shared libc file I haven't found the
63           functions `stat', `lstat', `fstat', and `mknod' and while
64           linking on my Linux system I get error messages.  How is
65           this supposed to work?''
67 [Q18]   ``The prototypes for `connect', `accept', `getsockopt',
68           `setsockopt', `getsockname', `getpeername', `send',
69           `sendto', and `recvfrom' are different in GNU libc than
70           on any other system I saw.  This is a bug, isn't it?''
72 [Q19]   ``My XXX kernel emulates a floating-point coprocessor for me.
73           Should I enable --with-fp?''
75 [Q20]   ``How can I compile gcc 2.7.2.1 from the gcc source code using
76           glibc 2.x?
78 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
79 [Q1]    ``What systems does the GNU C Library run on?''
81 [A1] {UD} This is difficult to answer.  The file `README' lists the
82 architectures GNU libc is known to run *at some time*.  This does not
83 mean that it still can be compiled and run on them in the moment.
85 The systems glibc is known to work on in the moment and most probably
86 in the future are:
88         *-*-gnu                 GNU Hurd
89         i[3456]86-*-linux-gnu   Linux-2.0 on Intel
90         m68k-*-linux-gnu        Linux-2.0 on Motorola 680x0
91         alpha-*-linux-gnu       Linux-2.0 on DEC Alpha
93 Other Linux platforms are also on the way to be supported but I need
94 some success reports first.
96 If you have a system not listed above (or in the `README' file) and
97 you are really interested in porting it, contact
99         <bug-glibc@prep.ai.mit.edu>
102 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
103 [Q2]    ``What compiler do I need to build GNU libc?''
105 [A2] {UD} It is (almost) impossible to compile GNU C Library using a
106 different compiler than GNU CC.  A lot of extensions of GNU CC are
107 used to increase the portability and speed.
109 But this does not mean you have to use GNU CC for using the GNU C
110 Library.  In fact you should be able to use the native C compiler
111 because the success only depends on the binutils: the linker and
112 archiver.
114 The GNU CC is found like all other GNU packages on
115         ftp://prep.ai.mit.edu/pub/gnu
116 or better one of the many mirror sites.
118 You always should try to use the latest official release.  Older
119 versions might not have all the features GNU libc could use.
122 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
123 [Q3]    ``When starting `make' I get only errors messages.
124           What's wrong?''
126 [A3] {UD} You definitely need GNU make to translate GNU libc.  No
127 other make program has the needed functionality.
129 Versions before 3.74 have bugs which prevent correct execution so you
130 should upgrade to the latest version before starting the compilation.
133 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
134 [Q4]    ``After I changed configure.in I get `Autoconf version X.Y.
135           or higher is required for this script'.  What can I do?''
137 [A4] {UD} You have to get the specified autoconf version (or a later)
138 from your favourite mirror of prep.ai.mit.edu.
141 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
142 [Q5]    ``Do I need a special linker or archiver?''
144 [A5] {UD} If your native versions are not too buggy you can probably
145 work with them.  But GNU libc works best with GNU binutils.
147 On systems where the native linker does not support weak symbols you
148 will not get a really ISO C compliant C library.  Generally speaking
149 you should use the GNU binutils if they provide at least the same
150 functionality as your system's tools.
152 Always get the newest release of GNU binutils available.
153 Older releases are known to have bugs that affect building the GNU C
154 Library.
157 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
158 [Q6]    ``Do I need some more things to compile GNU C Library?''
160 [A6] {UD} Yes, there are some more :-).
162 * GNU gettext; the GNU libc is internationalized and partly localized.
163   For bringing the messages for the different languages in the needed
164   form the tools from the GNU gettext package are necessary.  See
165   ftp://prep.ai.mit.edu/pub/gnu or better any mirror site.
167 * lots of diskspace (for i?86-linux this means, e.g., ~70MB).
169   You should avoid compiling on a NFS mounted device.  This is very
170   slow.
172 * plenty of time (approx 1h for i?86-linux on i586@133 or 2.5h on
173   i486@66 or 4.5h on i486@33).  For Hurd systems times are much higher.
175   If you have some more measurements let me know.
177 * When compiling for Linux:
179   + the header files of the Linux kernel must be available in the
180     search path of the CPP as <linux/*.h> and <asm/*.h>.
182 * Some files depend on special tools.  E.g., files ending in .gperf
183   need a `gperf' program.  The GNU version (part of libg++) is known
184   to work while some vendor versions do not.
186   You should not need these tools unless you change the source files.
188 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
189 [Q7]    ``When I run `nm -u libc.so' on the produced library I still
190           find unresolved symbols?  Can this be ok?''
192 [A7] {UD} Yes, this is ok.  There can be several kinds of unresolved
193 symbols:
195 * magic symbols automatically generated by the linker.  Names are
196   often like __start_* and __stop_*
198 * symbols starting with _dl_* come from the dynamic linker
200 * symbols resolved by using libgcc.a
201   (__udivdi3, __umoddi3, or similar)
203 * weak symbols, which need not be resolved at all
204   (currently fabs among others; this gets resolved if the program
205    is linked against libm, too.)
207 Generally, you should make sure you find a real program which produces
208 errors while linking before deciding there is a problem.
211 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
212 [Q8]    ``Can I replace the libc on my Linux system with GNU libc?''
214 [A8] {UD} You cannot replace any existing libc for Linux with GNU
215 libc.  There are different versions of C libraries and you can run
216 libcs with different major version independently.
218 For Linux there are today two libc versions:
219         libc-4          old a.out libc
220         libc-5          current ELF libc
222 GNU libc will have the major number 6 and therefore you can have this
223 additionally installed.  For more information consult documentation for
224 shared library handling.  The Makefiles of GNU libc will automatically
225 generate the needed symbolic links which the linker will use.
228 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
229 [Q9]    ``I expect GNU libc to be 100% source code compatible with
230           the old Linux based GNU libc.  Why isn't it like this?''
232 [A9] {DMT,UD} Not every extension in Linux libc's history was well
233 thought-out.  In fact it had a lot of problems with standards compliance
234 and with cleanliness.  With the introduction of a new version number these
235 errors now can be corrected.  Here is a list of the known source code
236 incompatibilities:
238 * _GNU_SOURCE: glibc does not automatically define _GNU_SOURCE.  Thus,
239   if a program depends on GNU extensions or some other non-standard
240   functionality, it is necessary to compile it with C compiler option
241   -D_GNU_SOURCE, or better, to put `#define _GNU_SOURCE' at the beginning
242   of your source files, before any C library header files are included.
243   This difference normally manifests itself in the form of missing
244   prototypes and/or data type definitions.  Thus, if you get such errors,
245   the first thing you should do is try defining _GNU_SOURCE and see if
246   that makes the problem go away.
248   For more information consult the file `NOTES' part of the GNU C
249   library sources.
251 * reboot(): GNU libc sanitizes the interface of reboot() to be more
252   compatible with the interface used on other OSes.  In particular,
253   reboot() as implemented in glibc takes just one argument.  This argument
254   corresponds to the third argument of the Linux reboot system call.
255   That is, a call of the form reboot(a, b, c) needs to be changed into
256   reboot(c).
257      Beside this the header <sys/reboot.h> defines the needed constants
258   for the argument.  These RB_* constants should be used instead of the
259   cryptic magic numbers.
261 * swapon(): the interface of this function didn't changed, but the
262   prototype is in a separate header file <sys/swap.h>.  For the additional
263   argument of swapon() you should use the SWAP_* constants from
264   <linux/swap.h>, which get defined when <sys/swap.h> is included.
266 * errno: If a program uses variable "errno", then it _must_ include header
267   file <errno.h>.  The old libc often (erroneously) declared this variable
268   implicitly as a side-effect of including other libc header files.  glibc
269   is careful to avoid such namespace pollution, which, in turn, means that
270   you really need to include the header files that you depend on.  This
271   difference normally manifests itself in the form of the compiler
272   complaining about the references of the undeclared symbol "errno".
274 * Linux-specific syscalls: All Linux system calls now have appropriate
275   library wrappers and corresponding declarations in various header files.
276   This is because the syscall() macro that was traditionally used to
277   work around missing syscall wrappers are inherently non-portable and
278   error-prone.  The following tables lists all the new syscall stubs,
279   the header-file declaring their interface and the system call name.
281        syscall name:    wrapper name:   declaring header file:
282        -------------    -------------   ----------------------
283        bdflush          bdflush         <sys/kdaemon.h>
284        create_module    create_module   <sys/module.h>
285        delete_module    delete_module   <sys/module.h>
286        get_kernel_syms  get_kernel_syms <sys/module.h>
287        init_module      init_module     <sys/module.h>
288        syslog           ksyslog_ctl     <sys/klog.h>
290 * lpd: Older versions of lpd depend on a routine called _validuser().
291   The library does not provide this function, but instead provides
292   __ivaliduser() which has a slightly different interfaces.  Simply
293   upgrading to a newer lpd should fix this problem (e.g., the 4.4BSD
294   lpd is known to be working).
296 * resolver functions/BIND: like on many other systems the functions of
297   the resolver library are not included in the libc itself.  There is
298   a separate library libresolv.  If you find some symbols starting with
299   `res_*' undefined simply add -lresolv to your call of the linker.
301 * the `signal' function's behaviour corresponds to the BSD semantic and
302   not the SysV semantic as it was in libc-5.  The interface on all GNU
303   systems shall be the same and BSD is the semantic of choice.  To use
304   the SysV behaviour simply use `sysv_signal'.  The major difference is
305   that the SysV implementation sets the SA_ONESHOT flag and so the handler
306   gets removed after the first call.
309 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
310 [Q10]   ``Why does getlogin() always return NULL on my Linux box?''
312 [A10] {UD} The GNU C library has a format for the UTMP and WTMP file
313 which differs from what your system currently has.  It was extended to
314 fulfill the needs of the next years when IPv6 is introduced.  So the
315 record size is different, fields might have a different position and
316 so reading the files written by functions from the one library cannot
317 be read by functions from the other library.  Sorry, but this is what
318 a major release is for.  It's better to have a cut now than having no
319 means to support the new techniques later.
322 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
323 [Q11]   ``Where are the DST_* constants found in <sys/time.h> on many
324           systems?''
326 [A11] {UD} These constants come from the old BSD days and are not used
327 today anymore (even the Linux based glibc does not implement the handling
328 although the constants are defined).
330 Instead GNU libc contains the zone database handling and compatibility
331 code for POSIX TZ environment variable handling.
334 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
335 [Q12]   ``The `gencat' utility cannot process the input which are
336           successfully used on my Linux libc based system.  Why?''
338 [A12] {UD} Unlike the author of the `gencat' program which is distributed
339 with Linux libc I have read the underlying standards before writing the
340 code.  It is completely compatible with the specification given in
341 X/Open Portability Guide.
343 To ease the transition from the Linux version some of the non-standard
344 features are also present in the `gencat' program of GNU libc.  This
345 mainly includes the use of symbols for the message number and the automatic
346 generation of header files which contain the needed #defines to map the
347 symbols to integers.
349 Here is a simple SED script to convert at least some Linux specific
350 catalog files to the XPG4 form:
352 -----------------------------------------------------------------------
353 # Change catalog source in Linux specific format to standard XPG format.
354 # Ulrich Drepper <drepper@cygnus.com>, 1996.
356 /^\$ #/ {
357   h
358   s/\$ #\([^ ]*\).*/\1/
359   x
360   s/\$ #[^ ]* *\(.*\)/\$ \1/
363 /^# / {
364   s/^# \(.*\)/\1/
365   G
366   s/\(.*\)\n\(.*\)/\2 \1/
368 -----------------------------------------------------------------------
371 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
372 [Q13]   ``How do I configure GNU libc so that the essential libraries
373           like libc.so go into /lib and the other into /usr/lib?''
375 [A13] {UD,AJ} Like all other GNU packages GNU libc is configured to
376 use a base directory and install all files relative to this.  If you
377 intend to really use GNU libc on your system this base directory is
378 /usr.  I.e., you run
379         configure --prefix=/usr <other_options>
381 Some systems like Linux have a filesystem standard which makes a
382 difference between essential libraries and others.  Essential
383 libraries are placed in /lib because this directory is required to be
384 located on the same disk partition as /.  The /usr subtree might be
385 found on another partition/disk.
387 To install the essential libraries which come with GNU libc in /lib
388 one must explicitly tell this (except on Linux, see below).  Autoconf
389 has no option for this so you have to use the file where all user
390 supplied additional information should go in: `configparms' (see the
391 `INSTALL' file).  Therefore the `configparms' file should contain:
393 slibdir=/lib
394 sysconfdir=/etc
396 The first line specifies the directory for the essential libraries,
397 the second line the directory for file which are by tradition placed
398 in a directory named /etc.
400 No rule without an exception: If you configure for Linux with
401 --prefix=/usr, then slibdir and sysconfdir will automatically be
402 defined as stated above.
405 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
406 [Q14]   ``When linking with the new libc I get unresolved symbols
407           `crypt' and `setkey'.  Why aren't these functions in the
408           libc anymore?''
410 [A14] {UD} Remember the US restrictions of exporting cryptographic
411 programs and source code.  Until this law gets abolished we cannot
412 ship the cryptographic function together with the libc.
414 But of course we provide the code and there is an very easy way to use
415 this code.  First get the extra package.  People in the US way get it
416 from the same place they got the GNU libc from.  People outside the US
417 should get the code from ftp.uni-c.dk [129.142.6.74], or another
418 archive site outside the USA.  The README explains how to install the
419 sources.
421 If you already have the crypt code on your system the reason for the
422 failure is probably that you failed to link with -lcrypt.  The crypto
423 functions are in a separate library to make it possible to export GNU
424 libc binaries from the US.
427 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
428 [Q15]   ``What are these `add-ons'?''
430 [A15] {UD} To avoid complications with export rules or external source
431 code some optional parts of the libc are distributed as separate
432 packages (e.g., the crypt package, see Q14).
434 To ease the use as part of GNU libc the installer just has to unpack
435 the package and tell the configuration script about these additional
436 subdirectories using the --enable-add-ons option.  When you add the
437 crypt add-on you just have to use
439         configure --enable-add-ons=crypt,XXX ...
441 where XXX are possible other add-ons and ... means the rest of the
442 normal option list.
444 You can use add-ons also to overwrite some files in glibc.  The add-on
445 system dependent subdirs are search first.  It is also possible to add
446 banner files (use a file named `Banner') or create shared libraries.
448 Using add-ons has the big advantage that the makefiles of the GNU libc
449 can be used.  Only some few stub rules must be written to get
450 everything running.  Even handling of architecture dependent
451 compilation is provided.  The GNU libc's sysdeps/ directory shows how
452 to use this feature.
455 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
456 [Q16]   ``When I use GNU libc on my Linux system by linking against
457           to libc.so which comes with glibc all I get is a core dump.''
459 [A16] {UD} It is not enough to simply link against the GNU libc
460 library itself.  The GNU C library comes with its own dynamic linker
461 which really conforms to the ELF API standard.  This dynamic linker
462 must be used.
464 Normally this is done by the compiler.  The gcc will use
466         -dynamic-linker /lib/ld-linux.so.1
468 unless the user specifies her/himself a -dynamic-linker argument.  But
469 this is not the correct name for the GNU dynamic linker.  The correct
470 name is /lib/ld.so.1 which is the name specified in the SVr4 ABi.
472 To change your environment to use GNU libc for compiling you need to
473 change the `specs' file of your gcc.  This file is normally found at
475         /usr/lib/gcc-lib/<arch>/<version>/specs
477 In this file you have to change a few things:
479 - change `ld-linux.so.1' to `ld.so.1' (or to ld-linux.so.2, see below)
481 - remove all expression `%{...:-lgmon}';  there is no libgmon in glibc
484 Things are getting a bit more complicated if you have GNU libc
485 installed in some other place than /usr, i.e., if you do not want to
486 use it instead of the old libc.  In this case the needed startup files
487 and libraries are not found in the regular places.  So the specs file
488 must tell the compiler and linker exactly what to use.  Here is for
489 example the gcc-2.7.2 specs file when GNU libc is installed at
490 /usr:
492 -----------------------------------------------------------------------
493 *asm:
494 %{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
496 *asm_final:
497 %{pipe:-}
499 *cpp:
500 %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
502 *cc1:
503 %{profile:-p}
505 *cc1plus:
508 *endfile:
509 %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
511 *link:
512 -m elf_i386 %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static:        %{rdynamic:-export-dynamic}     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}}  %{static:-static}}}
514 *lib:
515 %{!shared: %{pthread:-lpthread}         %{profile:-lc_p} %{!profile: -lc}}
517 *libgcc:
518 -lgcc
520 *startfile:
521 %{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                   %{!p:%{profile:gcrt1.o%s}                         %{!profile:crt1.o%s}}}}    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
523 *switches_need_spaces:
526 *signed_char:
527 %{funsigned-char:-D__CHAR_UNSIGNED__}
529 *predefines:
530 -D__ELF__ -Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386)
532 *cross_compile:
535 *multilib:
536 . ;
538 -----------------------------------------------------------------------
540 The above is currently correct for ix86/Linux.  Because of
541 compatibility issues on this platform the dynamic linker must have
542 a different name: ld-linux.so.2.  So you have to replace
544         %{!dynamic-linker:-dynamic-linker=/home/gnu/lib/ld-linux.so.2}
546         %{!dynamic-linker:-dynamic-linker=/home/gnu/lib/ld.so.1}
548 in the above example specs file to make it work for other systems.
550 Future versions of GCC will automatically provide the correct specs.
553 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
554 [Q17]   ``Looking through the shared libc file I haven't found the
555           functions `stat', `lstat', `fstat', and `mknod' and while
556           linking on my Linux system I get error messages.  How is
557           this supposed to work?''
559 [A17] {RM} Believe it or not, stat and lstat (and fstat, and mknod)
560 are supposed to be undefined references in libc.so.6!  Your problem is
561 probably a missing or incorrect /usr/lib/libc.so file; note that this
562 is a small text file now, not a symlink to libc.so.6.  It should look
563 something like this:
565 GROUP ( libc.so.6 ld.so.1 libc.a )
568 {UD} The Linux ldconfig file probably generates a link libc.so ->
569 libc.so.6 in /lib.  This is not correct.  There must not be such a
570 link.  The linker script with the above contents is placed in
571 /usr/lib which is enough for the linker.
574 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
575 [Q18]   ``The prototypes for `connect', `accept', `getsockopt',
576           `setsockopt', `getsockname', `getpeername', `send',
577           `sendto', and `recvfrom' are different in GNU libc from
578           any other system I saw.  This is a bug, isn't it?''
580 [A18] {UD} No, this is no bug.  This version of the GNU libc already
581 follows the to-be-released POSIX.1g standard.  In this standard
582 the type `size_t' is used for all parameters which describe a size.
583 So better change now.
585 This change is critical for system which have
586         sizeof (int) != sizeof (size_t)
587 like the Alpha.
590 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
591 [Q19]   ``My XXX kernel emulates a floating-point coprocessor for me.
592           Should I enable --with-fp?''
594 [A19] {UD} As `configure --help' shows the default value is `yes' and
595 this should not be changed unless the FPU instructions would be
596 invalid.  I.e., an emulated FPU is for the libc as good as a real one.
599 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
600 [Q20]   ``How can I compile gcc 2.7.2.1 from the gcc source code using
601           glibc 2.x?
603 [A20] {HJL} There is no support in gcc for glibc 2.0 before gcc 2.8. It
604 is very tricky to compile gcc 2.7.2.1 using glibc 2.x. You have to
605 build it manually or with one pass only. You also have to use the
606 specs file in this FAQ while compiling gcc.
608 A pre-compiled binary version of gcc 2.7.2.1 linked with glibc 2.x for
609 Linux/x86 is available in the same directory at the glibc 2.x source
610 code ftp sites.
613 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
615 Answers were given by:
616 {UD} Ulrich Drepper, <drepper@cygnus.com>
617 {DMT} David Mosberger-Tang, <davidm@AZStarNet.com>
618 {RM} Roland McGrath, <roland@gnu.ai.mit.edu>
619 {HJL} H.J. Lu, <hjl@gnu.ai.mit.edu>
620 {AJ} Andreas Jaeger, <aj@arthur.pfalz.de>
622 Local Variables:
623  mode:text
624 End: