Glibc Installation Guide

Source: Internet
Author: User
Tags gmp
Glibc Installation Guide (applicable to 2.3/2.4/2.5/2.6/2.7) glibc Installation Guide (applicable to 2.3/2.4/2.5/2.6/2.7) pre-compilation preparation and Key Tips

Glibc-2.3.6 recommends GCC-4.0 compilation, Glibc-2.4/2.5 recommends GCC-4.1 compilation, and Glibc-2.6/2.7 recommends GCC-4.2 compilation. All of these versions require GCC-3.4 compilation at least.

The version of the kernel header file used for compiling glibc is higher than the version of the kernel running glibc. If the actual running kernel version is higher than the header file version, the new features of the new kernel will not be available. For more details, refer to the follow-up section of the [gossip story] kernel header file legend.

Do not install glibc on a running system. Otherwise, the system will crash. At least install the new glibc in a separate directory to ensure that the current glibc is not overwritten.

Glibc cannot be compiled in the source code directory. It must be compiled in an extra separate directory. In this way, when an error occurs during compilation, you can delete the entire compilation directory and start again.

When running the configure script, you can set the CC cflags ldflags environment variable to optimize compilation. Syntax: Configure [Option]... [Var = value]...

Note that some test projects are executed as non-root, So we strongly recommend that you use a non-root identity to compile and test glibc.

Configuration Options

The following options areNon-default value[Unless otherwise specified]

