source: chapter06/glibc-32.xml@ ee1a413

multilib-10.1
Last change on this file since ee1a413 was ee1a413, checked in by Thomas Trepl <thomas@…>, 5 years ago

Change profiling attribute to enable selection of m32 and/or mx32. Fixes #4452.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multilib@11571 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 5.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 arch="ml_32,ml_x32,ml_all" id="ch-system-glibc-32" role="wrap">
9 <?dbhtml filename="glibc-32.html"?>
10
11 <sect1info condition="script">
12 <productname>glibc-32</productname>
13 <productnumber>&glibc-version;</productnumber>
14 <address>&glibc-url;</address>
15 </sect1info>
16
17 <title>Glibc-&glibc-version; - 32-bit</title>
18
19 <indexterm zone="ch-system-glibc-32">
20 <primary sortas="a-Glibc-32">Glibc-32</primary>
21 </indexterm>
22<!--
23 <sect2 role="package">
24 <title/>
25
26 <para>The Glibc package contains the main C library. This library provides
27 the basic routines for allocating memory, searching directories, opening and
28 closing files, reading and writing files, string handling, pattern matching,
29 arithmetic, and so on.</para>
30
31 <segmentedlist>
32 <segtitle>&buildtime;</segtitle>
33 <segtitle>&diskspace;</segtitle>
34
35 <seglistitem>
36 <seg>&glibc-ch6-sbu;</seg>
37 <seg>&glibc-ch6-du;</seg>
38 </seglistitem>
39 </segmentedlist>
40
41 </sect2>
42-->
43
44 <!-- ~~~~~~~~~~~~~~~~~~~~ ABI 32 ~~~~~~~~~~~~~~~~~~~~ -->
45
46 <sect2 arch="ml_32,ml_all" role="installation">
47 <title>Installation of Glibc - 32-bit</title>
48
49<screen><userinput remap="pre">patch -Np1 -i ../&glibc-fhs-patch;</userinput></screen>
50
51 <para>Remove a file that may be left over from a previous build attempt:</para>
52
53<screen><userinput remap="pre">mv /usr/include/limits.h{,.backup} </userinput></screen>
54
55 <para>The Glibc documentation recommends building Glibc
56 in a dedicated build directory:</para>
57
58<screen><userinput remap="pre">mkdir -v build
59cd build</userinput></screen>
60
61 <para>Prepare Glibc for compilation:</para>
62
63<screen><userinput remap="configure">CC="gcc -m32 -ffile-prefix-map=/tools=/usr -isystem /usr/include" \
64CXX="g++ -m32 -ffile-prefix-map=/tools=/usr -isystem /usr/include" \
65../configure --prefix=/usr \
66 --disable-werror \
67 --enable-kernel=&min-kernel; \
68 --enable-stack-protector=strong \
69 --enable-multi-arch \
70 --libdir=/usr/lib32 \
71 --libexecdir=/usr/lib32 \
72 --with-headers=/usr/include \
73 libc_cv_slibdir=/usr/lib32 \
74 i686-pc-linux-gnu</userinput></screen>
75
76 <para>Compile the package:</para>
77
78<screen><userinput remap="make">make</userinput></screen>
79
80 <para>Install the package:</para>
81
82<screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
83make install_root=$PWD/DESTDIR install
84mv -v DESTDIR/usr/lib32/* /usr/lib32/
85install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
86 /usr/include/gnu/
87ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-linux.so.2
88ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-lsb.so.3
89ln -svf ../lib/locale /usr/lib32/locale</userinput></screen>
90
91 <para>Configure the linker cache configuration:</para>
92
93<screen><userinput>echo "/usr/lib32" > /etc/ld.so.conf.d/lib32.conf
94ldconfig</userinput></screen>
95
96 <para>Do cleanup:</para>
97
98<screen><userinput>cd ..
99rm -rf build</userinput></screen>
100
101 </sect2>
102
103 <!-- ~~~~~~~~~~~~~~~~~~~~ ABI x32 ~~~~~~~~~~~~~~~~~~~~ -->
104
105 <sect2 arch="ml_x32,ml_all" role="installation">
106 <title>Glibc - x32-bit</title>
107
108 <para>The Glibc documentation recommends building Glibc
109 in a dedicated build directory:</para>
110
111<screen><userinput remap="pre">mkdir -v build
112cd build</userinput></screen>
113
114 <para>Prepare Glibc for compilation:</para>
115
116<screen><userinput remap="configure">CC="gcc -mx32 -ffile-prefix-map=/tools=/usr -isystem /usr/include" \
117CXX="g++ -mx32 -ffile-prefix-map=/tools=/usr -isystem /usr/include" \
118../configure --prefix=/usr \
119 --disable-werror \
120 --enable-kernel=&min-kernel; \
121 --enable-stack-protector=strong \
122 --enable-multi-arch \
123 --libdir=/usr/libx32 \
124 --with-headers=/usr/include \
125 libc_cv_slibdir=/usr/libx32 \
126 x86_64-pc-linux-gnux32</userinput></screen>
127
128 <para>Compile the package:</para>
129
130<screen><userinput remap="make">make</userinput></screen>
131
132 <para>Install the package:</para>
133
134<screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
135make install_root=$PWD/DESTDIR install
136mv -v DESTDIR/usr/libx32/* /usr/libx32/
137install -vm644 DESTDIR/usr/include/gnu/lib-names-x32.h /usr/include/gnu/
138[ -e DESTDIR/usr/include/gnu/stubs-x32.h ] \
139 &amp;&amp; install -vm644 DESTDIR/usr/include/gnu/stubs-x32.h /usr/include/gnu/ \
140 || ln -v /usr/include/gnu/stubs-64.h /usr/include/gnu/stubs-x32.h
141ln -svf ../usr/libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
142ln -svf ../lib/locale /usr/libx32/locale</userinput></screen>
143<!-- For whatever reason the stubs-x32.h doesn't get created. The 'ln' above is
144just a "brute force" workaraound by copying the stubs-64.h file. -->
145
146 <para>Configure the linker cache configuration:</para>
147
148<screen><userinput>echo "/usr/libx32" > /etc/ld.so.conf.d/libx32.conf
149ldconfig</userinput></screen>
150
151 <para>Do cleanup:</para>
152
153<screen><userinput>cd ..
154rm -rf build</userinput></screen>
155
156 <para>Restore the file we moved temporarily away:</para>
157
158<screen><userinput remap="pre">mv /usr/include/limits.h{.backup,} </userinput></screen>
159
160 </sect2>
161
162</sect1>
163
Note: See TracBrowser for help on using the repository browser.