LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 03-18-2020, 07:14 PM   #1
Sasquiche
LQ Newbie
 
Registered: Mar 2020
Posts: 3

Rep: Reputation: Disabled
LFS 9.0 - GCC Pass 1, missing pthread.h


This is a head scratcher.

Code:
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
 
Old 03-19-2020, 09:22 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
phread.h is installed by glibc you probably forgot to do make install.
 
1 members found this post helpful.
Old 03-19-2020, 01:22 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
pthread.h: No such file
Code:
# apt install --reinstall libc6-dev
      // provides /usr/include/pthread.h
 
Old 03-19-2020, 02:33 PM   #4
Sasquiche
LQ Newbie
 
Registered: Mar 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 03-20-2020, 06:07 AM   #5
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
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.
 
Old 03-20-2020, 09:30 AM   #6
Sasquiche
LQ Newbie
 
Registered: Mar 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
Keith you were spot on about the "--disable-threads" option.

... I misspelled "thread" on both clean attempts.

Just compiled again, with no issues.

The lesson here is DOUBLE CHECK THE SPELLING OF YOUR COMMANDS; especially before configuration, double check the spelling of your options.

Thanks for your responses.
 
Old 03-20-2020, 10:03 AM   #7
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
No worries, glad you got it working.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LFS: Error during GCC-4.7.1-Pass 1 (LFS 7.2, Section 5.5) erkant Linux From Scratch 7 11-28-2012 06:03 AM
Makefile:274: *** missing separator. Stop. LFS, Chapter 5, GCC-4.5.1 Pass 2 b.morgan.296 Linux From Scratch 6 01-05-2011 05:09 PM
[SOLVED] LFS 6.7 : $LFS/sources and $LFS/tools folders missing prakashsince92 Linux From Scratch 5 12-09-2010 02:26 PM
libtest.a uses pthread: user of libtest.a should not link pthread again debulu Programming 2 01-31-2007 09:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 11:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration