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