summaryrefslogtreecommitdiff
path: root/doc/001291.html
blob: 5115daf2042da54fec6143afb140e6f4dcd1ba2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> uclibc vs glibc
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:hlfs-dev%40linuxfromscratch.org?Subject=uclibc%20vs%20glibc&In-Reply-To=200411062022.37679.robert%40linuxfromscratch.org">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="001290.html">
   <LINK REL="Next"  HREF="001292.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>uclibc vs glibc</H1>
    <B>Robert Connolly</B> 
    <A HREF="mailto:hlfs-dev%40linuxfromscratch.org?Subject=uclibc%20vs%20glibc&In-Reply-To=200411062022.37679.robert%40linuxfromscratch.org"
       TITLE="uclibc vs glibc">robert at linuxfromscratch.org
       </A><BR>
    <I>Sun Nov  7 00:10:55 MST 2004</I>
    <P><UL>
        <LI>Previous message: <A HREF="001290.html">uclibc vs glibc
</A></li>
        <LI>Next message: <A HREF="001292.html">uclibc vs glibc
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#1291">[ date ]</a>
              <a href="thread.html#1291">[ thread ]</a>
              <a href="subject.html#1291">[ subject ]</a>
              <a href="author.html#1291">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>I think I have success, except that the host system is detected as -gnu 
instead of -uclibc. But otherwise its working fine {:-] I attached my 
instruction sheet. It appears as though we need to use --host/build/target on 
every package, but I'm starting to get the feeling it doesn't really matter 
excpet for packages that are patched for it. I'm interested to know what 
happens in chapter 6.

Gawk's testsuite passed. Coreutils did not... it fails strait away.

make[3]: Entering directory 
`/mnt/hlfs/sources/temp/coreutils-5.2.1/tests/basename'
-: test fail-1: stderr mismatch, comparing fail-1.1 (actual) and fail-1.E 
(expected)
*** fail-1.1    Sun Nov  7 02:02:47 2004
--- fail-1.E    Sun Nov  7 02:02:47 2004

If I run Coreutils tests with make -k I get a lot of passes, but a lot of 
failures too. Odd stuff, like no such file, and permission denied, and 
mismatches too. Coreutils doesn't leave me any .out files to look at so I'll 
shelf this for now and I'll try to get to chapter 6 (tommorrow).

nini
Robert
-------------- next part --------------
# LFS with uclibc
# robert

# This is so the cross linker is found for cross gcc's build, and again for uClibc.
# It gets removed after native tools are set up.
# This path must go on the end so the native tools in /tools/bin are used when
# they get installed.

export PATH=&quot;$PATH:/tools/cross/bin&quot;

- Uclibc unpack

Just unpack it.

- Linux-libc-headers 2.6

cp -R include/asm-i386 ../uClibc/include/asm &amp;&amp;
cp -R include/{linux,sound} ../uClibc/include

- Uclibc headers

make allyesconfig &amp;&amp;
sed '<A HREF="http://linuxfromscratch.org/mailman/listinfo/hlfs-dev">s at RUNTIME_PREFIX.</A>*@RUNTIME_PREFIX=&quot;/tools&quot;@' -i .config &amp;&amp;
echo &gt; extra/scripts/fix_includes.sh

# This is better than 'cp -R include /tools/include' because this doesn't install
# libintl.h because it doesn't seem to work.
# Ignore the error about missing lib/

make headers
make DEVEL_PREFIX=/tools/cross/i386-pc-linux-uclibc/ install_dev

# Remove this broken link (lets not pretend it works).
# Then remove the empty directory (lets not pretend something is inside).

rm /tools/cross/i386-pc-linux-uclibc/lib/libthread_db.so &amp;&amp;
rmdir /tools/cross/i386-pc-linux-uclibc/lib/

- Binutils cross linker

# The second patch might not be needed, but I don't think it hurts either.

cat ../binutils-2.15.90.0.3-uclibc-100-conf.patch \
	| sed -e 's@/lib/@/tools/lib/@g' | patch -Np1 &amp;&amp;
patch -Np1 -i ../binutils-2.15.90.0.3-uclibc-210-cflags.patch

mkdir ../binutils-build &amp;&amp;
cd ../binutils-build 

../binutils-2.15.90.0.3/configure --prefix=/tools/cross --disable-nls \
        --target=i386-pc-linux-uclibc &amp;&amp;
make configure-host &amp;&amp;
make LDFLAGS=&quot;-all-static&quot; &amp;&amp;
make install &amp;&amp;
make -C ld clean &amp;&amp;
make -C ld LDFLAGS=&quot;-all-static&quot; LIB_PATH=/tools/lib

- Gcc cross compiler

# Just unpack gcc-core

# This is a replacement for the LFS specs patch, and adds uClibc specific stuff so
# --target=uclibc works nicer.
patch -Np1 -i ../gcc-3.4.3-uclibc_tools_conf-1.patch

mkdir ../gcc-build &amp;&amp;
cd ../gcc-build

# The most important thing here is --disable-shared. Untill we have a native C library
# Gcc can not build a libgcc.so (because it uses functions from libc.so).
../gcc-3.4.3/configure --prefix=/tools/cross --target=i386-pc-linux-uclibc \
    --libexecdir=/tools/cross/i386-pc-linux-uclibc/lib \
    --with-local-prefix=/tools/cross \
    --disable-nls --disable-shared --enable-languages=c

# Not BOOT_LDFLAGS because we are not doing a bootstrap here.
make LDFLAGS=&quot;-static&quot;

make install

- uClibc build

make CROSS=i386-pc-linux-uclibc-

make RUNTIME_PREFIX=/tools/ install_runtime
make DEVEL_PREFIX=/tools/ install_dev

- Adjusting toolchain

# In binutils-build
make -C ld install

# I dont know how to avoid this. Its only for use durring cross compiling.
ln -s /tools/lib/crt* /tools/cross/i386-pc-linux-uclibc/lib

# Theres no sed(1) command in this, the gcc-uclibc-conf patch took care of it.
# Now test that the compiler works.
echo 'main(){}' &gt; dummy.c
i386-pc-linux-uclibc-gcc dummy.c
readelf -l a.out | grep ': /tools'

- Gcc native

patch -Np1 -i ../gcc-3.4.3-uclibc_tools_conf-1.patch 

# This patch tells GCC how to build with uClibc locales for c++.
patch -Np1 -i ../gcc-3.4.1-uclibc-200-locale.patch

# This is so we don't run the fixincludes scripts.
patch -Np1 -i ../gcc-3.4.3-no_fixincludes-1.patch

mkdir ../gcc-build &amp;&amp;
cd ../gcc-build

# Uclibc and __cxa_atexit don't get along. --enable-clocale=uclibc, but don't define
# that or else it won't work, it will be echo'd during configure though.

# The first pass will be with the cross compiler, the bootstrap is with the native.
CC=&quot;i386-pc-linux-uclibc-gcc&quot; \
../gcc-3.4.3/configure --prefix=/tools \
    --host=i386-pc-linux-uclibc --build=i386-pc-linux-uclibc \
    --target=i386-pc-linux-uclibc --enable-shared \
    --libexecdir=/tools/lib --with-local-prefix=/tools \
    --enable-threads=posix --disable-__cxa_atexit \
    --enable-languages=c,c++ --disable-libstdcxx-pch

make bootstrap

make install &amp;&amp;
ln -s gcc /tools/bin/cc

- Binutils native

cat ../binutils-2.15.90.0.3-uclibc-100-conf.patch \
        | sed -e 's@/lib/@/tools/lib/@g' | patch -Np1 &amp;&amp;
patch -Np1 -i ../binutils-2.15.90.0.3-uclibc-210-cflags.patch

mkdir ../binutils-build &amp;&amp;
cd ../binutils-build

../binutils-2.15.90.0.3/configure --prefix=/tools \
	--enable-shared --with-lib-path=/tools/lib \
	--host=i386-pc-linux-uclibc --build=i386-pc-linux-uclibc \
    --target=i386-pc-linux-uclibc &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
make -C ld clean &amp;&amp;
make -C ld LIB_PATH=/usr/lib:/lib

- Gawk

./configure --prefix=/tools --host=i386-pc-linux-uclibc \
  --build=i386-pc-linux-uclibc --target=i386-pc-linux-uclibc &amp;&amp;
make &amp;&amp;
make install

- Coreutils

./configure --prefix=/tools --host=i386-pc-linux-uclibc \
  --build=i386-pc-linux-uclibc --target=i386-pc-linux-uclibc &amp;&amp;
make &amp;&amp;
make install

</PRE>

<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="001290.html">uclibc vs glibc
</A></li>
	<LI>Next message: <A HREF="001292.html">uclibc vs glibc
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#1291">[ date ]</a>
              <a href="thread.html#1291">[ thread ]</a>
              <a href="subject.html#1291">[ subject ]</a>
              <a href="author.html#1291">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="http://linuxfromscratch.org/mailman/listinfo/hlfs-dev">More information about the hlfs-dev
mailing list</a><br>
</body></html>