-- Help
-- Version
-- Silent
-- Cache-file = File
-- Config-Cache
-- No-create
-- Srcdir = dir
-- Exec-Prefix = eprefix
-- Bindir = dir
-- Sbindir = dir
-- Libexecdir = dir
-- Sysconfdir = dir
-- Sharedstatedir = dir
-- Localstatedir = dir
-- Libdir = dir
-- Includedir = dir
-- Oldincludedir = dir
-- Datarootdir = dir
-- Datadir = dir
-- Infodir = dir
-- Localedir = dir
-- Mandir = dir
-- Docdir = dir
-- Htmldir = dir
-- Dvidir = dir
-- Export dir = dir
-- Psdir = dir
-- Build = build
-- Host = Host
The meanings of these options are basically used in all software packages.
-- Prefix = prefix
Installation directory. The default value is/usr/local.
Linux File System Standards require that the basic library be located in the/lib directory and must be in the same partition as the root directory, but/usr can be in other partitions or even other disks. Therefore, if -- prefix =/usr is specified, the basic library is automatically installed in the/lib directory, instead of the basic library, it is automatically installed in the/usr/lib directory. However, if you keep the default value or specify other directories, all components are installed in the prefix directory.
-- Enable-add-ons [= dir1, dir2,...]
Compile additional software packages in dir1, dir2. The "dir" is the Directory Name of the additional software package. If the list is not specified or "yes" is specified, compile the additional software packages found in the root directory of all source code. The Glibc-2.4/2.5/2.6/2.7 defaults to "yes", and the Glibc-2.3.6 defaults to -- disable-add-ons.
-- Disable-shared
Do not compile the Shared Library (even if it is supported by the platform ). On systems that support elf and use the GNU connector, the default value is -- enable-shared. [Note] the -- disable-static option is actually invalid, and the static library is always compiled and installed unconditionally.
-- Enable-bind-now
Disable "lazy binding", that is, when the dynamic connector is loaded into DSO, all symbols are parsed (no matter whether the application is used or not). The default behavior is "lazy binding ", that is, the symbol is parsed only when the application is used for the first time. In most cases, the application does not need to use all the symbols in the dynamic library, so the default "lazy binding" can improve the loading performance of the application and save memory usage. However, in both cases, "lazy binding" is unfavorable: ① because when the function in DSO is called for the first time, the dynamic connector must intercept the call to parse the symbol, therefore, it takes longer to reference a function in DSO than to call a function again. However, some applications cannot tolerate this unpredictability. ② If an error occurs and the dynamic connector cannot parse this symbol, the dynamic connector terminates the entire program. In "lazy
Binding mode. Some applications cannot tolerate such unpredictability. By turning off the "lazy binding" method, let the dynamic connector discover these errors during process initialization before the application accepts control, instead of getting out of the box at runtime.
-- Enable-bounded
Enabling runtime boundary check (for example, array out-of-bounds) can reduce the running efficiency but prevent some overflow vulnerabilities.
-- Disable-force-install
Do not force installation of the current compiled version (even if the existing file version is updated ).
-- Disable-hidden-PLT
By default, functions that are only called internally are hidden to prevent these functions from being added to the procedural linked table (PLT, procedure linkage table, this reduces the volume of PLT and hides functions that are only used internally. This option exposes these functions to external users.
-- Enable-kernel = version
The version format is x.y. Z, indicating the lowest kernel version supported by compiled glibc. The higher the version value (cannot exceed the version of the kernel header file), the less compatible code is added, and the faster the database runs.
-- Enable-Oldest-Abi = Abi
Enable binary Interface Support for earlier application versions. Abi is the version number of the old glibc. The default value is -- disable-Oldest-Abi in most cases. We recommend that you specify -- disable-Oldest-Abi
-- Enable-check-Abi
Run "make check-Abi" when "make check ". [Prompt] The check-Abi-libm test always fails on my machine.
-- Disable-Versioning
Does not include the version information of the symbol in the shared library object. This can reduce the size of the database, but will not be compatible with binary programs of the old version C library. [Prompt] using this option on my machine will always cause compilation failure.
-- Enable-omitfp
The frame indicator is ignored during compilation (Compiled using-fomit-frame-pointer) and some other optimization measures are taken. Ignore frame indicator can improve the running efficiency, but debugging will become unavailable and may generate code containing bugs. Using this option will also cause additional compilation of static libraries with non-optimized versions with debugging information (the Library name ends with "_ g ).
-- Disable-Profile
Disable library file compilation related to profiling information. The Glibc-2.3.6 defaults to enable, And the Glibc-2.4/2.5/2.6/2.7 defaults to disable.
-- Disable-sanity-Checks
Actually disabled threads (this option is only used in special environments ).
-- Enable-stackguard-Randomization
When the program starts, use a random number to initialize _ stack_chk_guard, which is mainly used to defend against malicious attacks. This option only exists in version 2.4 and later.
-- Enable-static-nss
Compile the NSS (Name Service Switch) library of the static version. This is not recommended because programs connected to the static NSS library cannot be dynamically configured to use different database names.
-- With-headers = dir
Specifies the directory where the kernel header file is located.
-- With-binutils = dir
Forcibly specify the position of binutils (AS, LD) used for compilation.
-- Without-CVS
Do not access the CVS server. This option is recommended, especially for versions downloaded from CVS.
-- With-elf
Elf object format is specified. We recommend that you use this option explicitly on Linux platforms that support elf.
-- With-Gd = dir
-- With-Gd-include = dir
-- With-Gd-Lib = dir
Forcibly specify the libgd installation directory (DIR/include and Dir/LIB ). The last two options respectively specify the include file and library directory.
-- With-GMP = dir
Forcibly specify the installation directory of GMP.
-- Without-SELinux
Disable SELinux support.
-- Without-fp
It is used only when the hardware does not have a floating point operation unit and the operating system does not simulate it. Both x86 and x86_64 CPUs have dedicated floating point operation units. In addition, FPU simulation is available in Linux. Simply put, do not use the without option! It causes many problems!
-- Without-TLS
Prohibit compilation of libraries that support local thread storage (TLS. Using this option causes compatibility issues.

The following options are of little significance and generally do not need to be considered

-- Without-_ thread
The TSL feature is not used even if the platform supports it. We recommend that you do not use this option.
-- Enable-all-Warnings
All compiler warnings are displayed during compilation, that is, compile with the-wall option.
-- With-CPU = CPU
Add "-mcpu = CPU" to the GCC command line ". We recommend that you do not set this option or -- without-CPU because "-mcpu" has been opposed.
-- With-xcoff
Use the xcoff object format (mainly used in Windows ).
-- X-regiondes = dir
-- X-libraries = dir
Specify the header file and library file directory of x respectively.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.