Hi Xi.
Hi Michael, Paul and Ken.
Thank you all for your comments suggestions and tips.
Firstly, I have adjusted my Gmail. Please tell me if I am still
top-posting. It is a new term to me but I did find Gmail confusing.
Xi, I restarted from Chapter 6 with my saved /tools directory.
I also did "Adjusting the Toolchain" after 6.16.
While running the 'make' step in 6.18.1 I noticed a number of warnings
similar to:
"In file included from mpfr-impl.h:108:0,
from beta.c:24:
mpfr.h:432:51: warning: ISO C does not support decimal floating point
[-Wpedantic]
__MPFR_DECLSPEC int mpfr_set_decimal64 (mpfr_ptr, _Decimal64, mpfr_rnd_t);
^~~~~~~~~~
mpfr.h:483:17: warning: ISO C does not support decimal floating point
[-Wpedantic]
__MPFR_DECLSPEC _Decimal64 mpfr_get_decimal64 (mpfr_srcptr, mpfr_rnd_t);"
I assumed an error was coming.
However the make check passed 100%
I'm afraid I do not have a copy of yesterday's steps as I issued a stupid
command and closed the host down.
Sorry.
I do have a copy of today's bash history( :)) but of course that helps
no-one.
" 1 mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt}
2 mkdir -pv /{media/{floppy,cdrom},sbin,srv,var}
3 install -dv -m 0750 /root
4 install -dv -m 1777 /tmp /var/tmp
5 mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
6 mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
7 mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo}
8 mkdir -v /usr/libexec
9 mkdir -pv /usr/{,local/}share/man/man{1..8}
10 case $(uname -m) in x86_64) mkdir -v /lib64 ;; esac
11 mkdir -v /var/{log,mail,spool}
12 ln -sv /run /var/run
13 ln -sv /run/lock /var/lock
14 mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local}
15 ln -sv /tools/bin/{bash,cat,dd,echo,ln,pwd,rm,stty} /bin
16 ln -sv /tools/bin/{install,perl} /usr/bin
17 ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib
18 ln -sv /tools/lib/libstdc++.{a,so{,.6}} /usr/lib
19 ln -sv bash /bin/sh
20 ln -sv /proc/self/mounts /etc/mtab
21 cat > /etc/passwd << "EOF"
22 root:x:0:0:root:/root:/bin/bash
23 bin:x:1:1:bin:/dev/null:/bin/false
24 daemon:x:6:6:Daemon User:/dev/null:/bin/false
25 messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false
26 nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
27 EOF
28 cat > /etc/group << "EOF"
29 root:x:0:
30 bin:x:1:daemon
31 sys:x:2:
32 kmem:x:3:
33 tape:x:4:
34 tty:x:5:
35 daemon:x:6:
36 floppy:x:7:
37 disk:x:8:
38 lp:x:9:
39 dialout:x:10:
40 audio:x:11:
41 video:x:12:
42 utmp:x:13:
43 usb:x:14:
44 cdrom:x:15:
45 adm:x:16:
46 messagebus:x:18:
47 systemd-journal:x:23:
48 input:x:24:
49 mail:x:34:
50 nogroup:x:99:
51 users:x:999:
52 EOF
53 exec /tools/bin/bash --login +h
54 touch /var/log/{btmp,lastlog,faillog,wtmp}
55 chgrp -v utmp /var/log/lastlog
56 chmod -v 664 /var/log/lastlog
57 chmod -v 600 /var/log/btmp
58 cd sources
59 ls -d /linux*
60 ls -ld linux*
61 cd linux
62 cd linux-4.15.3
63 cd build
64 make mrproper
65 make INSTALL_HDR_PATH=dest headers_install
66 find dest/include \( -name .install -o -name ..install.cmd \) -delete
67 cp -rv dest/include/* /usr/include
68 cd ..
69 cd man-pages-4.15
70 tar -xvf man-pages-4.15.tar.xz
71 cd man-pages-4.15
72 make install
73 cd ..
74 cd glibc-2.27
75 ls -l
76 patch -Np1 -i ../glibc-2.27-fhs-1.patch
77 ln -sfv /tools/lib/gcc /usr/lib
78 case $(uname -m) in i?86) GCC_INCDIR=/usr/lib/gcc/$(uname
-m)-pc-linux-gnu/7.3.0/include; ln -sfv ld-linux.so.2 /lib/ld-lsb.so.3; ;;
x86_64) GCC_INCDIR=/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include; ln -sfv
../lib/ld-linux-x86-64.so.2 /lib64; ln -sfv ../lib/ld-linux-x86-64.so.2
/lib64/ld-lsb-x86-64.so.3; ;; esac
79 rm -f /usr/include/limits.h
80 mkdir -v build
81 cd build
82 CC="gcc -isystem $GCC_INCDIR -isystem /usr/include" ../configure
--prefix=/usr --disable-werror --enable-kernel=3.2
--enable-stack-protector=strong libc_cv_slibdir=/lib
83 unset GCC_INCDIR
84 make
85 make check
86 touch /etc/ld.so.conf
87 sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
88 make install
89 cp -v ../nscd/nscd.conf /etc/nscd.conf
90 mkdir -pv /var/cache/nscd
91 mkdir -pv /usr/lib/locale
92 localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
93 localedef -i de_DE -f ISO-8859-1 de_DE
94 localedef -i ***@euro -f ISO-8859-15 ***@euro
95 localedef -i de_DE -f UTF-8 de_DE.UTF-8
96 localedef -i en_GB -f UTF-8 en_GB.UTF-8
97 localedef -i en_HK -f ISO-8859-1 en_HK
98 localedef -i en_PH -f ISO-8859-1 en_PH
99 localedef -i en_US -f ISO-8859-1 en_US
100 localedef -i en_US -f UTF-8 en_US.UTF-8
101 localedef -i es_MX -f ISO-8859-1 es_MX
102 localedef -i fa_IR -f UTF-8 fa_IR
103 localedef -i fr_FR -f ISO-8859-1 fr_FR
104 localedef -i ***@euro -f ISO-8859-15 ***@euro
105 localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
106 localedef -i it_IT -f ISO-8859-1 it_IT
107 localedef -i it_IT -f UTF-8 it_IT.UTF-8
108 localedef -i ja_JP -f EUC-JP ja_JP
109 localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
110 localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
111 localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
112 localedef -i zh_CN -f GB18030 zh_CN.GB18030
113 cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
# End /etc/nsswitch.conf
EOF
114 tar -xf ../../tzdata2018c.tar.gz
115 ZONEINFO=/usr/share/zoneinfo
116 mkdir -pv $ZONEINFO/{posix,right}
117 for tz in etcetera southamerica northamerica europe africa
antarctica asia australasia backward pacificnew systemv; do zic -L
/dev/null -d $ZONEINFO -y "sh yearistype.sh" ${tz}; zic -L /dev/null -d
$ZONEINFO/posix -y "sh yearistype.sh" ${tz}; zic -L leapseconds -d
$ZONEINFO/right -y "sh yearistype.sh" ${tz}; done
118 cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO
119 zic -d $ZONEINFO -p Africa/Johannesburg
120 unset ZONEINFO
121 cp -v /usr/share/zoneinfo/Africa/Johannesburg /etc/localtime
122 cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf
/usr/local/lib
/opt/lib
EOF
123 cat >> /etc/ld.so.conf << "EOF"
# Add an include directory
include /etc/ld.so.conf.d/*.conf
EOF
124 mkdir -pv /etc/ld.so.conf.d
125 cd ..
126 cd ..
127 mv -v /tools/bin/{ld,ld-old}
128 mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}
129 mv -v /tools/bin/{ld-new,ld}
130 ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld
131 gcc -dumpspecs | sed -e 's@/tools@@g' -e
'/\*startfile_prefix_spec:/{n;***@.*@/usr/lib/ @}' -e '/\*cpp:/{n;s@$@
-isystem /usr/include@}' > `dirname $(gcc --print-libgcc-file-name)`/specs
132 echo 'int main(){}' > dummy.c
133 cc dummy.c -v -Wl,--verbose &> dummy.log
134 readelf -l a.out | grep ': /lib'
135 grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
136 grep -B1 '^ /usr/include' dummy.log
137 grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
138 grep "/lib.*/libc.so.6 " dummy.log
139 grep found dummy.log
140 rm -v dummy.c a.out dummy.log
141 ls -l zlib-1.2.11*
142 tar -xvf zlib-1.2.11.tar.xz
143 cd zlib-1.2.11
144 ./configure --prefix=/usr
145 make
146 make check
147 make install
148 cd ..
149 cd file-5.32
150 ls -l
151 cd ..
152 rm -rf file-5.32
153 tar -xvf file-5.32.tar.gz
154 cd file-5.32
155 ./configure --prefix=/usr
156 make
157 make check
158 make install
159 cd ..
160 cd readline-7.0
161 tar -xvf readline-7.0.tar.gz
162 cd readline-7.0
163 sed -i '/MV.*old/d' Makefile.in
164 sed -i '/{OLDSUFF}/c:' support/shlib-install
165 ./configure --prefix=/usr --disable-static
--docdir=/usr/share/doc/readline-7.0
166 make SHLIB_LIBS="-L/tools/lib -lncursesw"
167 make SHLIB_LIBS="-L/tools/lib -lncurses" install
168 mv -v /usr/lib/lib{readline,history}.so.* /lib
169 ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so)
/usr/lib/libreadline.so
170 ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so )
/usr/lib/libhistory.so
171 install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-7.0
172 cd ..
173 rm -rf m4-1.4.18
174 tar -xvf m4-1.4.18.tar.xz
175 cd m4-1.4.18
176 ./configure --prefix=/usr
177 make
178 make check
179 make install
180 cd ..
181 cd bc-1.07.1
182 tar -xvf bc-1.07.1.tar.gz
183 cd bc-1.07.1
184 cat > bc/fix-libmath_h << "EOF"
#! /bin/bash
sed -e '1 s/^/{"/' \
-e 's/$/",/' \
-e '2,$ s/^/"/' \
-e '$ d' \
-i libmath.h
sed -e '$ s/$/0}/' \
-i libmath.h
EOF
185 ln -sv /tools/lib/libncursesw.so.6 /usr/lib/libncursesw.so.6
186 ln -sfv libncurses.so.6 /usr/lib/libncurses.so
187 sed -i -e '/flex/s/as_fn_error/: ;; # &/' configure
188 ./configure --prefix=/usr --with-readline --mandir=/usr/share/man
--infodir=/usr/share/info
189 make
190 echo "quit" | ./bc/bc -l Test/checklib.b
191 make install
192 cd ..
193 rm -rf binutils-2.30
194 tar -xvf binutils-2.30.tar.xz
195 cd binutils-2.30
196 expect -c "spawn ls"
197 mkdir -v build
198 cd build
199 ../configure --prefix=/usr --enable-gold --enable-ld=default
--enable-plugins --enable-shared --disable-werror --enable-64-bit-bfd
--with-system-zlib
200 make tooldir=/usr
201 make -k check
202 make tooldir=/usr install
203 mv -v /tools/bin/{ld,ld-old}
204 mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}
205 mv -v /tools/bin/{ld-new,ld}
206 ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld
207 gcc -dumpspecs | sed -e 's@/tools@@g' -e
'/\*startfile_prefix_spec:/{n;***@.*@/usr/lib/ @}' -e '/\*cpp:/{n;s@$@
-isystem /usr/include@}' > `dirname $(gcc --print-libgcc-file-name)`/specs
208 echo 'int main(){}' > dummy.c
209 cc dummy.c -v -Wl,--verbose &> dummy.log
210 readelf -l a.out | grep ': /lib'
211 cd ..
212 cd ..
213 grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
214 grep -B1 '^ /usr/include' dummy.log
215 grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
216 grep "/lib.*/libc.so.6 " dummy.log
217 grep found dummy.log
218 rm -v dummy.c a.out dummy.log
219 ls -l gmp*
220 tar -xvf gmp-6.1.2.tar.xz
221 cd gmp-6.1.2
222 ./configure --prefix=/usr --enable-cxx --disable-static
--docdir=/usr/share/doc/gmp-6.1.2
223 make
224 make html
225 make check 2>&1 | tee gmp-check-log
226 awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
227 make install
228 make install-html
229 cd ..
230 ls -l mpfr*
231 tar -xvf mpfr-4.0.1.tar.xz
232 cd mp
233 cd mpfr-4.0.1
234 ./configure --prefix=/usr --disable-static --enable-thread-safe
--docdir=/usr/share/doc/mpfr-4.0.1
235 make
236 make html
237 cd ..
238 history >/duff-hist
Thank you Ken especially for the 'history >/duff-hist' tip. Hope I remember
that.
Thanks everyone once again.
I am proceeding.
John.
Post by Xi RuoyaoPost by Michael ShellOn Mon, 06 Aug 2018 19:52:52 +0800
Post by Xi RuoyaoNo. /tools/lib/libquadmath.so.* is useless now. After "6.10
Adjusting the Toolchain" the default dynamic linker should have
been changed to /lib64/ld-linux-x86-64.so.2 instead of
/tools/lib64/ld-linux-x86-64.so.2. Then it should search /usr/lib,
not /tools/lib.
MPFR configure script add "-lquadmath" if
Xi,
Good catch! But, I think what threw me (and Hazel) off is why does
the MPFR build process attempt to link against libquadmath in the
first place? After all, as you said, libquadmath won't be available
(in /usr/lib) until after gcc is (re)installed in step 6.20.1
So, MPFR's configure detects libquadmath (in /tools/lib) and then
links its tests against libquadmath, but those tests later fail
because the dynamic linker is set to link from what is in /usr/lib?
echo "int main(){}" > conftest.c &&
cc conftest.c -lquadmath
And do *not* run the compiled test program. So it don't know the program
can't be executed.
The problem is, GCC default dynamic linker has been changed to
/lib64/ld-linux-x86-64.so.2 built in 6.9, but the linker (`ld`, not
`ld.so`) still searches /tools/lib. It's a mismatch of linker and
dynamic linker. So, libquadmath can be searched by linker, but not
by dynamic linker.
Post by Michael ShellIn short, does the presence or absence of libquadmath affect the actual
libmpfr.so or just its test executables - that without libquadmath the
tests would not be linked against it and yet they still work fine?
Does it affect, say, the number of tests that are done? Depending
on the answer here, there may be a case for reinstalling MPFR again
after gcc.
I just tried to build MPFR on a completed LFS. The tests linked to
libquadmath, but libmpfr.so itself did not.
Oh no, I think there is another problem. In 6.16 the final Binutils
should have been built. So the final `ld` should have replaced the
linker used in "Adjusting the Toolchain".
Remove /tools and extract your backup. Then restart Chapter 6. Make
sure to do all checks in "Adjusting the Toolchain". And, do them again
after "6.16 Binutils".
Ken's debugging way (using .bash_histroy") may be useful. You can
attach it here and we will play a "Spot The Differences" game :)
--
School of Aerospace Science and Technology, Xidian University
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Do not top post on this list.
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
http://en.wikipedia.org/wiki/Posting_style
--
Kind regards,
John Le Brasseur