📄 glibc-64.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content= "application/xhtml+xml; charset=iso-8859-1" /> <title> 5.9. Glibc-2.4 64-Bit </title> <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /> <link rel="stylesheet" href="../stylesheets/lfs-print.css" type= "text/css" media="print" /> </head> <body id="lfs" class="CLFS-SVN-20060417-x86_64-Multilib"> <div class="navheader"> <div class="headertitles"> <h4> Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-x86_64-Multilib </h4> <h3> Chapter 5. Constructing Cross-Compile Tools </h3> </div> <ul class="headerlinks"> <li class="prev"> <a accesskey="p" href="glibc.html" title= "Glibc-2.4 32 Bit">Prev</a> <p> Glibc-2.4 32 Bit </p> </li> <li class="next"> <a accesskey="n" href="gcc-final.html" title= "GCC-4.1.0 - Cross Compiler Final">Next</a> <p> GCC-4.1.0 - Cross Compiler Final </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 5. Constructing Cross-Compile Tools">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-x86_64-Multilib"> Home</a> </li> </ul> </div> <div class="wrap" lang="en" xml:lang="en"> <div class="titlepage"> <h1 class="sect1"> 5.9. Glibc-2.4 64-Bit </h1> </div> <div class="package" lang="en" xml:lang="en"> <p> The Glibc package contains the main C library. This library provides the basic routines for allocating memory, searching directories, opening and closing files, reading and writing files, string handling, pattern matching, arithmetic, and so on. </p> <div class="segmentedlist"> <div class="seglistitem"> <div class="seg"> <strong><span class="segtitle">Installation depends on:</span></strong> <span class="seg">Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Gettext, Grep, Make, Patch, Perl, Sed, and Texinfo</span> </div> </div> </div> </div> <div class="installation" lang="en" xml:lang="en"> <div class="titlepage"> <h2 class="sect2"> 5.9.1. Installation of Glibc </h2> </div> <p> It should be noted that compiling Glibc in any way other than the method suggested in this book puts the stability of the system at risk. </p> <p> Disable linking to <tt class="filename">libgcc_eh</tt>: </p> <pre class="userinput"><kbd class="command">patch -Np1 -i ../glibc-2.4-libgcc_eh-1.patch</kbd></pre> <p> The following patch removes the potential of localdef segfaulting: </p> <pre class="userinput"><kbd class="command">patch -Np1 -i ../glibc-2.4-localedef_segfault-1.patch</kbd></pre> <p> The following sed fixes a build issue with Glibc. This will prevent nscd from trying to link to libraries that don't exist: </p> <pre class="userinput"><kbd class="command">cp nscd/Makefile{,.orig}sed -e "/nscd_stat.o: sysincludes = # nothing/d" nscd/Makefile.orig > \nscd/Makefile</kbd></pre> <p> The Glibc documentation recommends building Glibc outside of the source directory in a dedicated build directory: </p> <pre class="userinput"><kbd class="command">mkdir -v ../glibc-buildcd ../glibc-build</kbd></pre> <p> For NPTL enabled systems the following lines need to be added to <tt class="filename">config.cache</tt>: </p> <pre class="userinput"><kbd class="command">echo "libc_cv_forced_unwind=yes" > config.cacheecho "libc_cv_c_cleanup=yes" >> config.cache</kbd></pre> <p> Now we make sure the Glibc goes into <tt class= "filename">/tools/lib64</tt>: </p> <pre class="userinput"><kbd class="command">echo "slibdir=/tools/lib64" >> configparms</kbd></pre> <p> Prepare Glibc for compilation: </p> <pre class="userinput"><kbd class="command">BUILD_CC="gcc" CC="${LFS_TARGET}-gcc ${BUILD64}" \ AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \ ../glibc-2.4/configure --prefix=/tools \ --host=${LFS_TARGET} --build=${LFS_HOST} --libdir=/tools/lib64 \ --disable-profile --enable-add-ons \ --with-tls --enable-kernel=2.6.0 --with-__thread \ --with-binutils=/cross-tools/bin --with-headers=/tools/include \ --cache-file=config.cache</kbd></pre> <div class="variablelist"> <p class="title"> <b>The meaning of the new configure options:</b> </p> <dl> <dt> <span class="term"><em class= "parameter"><tt>CC="${LFS_TARGET}-gcc ${BUILD64}"</tt></em></span> </dt> <dd> <p> Forces Glibc to utilize our target architecture GCC utilizing the 64 Bit flags. </p> </dd> <dt> <span class="term"><em class= "parameter"><tt>--libdir=/tools/lib64</tt></em></span> </dt> <dd> <p> Puts Glibc into /tools/lib64 instead of /tools/lib. </p> </dd> </dl> </div> <p> During this stage the following warning might appear: </p> <div class="blockquote"> <blockquote class="blockquote"> <pre class="screen"><tt class="computeroutput">configure: WARNING:*** These auxiliary programs are missing or*** incompatible versions: msgfmt*** some features will be disabled.*** Check the INSTALL file for required versions.</tt></pre> </blockquote> </div> <p> The missing or incompatible <span><strong class= "command">msgfmt</strong></span> program is generally harmless. This <span><strong class="command">msgfmt</strong></span> program is part of the Gettext package which the host distribution should provide. </p> <p> Compile the package: </p> <pre class="userinput"><kbd class="command">make</kbd></pre> <p> Install the package: </p> <pre class="userinput"><kbd class="command">make install</kbd></pre> </div> <div class="content" lang="en" xml:lang="en"> <p> Details on this package are located in <a href= "../final-system/glibc-64bit.html#contents-glibc" title= "10.7.5. Contents of Glibc">Section 10.7.5, “Contents of Glibc.”</a> </p> </div> </div> <div class="navfooter"> <ul> <li class="prev"> <a accesskey="p" href="glibc.html" title= "Glibc-2.4 32 Bit">Prev</a> <p> Glibc-2.4 32 Bit </p> </li> <li class="next"> <a accesskey="n" href="gcc-final.html" title= "GCC-4.1.0 - Cross Compiler Final">Next</a> <p> GCC-4.1.0 - Cross Compiler Final </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 5. Constructing Cross-Compile Tools">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-x86_64-Multilib"> Home</a>. </li> </ul> </div> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -