To support my argument in the e-mail included below, I have built
http://www.linuxfromscratch.org/lfs/view/development/chapter05/gcc-libstdc++.html
with and without the `--disable-libstdcxx-threads' option.  The
installed files have only three differences, which should not affect
any later build, as shown below:

1. The header files
/home/lfs/guk{2,}/LFS-tools/x86_64-lfs-linux-gnu/include/c++/9.2.0/x86_64-lfs-linux-gnu/bits/c++config.h
differ in just one symbol:
--- 
/home/lfs/guk2/LFS-tools/x86_64-lfs-linux-gnu/include/c++/9.2.0/x86_64-lfs-linux-gnu/bits/c++config.h
   2020-02-21 18:44:57.945900291 +0100
+++ 
/home/lfs/guk/LFS-tools/x86_64-lfs-linux-gnu/include/c++/9.2.0/x86_64-lfs-linux-gnu/bits/c++config.h
   2020-02-21 18:31:34.287162894 +0100
@@ -1730,7 +1730,7 @@
 #define _GLIBCXX_X86_RDRAND 1

 /* Define to 1 if mutex_timedlock is available. */
-/* #undef _GTHREAD_USE_MUTEX_TIMEDLOCK */
+#define _GTHREAD_USE_MUTEX_TIMEDLOCK 1

 /* Define if all C++11 floating point overloads are available in <math.h>.  */
 #if __cplusplus >= 201103L

2. The files compatibility-atomic-c++0x.o in the archives
/home/lfs/guk{2,}/LFS-tools/lib/libstdc++.a differ in just one symbol:
--- guk2.txt    2020-02-21 18:48:15.571204014 +0100
+++ guk.txt    2020-02-21 18:48:20.179226740 +0100
@@ -1,5 +1,4 @@
 0000000000000000 t _ZL20__gthread_key_deletei
-0000000000000000 r _ZN9__gnu_cxxL21__default_lock_policyE
 0000000000000000 r _ZStL10adopt_lock
 0000000000000000 r _ZStL10defer_lock
 0000000000000000 r _ZStL11try_to_lock

3. The files mutex.o in the archives
/home/lfs/guk{2,}/LFS-tools/lib/libstdc++.a differ in just one symbol:
--- guk2.txt    2020-02-21 18:48:47.463355151 +0100
+++ guk.txt    2020-02-21 18:48:51.279372293 +0100
@@ -1,5 +1,4 @@
 0000000000000000 t _ZL20__gthread_key_deletei
-0000000000000000 r _ZN9__gnu_cxxL21__default_lock_policyE
 0000000000000000 r _ZStL10adopt_lock
 0000000000000000 r _ZStL10defer_lock
 0000000000000000 r _ZStL11try_to_lock

Those differences are obtained in the following manner:

$ ../gcc-9.2.0/libstdc++-v3/configure --host=$LFS_TGT
--prefix=/LFS-tools --disable-multilib --disable-nls
--disable-libstdcxx-pch
--with-gxx-include-dir=/LFS-tools/$LFS_TGT/include/c++/9.2.0
$ make
$ make DESTDIR=/home/lfs/guk install
$ cd ..
$ rm -R build-libstdc++/
$ mkdir build-libstdc++/
$ cd build-libstdc++/
$ ../gcc-9.2.0/libstdc++-v3/configure --host=$LFS_TGT
--prefix=/LFS-tools --disable-multilib --disable-nls
--disable-libstdcxx-threads --disable-libstdcxx-pch
--with-gxx-include-dir=/LFS-tools/$LFS_TGT/include/c++/9.2.0
$ make
$ make DESTDIR=/home/lfs/guk2 install
$ diff -rq /home/lfs/guk{2,}
Files /home/lfs/guk2/LFS-tools/lib/libstdc++.a and
/home/lfs/guk/LFS-tools/lib/libstdc++.a differ
Files /home/lfs/guk2/LFS-tools/lib/libstdc++fs.a and
/home/lfs/guk/LFS-tools/lib/libstdc++fs.a differ
Files /home/lfs/guk2/LFS-tools/lib/libsupc++.a and
/home/lfs/guk/LFS-tools/lib/libsupc++.a differ
Files 
/home/lfs/guk2/LFS-tools/x86_64-lfs-linux-gnu/include/c++/9.2.0/x86_64-lfs-linux-gnu/bits/c++config.h
and 
/home/lfs/guk/LFS-tools/x86_64-lfs-linux-gnu/include/c++/9.2.0/x86_64-lfs-linux-gnu/bits/c++config.h
differ
$ diff -u 
/home/lfs/guk2/LFS-tools/x86_64-lfs-linux-gnu/include/c++/9.2.0/x86_64-lfs-linux-gnu/bits/c++config.h
 
/home/lfs/guk/LFS-tools/x86_64-lfs-linux-gnu/include/c++/9.2.0/x86_64-lfs-linux-gnu/bits/c++config.h
# shown above
$ mkdir guk{2,}
$ cd guk2
$ ar x /home/lfs/guk2/LFS-tools/lib/libstdc++.a
$ cd ../guk
$ ar x /home/lfs/guk/LFS-tools/lib/libstdc++.a
$ cd ..
$ diff -rq guk{2,}
Files guk2/compatibility-atomic-c++0x.o and
guk/compatibility-atomic-c++0x.o differ
Files guk2/mutex.o and guk/mutex.o differ
$ nm guk2/compatibility-atomic-c++0x.o > guk2.txt
$ nm guk/compatibility-atomic-c++0x.o > guk.txt
$ diff -u guk{2,}.txt # shown above
$ nm guk2/mutex.o > guk2.txt
$ nm guk/mutex.o > guk.txt
$ diff -u guk{2,}.txt # shown above
$ rm -Rf guk{2,}
$ mkdir guk{2,}
$ cd guk2
$ ar x /home/lfs/guk2/LFS-tools/lib/libstdc++fs.a
$ cd ../guk
$ ar x /home/lfs/guk/LFS-tools/lib/libstdc++fs.a
$ cd ..
$ diff -rq guk{2,} # no difference
$ rm -Rf guk{2,}
$ mkdir guk{2,}
$ cd guk2
$ ar x /home/lfs/guk2/LFS-tools/lib/libsupc++.a
$ cd ../guk
$ ar x /home/lfs/guk/LFS-tools/lib/libsupc++.a
$ cd ..
$ diff -rq guk{2,} # no difference

On Fri, Feb 21, 2020 at 6:29 PM Tadeus Prastowo <[email protected]> wrote:
>
> Hello,
>
> To quote 
> http://www.linuxfromscratch.org/lfs/view/development/chapter05/gcc-libstdc++.html:
>
> --disable-libstdcxx-threads
>
> Since we have not yet built the C threads library, the C++ one cannot
> be built either.
>
> End quote.
>
> The option can indeed be removed and gcc-libstdc++ will build fine.
> Furthermore, considering the option `-lrt' given when building the
> perl executable as described in the other thread
> http://lists.linuxfromscratch.org/pipermail/lfs-dev/2020-February/073506.html,
> it seems that the glibc built at
> http://www.linuxfromscratch.org/lfs/view/development/chapter05/glibc.html
> indeed has a thread support, which is against the quoted description.
>
> I think the real reason could be the fact that the libstdcxx-threads
> is simply not needed to build the rest.  What do you think?
>
> Thank you.
>
> --
> Best regards,
> Tadeus
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to