Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In file included from ../../../libgcc/gthr.h:148,
from ../../../libgcc/unwind-dw2.c:37:
./gthr-default.h:35:10: fatal error: pthread.h: No such file or directory
35 | #include <pthread.h>
| ^~~~~~~~~~~
compilation terminated.
make[2]: *** [../../../libgcc/static-object.mk:17: unwind-dw2.o] Error 1
make[2]: Leaving directory '/mnt/sda4/sources/gcc-9.2.0/build/x86_64-lfs-linux-gnu/libgcc'
make[1]: *** [Makefile:12499: all-target-libgcc] Error 2
make[1]: Leaving directory '/mnt/sda4/sources/gcc-9.2.0/build'
make: *** [Makefile:940: all] Error 2
I've attempted to compile GCC 3 times now. The first had no issues, but had to redo ch5 after a failure with the API headers. I'm worried attempting to restart the first time and clearing out my tools dir may have caused this issue (strangely I wasn't auth to delete the tools dir) OR an issue with the binutils compile.
I'm not familiar with where this include is being sourced from, but if anyone could point me to where it is that would be helpful. Also when troubleshooting make errors what are some troubleshooting tips you could recommend?
version-check.sh
Code:
bash, version 5.0.3(1)-release
/bin/sh -> /usr/bin/bash
Binutils: (GNU Binutils for Debian) 2.31.1
bison (GNU Bison) 3.3.2
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.30
diff (GNU diffutils) 3.7
find (GNU findutils) 4.6.0.225-235f
GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.1.2)
/usr/bin/awk -> /usr/bin/gawk
gcc (Debian 8.3.0-6) 8.3.0
g++ (Debian 8.3.0-6) 8.3.0
(Debian GLIBC 2.28-10) 2.28
grep (GNU grep) 3.3
gzip 1.9
Linux version 4.19.0-8-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.98-1 (2020-01-26)
m4 (GNU M4) 1.4.18
GNU Make 4.2.1
GNU patch 2.7.6
Perl version='5.28.1';
Python 3.7.3
sed (GNU sed) 4.7
tar (GNU tar) 1.30
texi2any (GNU texinfo) 6.5
xz (XZ Utils) 5.2.4
g++ compilation OK
Thank you for the replies.
That's where I'm scratching my head. pthread.h is in /usr/include on my host machine
So I created a dummy.c file and compiled it with gcc, with no error to output:
Code:
#include <pthread.h>
int main(){}
However if I follow lfs, doesn't the "--with-local-prefix=/tools" option during the .configure precompile set up "make" to look in /tools for locally installed include files, instead of /usr/include?
Or I'm off base here?
Last edited by Sasquiche; 03-19-2020 at 02:53 PM.
Reason: dummy test added, and clarifications
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154
Rep:
Sorry misread your op, you wont have installed glibc yet, are you sure you did all the gcc prep bits? sed etc, also check your configure for gcc as the 1st pass should have this option "--disable-threads" in the configure.
As you are so close to the start of building the tools I would suggest you completly clean your LFS system and start from scratch, problems at this early stage can cause weird errors later on.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.