赞
踩
This document tries to answer questions a user might have when installing and using glibc. Please make sure you read this before sending questions or bug reports to the maintainers.
The GNU C library is very complex. The installation process has not been completely automated; there are too many variables. You can do substantial damage to your system by installing the library incorrectly. Make sure you understand what you are undertaking before you begin.
If you have any questions you think should be answered in this document, please let me know.
--drepper@redhat.com
1.1. What systems does the GNU C Library run on?
1.2. What compiler do I need to build GNU libc?
1.3. When I try to compile glibc I get only error messages. What's wrong?
1.4. Do I need a special linker or assembler?
1.5. Which compiler should I use for powerpc?
1.6. Which tools should I use for ARM?
1.7. Do I need some more things to compile the GNU C Library?
1.8. What version of the Linux kernel headers should be used?
1.9. The compiler hangs while building iconvdata modules. What's wrong?
1.11. What are these `add-ons'?
1.12. My XXX kernel emulates a floating-point coprocessor for me. Should I enable --with-fp?
1.15. What's the problem with configure --enable-omitfp?
1.16. I get failures during `make check'. What should I do?
1.17. What is symbol versioning good for? Do I need it?
1.20. Which tools should I use for MIPS?
1.21. Which compiler should I use for powerpc64?
2. Installation and configuration issues
2.1. Can I replace the libc on my Linux system with GNU libc?
2.3. How should I avoid damaging my system when I install GNU libc?
2.4. Do I need to use GNU CC to compile programs that will use the GNU C Library?
2.9. How can I compile gcc 2.7.2.1 from the gcc source code using glibc 2.x?
2.13. I have killed ypbind to stop using NIS, but glibc continues using NIS.
2.15. After installing glibc name resolving doesn't work properly.
2.16. How do I create the databases for NSS?
2.21. What do I need for C++ development?
2.24. When I use nscd the machine freezes.
2.25. I need lots of open files. What do I have to do?
2.26. How do I get the same behavior on parsing /etc/passwd and /etc/group as I have with libc5 ?
2.27. What needs to be recompiled when upgrading from glibc 2.0 to glibc 2.1?
2.28. Why is extracting files via tar so slow?
2.31. What happened to the Berkeley DB libraries? Can I still use db in /etc/nsswitch.conf?
2.32. What has do be done when upgrading to glibc 2.2?
2.33. The makefiles want to do a CVS commit.
2.34. When compiling C++ programs, I get a compilation error in streambuf.h.
2.35. When recompiling GCC, I get compilation errors in libio.
2.36. Why shall glibc never get installed on GNU/Linux systems in /usr/local?
2.37. When recompiling GCC, I get compilation errors in libstdc++.
3. Source and binary incompatibilities, and what to do about them
3.2. Why does getlogin() always return NULL on my Linux box?
3.3. Where are the DST_* constants found in <sys/time.h> on many systems?
3.5. On Linux I've got problems with the declarations in Linux kernel headers.
3.7. Why don't signals interrupt system calls anymore?
3.8. I've got errors compiling code that uses certain string functions. Why?
3.9. I get compiler messages "Initializer element not constant" with stdin/stdout/stderr. Why?
3.10. I can't compile with gcc -traditional (or -traditional-cpp). Why?
3.11. I get some errors with `gcc -ansi'. Isn't glibc ANSI compatible?
3.15. The sys/sem.h file lacks the definition of `union semun'.
3.16. Why has <netinet/ip_fw.h> disappeared?
3.17. I get floods of warnings when I use -Wconversion and include <string.h> or <math.h>.
3.19. bonnie reports that char i/o with glibc 2 is much slower than with libc5. What can be done?
3.23. I get "undefined reference to `atexit'"
4.4. What other sources of documentation about glibc are available?
4.6. I've build make 3.77 against glibc 2.1 and now make gets segmentation faults.
4.7. Why do so many programs using math functions fail on my AlphaStation?
4.8. The conversion table for character set XX does not match with what I expect.
4.9. How can I find out which version of glibc I am using in the moment?
4.10. Context switching with setcontext() does not work from within signal handlers.
The systems glibc is known to work on as of this release, and most probably in the future, are:
*-*-gnu GNU Hurd i[3456]86-*-linux-gnu Linux-2.x on Intel m68k-*-linux-gnu Linux-2.x on Motorola 680x0 alpha*-*-linux-gnu Linux-2.x on DEC Alpha powerpc-*-linux-gnu Linux and MkLinux on PowerPC systems powerpc64-*-linux-gnu Linux-2.4+ on 64-bit PowerPC systems sparc-*-linux-gnu Linux-2.x on SPARC sparc64-*-linux-gnu Linux-2.x on UltraSPARC arm-*-none ARM standalone systems arm-*-linux Linux-2.x on ARM arm-*-linuxaout Linux-2.x on ARM using a.out binaries mips*-*-linux-gnu Linux-2.x on MIPS ia64-*-linux-gnu Linux-2.x on ia64 s390-*-linux-gnu Linux-2.x on IBM S/390 s390x-*-linux-gnu Linux-2.x on IBM S/390 64-bit cris-*-linux-gnu Linux-2.4+ on CRIS
Ports to other Linux platforms are in development, and may in fact work already, but no one has sent us success reports for them. Currently no ports to other operating systems are underway, although a few people have expressed interest.
If you have a system not listed above (or in the `README' file) and you are really interested in porting it, contact
<bug-glibc@gnu.org>
GNU CC is found, like all other GNU packages, on
ftp://ftp.gnu.org/pub/gnu
and the many mirror sites. ftp.gnu.org is always overloaded, so try to find a local mirror first.
You should always try to use the latest official release. Older versions may not have all the features GNU libc requires. The current releases of gcc (3.2 or newer) should work with the GNU C library (for MIPS see question 1.20).
Please note that gcc 2.95 and 2.95.x cannot compile glibc on Alpha due to problems in the complex float support.
We recommend version GNU make version 3.79 or newer. Older versions have bugs and/or are missing features.
For Linux or Hurd, you want binutils 2.13 or higher. These are the only versions we've tested and found reliable. Other versions may work but we don't recommend them, especially not when C++ is involved.
Other operating systems may come with system tools that have all the necessary features, but this is moot because glibc hasn't been ported to them.
You should not need these tools unless you change the source files.
You should avoid compiling in a NFS mounted filesystem. This is very slow.
James Troup <J.J.Troup@comp.brad.ac.uk> reports a compile time for an earlier (and smaller!) version of glibc of 45h34m for a full build (shared, static, and profiled) on Atari Falcon (Motorola 68030 @ 16 Mhz, 14 Mb memory) and Jan Barte <yann@plato.uni-paderborn.de> reports 22h48m on Atari TT030 (Motorola 68030 @ 32 Mhz, 34 Mb memory)
A full build of the PowerPC library took 1h on a PowerPC 750@400Mhz w/ 64MB of RAM, and about 9h on a 601@60Mhz w/ 72Mb.
If you have some more measurements let me know.
{ZW} Even if you are using a 2.0 kernel on your machine, we recommend you compile GNU libc with 2.2 kernel headers. That way you won't have to recompile libc if you ever upgrade to kernel 2.2. To tell libc which headers to use, give configure the --with-headers switch (e.g. --with-headers=/usr/src/linux-2.2.0/include).
Note that you must configure the 2.2 kernel if you do this, otherwise libc will be unable to find <linux/version.h>. Just change the current directory to the root of the 2.2 tree and do `make include/linux/version.h'.
To use these packages as part of GNU libc, just unpack the tarfiles in the libc source directory and tell the configuration script about them using the --enable-add-ons option. If you give just --enable-add-ons configure tries to find all the add-on packages in your source tree. This may not work. If it doesn't, or if you want to select only a subset of the add-ons, give a comma-separated list of the add-ons to enable:
configure --enable-add-ons=linuxthreads
for example.
Add-ons can add features (including entirely new shared libraries), override files, provide support for additional architectures, and just about anything else. The existing makefiles do most of the work; only some few stub rules must be written to get everything running.
Most add-ons are tightly coupled to a specific GNU libc version. Please check that the add-ons work with the GNU libc. For example the linuxthreads add-on has the same numbering scheme as the libc and will in general only work with the corresponding libc.
{AJ} With glibc 2.2 the crypt add-on and with glibc 2.1 the localedata add-on have been integrated into the normal glibc distribution, crypt and localedata are therefore not anymore add-ons.
People who are interested in squeezing the last drop of performance out of their machine may wish to avoid the trap overhead, but this is far more trouble than it's worth: you then have to compile *everything* this way, including the compiler's internal libraries (libgcc.a for GNU C), because the calling conventions change.
One thing that is particularly annoying about this problem is that once this is misdetected, running configure again won't fix it unless you first delete config.cache.
{UD} Starting with glibc-2.0.3 there should be a better test to avoid some problems of this kind. The setting of CFLAGS is checked at the very beginning and if it is not usable `configure' will bark.
gcc -o foo foo.c -Wl,-rpath-link=/some/other/dir -lrt
The `/some/other/dir' should contain the thread library. `ld' will use the given path to find the implicitly referenced library while not disturbing any other link path.
If you use --enable-omitfp, you're on your own. If you encounter problems with a library that was build this way, we advise you to rebuild the library without --enable-omitfp. If the problem vanishes consider tracking the problem down and report it as compiler failure.
Since a library built with --enable-omitfp is undebuggable on most systems, debuggable libraries are also built - you can use them by appending "_g" to the library names.
The compilation of these extra libraries and the compiler optimizations slow down the build process and need more disk space.
You should consider using the `glibcbug' script to report the failure, providing as much detail as possible. If you run a test directly, please remember to set up the environment correctly. You want to test the compiled library - and not your installed one. The best way is to copy the exact command line which failed and run the test from the subdirectory for this test in the sources.
There are some failures which are not directly related to the GNU libc:
We don't advise building without symbol versioning, since you lose binary compatibility - forever! The binary compatibility you lose is not only against the previous version of the GNU libc (version 2.0) but also against all future versions.
../configure --prefix=/usr i386-pc-linux-gnu
And you need to tell gcc to only generate i386 code, just add `-mcpu=i386' (just -m386 doesn't work) to your CFLAGS.
{UD} This applies not only to the i386. Compiling on a i686 for any older model will also fail if the above methods are not used.
After upgrading make, you should remove the file sysd-sorted in your build directory. The problem is that the broken make creates a wrong order for one list in that file. The list has to be recreated with the new make - which happens if you remove the file.
You might encounter this bug also in other situations where make scans directories. I strongly advise to upgrade your make version to 3.79 or newer.
You need also recent binutils, anything before and including 2.11 will not work correctly. Either try the Linux binutils 2.11.90.0.5 from HJ Lu or the current development version of binutils from CVS.
Please note that `make check' might fail for a number of the math tests because of problems of the FPU emulation in the Linux kernel (the MIPS FPU doesn't handle all cases and needs help from the kernel).
For details check also my page http://www.suse.de/~aj/glibc-mips.html.
For Linux there are three major libc versions:
libc-4 a.out libc libc-5 original ELF libc libc-6 GNU libc
You can have any combination of these three installed. For more information consult documentation for shared library handling. The Makefiles of GNU libc will automatically generate the needed symbolic links which the linker will use.
Some systems like Linux have a filesystem standard which makes a difference between essential libraries and others. Essential libraries are placed in /lib because this directory is required to be located on the same disk partition as /. The /usr subtree might be found on another partition/disk. If you configure for Linux with --prefix=/usr, then this will be done automatically.
To install the essential libraries which come with GNU libc in /lib on systems other than Linux one must explicitly request it. Autoconf has no option for this so you have to use a `configparms' file (see the `INSTALL' file for details). It should contain:
slibdir=/lib sysconfdir=/etc
The first line specifies the directory for the essential libraries, the second line the directory for system configuration files.
The dangers when installing glibc in /usr are twofold:
However, there are currently no ports of glibc to systems where another compiler is the default, so no one has tested the headers extensively against another compiler. You may therefore encounter difficulties. If you do, please report them as bugs.
Also, in several places GNU extensions provide large benefits in code quality. For example, the library has hand-optimized, inline assembly versions of some string functions. These can only be used with GCC. See question 3.8 for details.
For casual use of GNU libc you can just specify to the linker
--dynamic-linker=/lib/ld-linux.so.2
which is the glibc dynamic linker, on Linux systems. On other systems the name is /lib/ld.so.1. When linking via gcc, you've got to add
-Wl,--dynamic-linker=/lib/ld-linux.so.2
to the gcc command line.
To change your environment to use GNU libc for compiling you need to change the `specs' file of your gcc. This file is normally found at
/usr/lib/gcc-lib/<arch>/<version>/specs
In this file you have to change a few things:
*asm_final: %|
*cpp: %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
*cc1: %{profile:-p}
*cc1plus:
*endfile: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
*link: -m elf_i386 %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static}}}
*lib: %{!shared: %{pthread:-lpthread} %{profile:-lc_p} %{!profile: -lc}}
*libgcc: -lgcc
*startfile: %{!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}
*switches_need_spaces:
*signed_char: %{funsigned-char:-D__CHAR_UNSIGNED__}
*predefines: -D__ELF__ -Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386)
*cross_compile: 0
*multilib: . ;
Things get a bit more complicated if you have GNU libc installed in some other place than /usr, i.e., if you do not want to use it instead of the old libc. In this case the needed startup files and libraries are not found in the regular places. So the specs file must tell the compiler and linker exactly what to use.
Version 2.7.2.3 does and future versions of GCC will automatically provide the correct specs.
GROUP ( libc.so.6 libc_nonshared.a )
When you link your program, it resolves its references to the exception functions to the ones exported accidentally by libc.so. That works fine as long as libc has those functions. On the other system, libc doesn't have those functions because it was compiled by gcc 2.8, and you get undefined symbol errors. The symbols in question are named things like `__register_frame_info'.
For glibc 2.0, the workaround is to not compile libc with egcs. We've also incorporated a patch which should prevent the EH functions sneaking into libc. It doesn't matter what compiler you use to compile your program.
For glibc 2.1, we've chosen to do it the other way around: libc.so explicitly provides the EH functions. This is to prevent other shared libraries from doing it.
{UD} Starting with glibc 2.1.1 you can compile glibc with gcc 2.8.1 or newer since we have explicitly add references to the functions causing the problem. But you nevertheless should use EGCS for other reasons (see question 1.2).
{GK} On some Linux distributions for PowerPC, you can see this when you have built gcc or egcs from the Web sources (gcc versions 2.95 or earlier), then re-built glibc. This happens because in these versions of gcc, exception handling is implemented using an older method; the people making the distributions are a little ahead of their time.
A quick solution to this is to find the libgcc.a file that came with the distribution (it would have been installed under /usr/lib/gcc-lib), do `ar x libgcc.a frame.o' to get the frame.o file out, and add a line saying `LDLIBS-c.so += frame.o' to the file `configparms' in the directory you're building in. You can check you've got the right `frame.o' file by running `nm frame.o' and checking that it has the symbols defined that you're missing.
This will let you build glibc with the C compiler. The C++ compiler will still be binary incompatible with any C++ shared libraries that you got with your distribution.
To ease the transition from the Linux version some of the non-standard features are also present in the `gencat' program of GNU libc. This mainly includes the use of symbols for the message number and the automatic generation of header files which contain the needed #defines to map the symbols to integers.
Here is a simple SED script to convert at least some Linux specific catalog files to the XPG4 form:
# Change catalog source in Linux specific format to standard XPG format. # Ulrich Drepper <drepper@redhat.com>, 1996. # /^/$ #/ { h s//$ #/([^ ]*/).*//1/ x s//$ #[^ ]* */(.*/)//$ /1/ }
/^# / { s/^# /(.*/)//1/ G s//(.*/)/n/(.*/)//2 /1/ }
localedef -i fr_CA -f ISO-8859-1 fr_CA
Please see localedata/README in the source tree for further details.
http://www.suse.de/~kukuk/linux/nisplus.html
ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypbind-3.3-glibc4.diff.gz
The only way to fix this is to recompile your program. Sorry, that's the price you might have to pay once for quite a number of advantages with symbol versioning.
Such symbols should normally not be used at all. There are mechanisms to avoid using them. In the case of _sys_errlist, there is the strerror() function which should _always_ be used instead. So the correct fix is to rewrite that part of the application.
In some situations (especially when testing a new library release) it might be possible that a symbol changed size when that should not have happened. So in case of doubt report such a warning message as a problem.
ftp://alpha.gnu.org/gnu/libstdc++-2.8.1.1-glibc2.1-diff.gz
Please note that libg++ 2.7.2 (and the Linux Versions 2.7.2.x) doesn't work very well with the GNU C library due to vtable thunks. If you're upgrading from glibc 2.0.x to 2.1 you have to recompile libstdc++ since the library compiled for 2.0 is not compatible due to the new Large File Support (LFS) in version 2.1.
{UD} But since in the case of a shared libstdc++ the version numbers should be different existing programs will continue to work.
A solution is to configure glibc with --enable-static-nss. In this case you can create a static binary that will use only the services dns and files (change /etc/nsswitch.conf for this). You need to link explicitly against all these services. For example:
gcc -static test-netdb.c -o test-netdb / -Wl,--start-group -lc -lnss_files -lnss_dns -lresolv -Wl,--end-group
The problem with this approach is that you've got to link every static program that uses NSS routines with all those libraries.
{UD} In fact, one cannot say anymore that a libc compiled with this option is using NSS. There is no switch anymore. Therefore it is *highly* recommended *not* to use --enable-static-nss since this makes the behaviour of the programs on the system inconsistent.
The most common case is that glibc put its `libc.so' in /usr/lib, but there was a `libc.so' from libc 5 in /lib, which gets searched first. To fix the problem, just delete /lib/libc.so. You may also need to delete other symbolic links in /lib, such as /lib/libm.so if it points to libm.so.5.
{AJ} The perl script test-installation.pl which is run as last step during an installation of glibc that is configured with --prefix=/usr should help detect these situations. If the script reports problems, something is really screwed up.
If you need nscd, you have to use at least a 2.1 kernel.
Note that I have at this point no information about any other platform.
The GNU C library is now select free. This means it internally has no limits imposed by the `fd_set' type. Instead all places where the functionality is needed the `poll' function is used.
If you increase the number of file descriptors in the kernel you don't need to recompile the C library.
{UD} You can always get the maximum number of file descriptors a process is allowed to have open at any time using
number = sysconf (_SC_OPEN_MAX);
This will work even if the kernel limits change.
passwd: compat group: compat shadow: compat
passwd_compat: nis group_compat: nis shadow_compat: nis
If you compile your own binaries against glibc 2.1, you also need to recompile some other libraries. The problem is that libio had to be changed and therefore libraries that are based or depend on the libio of glibc, e.g. ncurses, slang and most C++ libraries, need to be recompiled. If you experience strange segmentation faults in your programs linked against glibc 2.1, you might need to recompile your libraries.
Another problem is that older binaries that were linked statically against glibc 2.0 will reference the older nss modules (libnss_files.so.1 instead of libnss_files.so.2), so don't remove them. Also, the old glibc-2.0 compiled static libraries (libfoo.a) which happen to depend on the older libio behavior will be broken by the glibc 2.1 upgrade. We plan to produce a compatibility library that people will be able to link in if they want to compile a static library generated against glibc 2.0 into a program on a glibc 2.1 system. You just add -lcompat and you should be fine.
The glibc-compat add-on will provide the libcompat.a library, the older nss modules, and a few other files. Together, they should make it possible to do development with old static libraries on a glibc 2.1 system. This add-on is still in development. You can get it from
ftp://alpha.gnu.org/gnu/glibc/glibc-compat-2.1.tar.gzbut please keep in mind that it is experimental.
In file included from /usr/include/stdio.h:57, from ... /usr/include/libio.h:335: parse error before `_IO_seekoff' /usr/include/libio.h:335: parse error before `_G_off64_t' /usr/include/libio.h:336: parse error before `_IO_seekpos' /usr/include/libio.h:336: parse error before `_G_fpos64_t'
The problem is a wrong _G_config.h file in your include path. The _G_config.h file that comes with glibc 2.1 should be used and not one from libc5 or from a compiler directory. To check which _G_config.h file the compiler uses, compile your program with `gcc -E ...|grep G_config.h' and remove that file. Your compiler should pick up the file that has been installed by glibc 2.1 in your include directory.
The NSS db module has been rewritten to support a number of different versions of Berkeley DB for the NSS db module. Currently the releases 2.x and 3.x of Berkeley DB are supported. The older db 1.85 library is not supported. You can use the version from glibc 2.1.x or download a version from Sleepycat Software (http://www.sleepycat.com). The library has to be compiled as shared library and installed in the system lib directory (normally /lib). The library needs to have a special soname to be found by the NSS module.
If public structures change in a new Berkeley db release, this needs to be reflected in glibc.
Currently the code searches for libraries with a soname of "libdb.so.3" (that's the name from db 2.4.14 which comes with glibc 2.1.x) and "libdb-3.0.so" (the name used by db 3.0.55 as default).
The nss_db module is now in a separate package since it requires a database library being available.
http://www.haible.de/bruno/gccinclude-glibc-2.2-compat.diff
http://www.haible.de/bruno/gcc-3.2-glibc-2.3-compat.diff
For more information consult the file `NOTES' in the GNU C library sources.
syscall name: wrapper name: declaring header file: ------------- ------------- ---------------------- bdflush bdflush <sys/kdaemon.h> syslog ksyslog_ctl <sys/klog.h>
Instead GNU libc contains zone database support and compatibility code for POSIX TZ environment variable handling. For former is very much preferred (see question 4.3).
For example, the sigset_t type is 32 or 64 bits wide in the kernel. In glibc it is 1024 bits wide. This guarantees that when the kernel gets a bigger sigset_t (for POSIX.1e realtime support, say) user programs will not have to be recompiled. Consult the header files for more information about the changes.
Therefore you shouldn't include Linux kernel header files directly if glibc has defined a replacement. Otherwise you might get undefined results because of type conflicts.
There might be some problems left but 2.1.61/2.0.32 fix most of the known ones. See the BUGS file for other known problems.
There are three differences:
If you are porting an old program that relies on the old semantics, you can quickly fix the problem by changing signal() to sysv_signal() throughout. Alternatively, define _XOPEN_SOURCE before including <signal.h>.
For new programs, the sigaction() function allows you to specify precisely how you want your signals to behave. All three differences listed above are individually switchable on a per-signal basis with this function.
If all you want is for one specific signal to cause system calls to fail and return EINTR (for example, to implement a timeout) you can do this with siginterrupt().
The optimized string functions are only used when compiling with optimizations (-O1 or higher). The behavior can be changed with two feature macros:
{UD} Another problem in this area is that gcc still has problems on machines with very few registers (e.g., ix86). The inline assembler code can require almost all the registers and the register allocator cannot always handle this situation.
One can disable the string optimizations selectively. Instead of writing
cp = strcpy (foo, "lkj");
one can write
cp = (strcpy) (foo, "lkj");
This disables the optimization for that specific call.
static FILE *InPtr = stdin;
lead to this message. This is correct behaviour with glibc since stdin is not a constant expression. Please note that a strict reading of ISO C does not allow above constructs.
One of the advantages of this is that you can assign to stdin, stdout, and stderr just like any other global variable (e.g. `stdout = my_stream;'), which can be very useful with custom streams that you can write with libio (but beware this is not necessarily portable). The reason to implement it this way were versioning problems with the size of the FILE structure.
To fix those programs you've got to initialize the variable at run time. This can be done, e.g. in main, like:
static FILE *InPtr; int main(void) { InPtr = stdin; }
or by constructors (beware this is gcc specific):
static FILE *InPtr; static void inPtr_construct (void) __attribute__((constructor)); static void inPtr_construct (void) { InPtr = stdin; }
enum {foo #define foo foo }
are useful for debugging purposes (you can use foo with your debugger that's why we need the enum) and for compatibility (other systems use defines and check with #ifdef).
The GNU C library is conforming to ANSI/ISO C - if and only if you're only using the headers and library functions defined in the standard.
-Wconversion isn't really intended for production use, only for shakedown compiles after converting an old program to standard C.
The path /lib/ld-linux.so.2 is hardcoded in every glibc2 binary but libc.so.6 is searched via /etc/ld.so.cache and in some special directories like /lib and /usr/lib. If you run configure with another prefix than /usr and put this prefix before /lib in /etc/ld.so.conf, your system will break.
So what can you do? Either of the following should work:
LD_LIBRARY_PATH=<path-where-libc.so.6-lives> / <path-where-corresponding-dynamic-linker-lives>/ld-linux.so.2 / <path-to-binary>/binary
For example `LD_LIBRARY_PATH=/libold /libold/ld-linux.so.2 /bin/mv ...' might be useful in fixing a broken system (if /libold contains dynamic linker and corresponding libc).
With that command line no path is used. To further debug problems with the dynamic linker, use the LD_DEBUG environment variable, e.g. `LD_DEBUG=help echo' for the help text.
If you just want to test this release, don't put the lib directory in /etc/ld.so.conf. You can call programs directly with full paths (as above). When compiling new programs against glibc 2.1, you've got to specify the correct paths to the compiler (option -I with gcc) and linker (options --dynamic-linker, -L and --rpath).
Your program should check at runtime whether the function works, and implement a fallback. Note that Autoconf cannot detect unimplemented functions in other systems' C libraries, so you need to do this anyway.
In general, you should use the correct deallocation routine. For instance, if you open a file using fopen(), you should deallocate the FILE * using fclose(), not free(), even though the FILE * is also a pointer.
In the case of setmntent(), it may appear to work in most cases, but it won't always work. Unfortunately, for compatibility reasons, we can't change the return type of setmntent() to something other than FILE *.
If a similar message is issued at runtime this means that the application or DSO is not linked against libc. This can cause problems since 'atexit' is not exported anymore.
{PB} The 2.1 release of GNU libc aims to comply with the current versions of all the relevant standards. The IPv6 support libraries for older Linux systems used a different naming convention and so code written to work with them may need to be modified. If the standards make incompatible changes in the future then the libc may need to change again.
IPv6 will not work with a 2.0.x kernel. When kernel 2.2 is released it should contain all the necessary support; until then you should use the latest 2.1.x release you can find. As of 98/11/26 the currently recommended kernel for IPv6 is 2.1.129.
Also, as of the 2.1 release the IPv6 API provided by GNU libc is not 100% complete.
The alternative approach to handle timezones which is implemented is the correct one to use: use the timezone database. This avoids all the problems the POSIX method has plus it is much easier to use. Simply run the tzselect shell script, answer the question and use the name printed in the end by making a symlink /etc/localtime pointing to /usr/share/zoneinfo/NAME (NAME is the returned value from tzselect). That's all. You never again have to worry.
So, please avoid sending bug reports about time related problems if you use the POSIX method and you have not verified something is really broken by reading the POSIX standards.
Please note that this is not a complete list.
Eastern Standard Time = EST Eastern Summer Time = EST
Great! To get this bug fixed convince the authorities to change the laws and regulations of the country this effects. glibc behaves correctly.
Before doing this look through the list of known problem first:
+0xA1AA 0x2015 +0xA844 0x2014 -0xA1AA 0x2014 -0xA844 0x2015
In addition the Unicode tables contain mappings for the GBK characters 0xA8BC, 0xA8BF, 0xA989 to 0xA995, and 0xFE50 to 0xFEA0.
/lib/libc.so.6
This will produce all the information you need.
What always will work is to use the API glibc provides. Compile and run the following little program to get the version information:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include <stdio.h> #include <gnu/libc-version.h> int main (void) { puts (gnu_get_libc_version ()); return 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This interface can also obviously be used to perform tests at runtime if this should be necessary.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。