LinuxQuestions.org
Review your favorite Linux distribution.
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 11-14-2018, 05:45 AM   #1
lfs1121
Member
 
Registered: Nov 2018
Posts: 31

Rep: Reputation: Disabled
Unhappy Help Me! Psmisc-23.1 Chapter 6 LFS


Hello,
I am following the instruction for compiling Psmisc-23.2. I get the following error each time I try:

(lfs chroot) root:/sources/psmisc-23.2# ./configure --prefix=/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /tools/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/sources/psmisc-23.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
(lfs chroot) root:/sources/psmisc-23.2# make
make: *** No targets specified and no makefile found. Stop.
(lfs chroot) root:/sources/psmisc-23.2# ./configure --prefix=/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /tools/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/sources/psmisc-23.2':
configure: error: C compiler cannot create executables
See `config.log' for more details

Any help would be highly appreciated.

Last edited by lfs1121; 11-14-2018 at 05:48 AM.
 
Old 11-14-2018, 06:57 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Code:
configure: error: C compiler cannot create executables
That's your problem. It checks to see if the compiler (cc) can handle the simplest program it can get away with, and write the file. That checks that a compiler exists, and can compile & write. You fail.

What book are you in? What page number? What Project? What are you compiling for? LFS has several projects on offer.
 
Old 11-14-2018, 07:05 AM   #3
lfs1121
Member
 
Registered: Nov 2018
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
Code:
configure: error: C compiler cannot create executables
That's your problem. It checks to see if the compiler (cc) can handle the simplest program it can get away with, and write the file. That checks that a compiler exists, and can compile & write. You fail.

What book are you in? What page number? What Project? What are you compiling for? LFS has several projects on offer.
I am building linux from scratch following the instructions from LFS Book 8.3, chapter 6. I have completed the previous chapters with no errors.
At the moment, I am compiling psmisc-23.2 package.
Code:
 I get this error configure: error: C compiler cannot create executables
for all other packages that begins compilation with
Code:
 ./configure --prefix=/usr
Here is the html link to the book I am following:
http://www.linuxfromscratch.org/lfs/...-system-kernfs

Last edited by lfs1121; 11-14-2018 at 07:22 AM.
 
Old 11-14-2018, 11:53 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
That's python utilities, and not in chapter 6 of LFS unless you can quote me thye page number (top LH corner)

Anyhow, my diagnosis is correct. Your compiler is AWOL. If you're starting chapter 6, your $PATH should be showing the compiler in /tools. Start over at the beginning of ch 6. If you're not starting, tell me what you have done.
 
Old 11-14-2018, 01:14 PM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,570
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
Quote:
Originally Posted by business_kid View Post
If you're starting chapter 6, your $PATH should be showing the compiler in /tools. Start over at the beginning of ch 6. If you're not starting, tell me what you have done.
Actually if he is carrying out the instructions in the correct sequence, he will be well into chapter 6 by the time psmisc comes along. The complete toolchain (gcc, binutils, glibc) should be in /usr/bin and the /tools versions will not be used any more.

@OP: have you had this problem on any of your previous Chapter 6 builds (e.g sed or libcap)? Did gcc pass all its sanity tests? Did you correctly carry out the adjustments in 6.10? And are you doing all this in one session or are you going in and out of chroot? If you are doing that, have you checked at the beginning of each session that your mount and chroot was correctly carried out?
 
Old 11-14-2018, 03:21 PM   #6
lfs1121
Member
 
Registered: Nov 2018
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
That's python utilities, and not in chapter 6 of LFS unless you can quote me thye page number (top LH corner)

Anyhow, my diagnosis is correct. Your compiler is AWOL. If you're starting chapter 6, your $PATH should be showing the compiler in /tools. Start over at the beginning of ch 6. If you're not starting, tell me what you have done.
The page number of Linux From Scratch-Version 8.3 is 137. The package name is 6.29. Psmics-23.1. I get the error message after running the command
Code:
 ./configure --prefix=/usr
All the previous packages I compiled are exactly done the way instructed in the book.
 
Old 11-14-2018, 03:27 PM   #7
lfs1121
Member
 
Registered: Nov 2018
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
Actually if he is carrying out the instructions in the correct sequence, he will be well into chapter 6 by the time psmisc comes along. The complete toolchain (gcc, binutils, glibc) should be in /usr/bin and the /tools versions will not be used any more.

@OP: have you had this problem on any of your previous Chapter 6 builds (e.g sed or libcap)? Did gcc pass all its sanity tests? Did you correctly carry out the adjustments in 6.10? And are you doing all this in one session or are you going in and out of chroot? If you are doing that, have you checked at the beginning of each session that your mount and chroot was correctly carried out?
You are right, I am carrying out the instructions in a sequence-following the book. I did not have any error with the previous packages. I also did not proceed in case I get any error while compiling previous packages. No, I am not doing all these in one session. I mount my devices and chroot at each login with the following commands:
Code:
#set variables of LFS
export LFS=/mnt/lfs

#mount LFS and boot partitions
sudo mount -v -t ext4 /dev/<xxx> $LFS
sudo mount -v -t ext2 /dev/<xxx> $LFS/boot

#start swap partition
sudo /sbin/swapon -v /dev/<xxx>

cd $LFS

#login to chroot
sudo chroot "$LFS" /tools/bin/env -i \
    HOME=/root                  \
    TERM="$TERM"                \
    PS1='(lfs chroot) \u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h
 
Old 11-14-2018, 04:00 PM   #8
lfs1121
Member
 
Registered: Nov 2018
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lfs1121 View Post
You are right, I am carrying out the instructions in a sequence-following the book. I did not have any error with the previous packages. I also did not proceed in case I get any error while compiling previous packages. No, I am not doing all these in one session. I mount my devices and chroot at each login with the following commands:
Code:
#set variables of LFS
export LFS=/mnt/lfs

#mount LFS and boot partitions
sudo mount -v -t ext4 /dev/<xxx> $LFS
sudo mount -v -t ext2 /dev/<xxx> $LFS/boot

#start swap partition
sudo /sbin/swapon -v /dev/<xxx>

cd $LFS

#login to chroot
sudo chroot "$LFS" /tools/bin/env -i \
    HOME=/root                  \
    TERM="$TERM"                \
    PS1='(lfs chroot) \u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h
So I started to redo the steps from recompiling GCC8.2.0 package (Linux From Scratch-Version 8.3 page# 122).
When running
Code:
rm -f /usr/lib/gcc
It gave me the following error that can not delete lib/gcc is not a directory. I then removed it with -rf command
Code:
rm -rf /usr/lib/gcc
and when running the SED commands, I get the following error
Code:
(lfs chroot) root:/sources/gcc-8.2.0# 
(lfs chroot) root:/sources/gcc-8.2.0# rm -rf /usr/lib/gcc
(lfs chroot) root:/sources/gcc-8.2.0# mkdir -v build
mkdir: created directory 'build'
(lfs chroot) root:/sources/gcc-8.2.0# cd build
<.2.0/build# SED=sed                               \
> ../configure --prefix=/usr            \
>              --enable-languages=c,c++ \
>              --disable-multilib       \
>              --disable-bootstrap      \
>              --disable-libmpx         \
>              --with-system-zlib
configure: error: cannot run /bin/sh ../config.sub
 
Old 11-14-2018, 04:09 PM   #9
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
You dont show you are mounting
mount -v --bind /dev $LFS/dev and
mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
Chapters 6.2.2 and 6.2.3

Before you enter chroot
 
Old 11-15-2018, 02:11 AM   #10
lfs1121
Member
 
Registered: Nov 2018
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
You dont show you are mounting
mount -v --bind /dev $LFS/dev and
mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
Chapters 6.2.2 and 6.2.3

Before you enter chroot
This time I did the following steps first:
Code:
#set variables of LFS
export LFS=/mnt/lfs

#mount LFS and boot partitions
sudo mount -v -t ext4 /dev/<xxx> $LFS
sudo mount -v -t ext2 /dev/<xxx> $LFS/boot

#start swap partition
sudo /sbin/swapon -v /dev/<xxx>

#First mount the following
sudo mount -v --bind /dev $LFS/dev
sudo mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
sudo mount -vt proc proc $LFS/proc
sudo mount -vt sysfs sysfs $LFS/sys
sudo mount -vt tmpfs tmpfs $LFS/run

#Go to chroot
sudo chroot "$LFS" /tools/bin/env -i \
    HOME=/root                  \
    TERM="$TERM"                \
    PS1='(lfs chroot) \u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h
Then I restarted compiling the GCC8.2.0 package in Chapter 6, section 6.21.1. I get the following error
Code:
 
(lfs chroot) root:/sources# cd gcc-8.2.0
(lfs chroot) root:/sources/gcc-8.2.0# case $(uname -m) in
>   x86_64)
>     sed -e '/m64=/s/lib64/lib/' \
>         -i.orig gcc/config/i386/t-linux64
>   ;;
> esac
(lfs chroot) root:/sources/gcc-8.2.0# rm -f /usr/lib/gcc
(lfs chroot) root:/sources/gcc-8.2.0# mkdir -v build
mkdir: created directory 'build'
(lfs chroot) root:/sources/gcc-8.2.0# cd       build
(lfs chroot) root:/sources/gcc-8.2.0/build# 
(lfs chroot) root:/sources/gcc-8.2.0/build# 
<.2.0/build# SED=sed                               \
> ../configure --prefix=/usr            \
>              --enable-languages=c,c++ \
>              --disable-multilib       \
>              --disable-bootstrap      \
>              --disable-libmpx         \
>              --with-system-zlib
configure: error: cannot run /bin/sh ../config.sub
(lfs chroot) root:/sources/gcc-8.2.0/build#
I had previously compiled this package and got no error, the installation went successful, but I don't understand what I am doing wrong and I am already exhausted.
 
Old 11-15-2018, 04:09 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
@lfs1121: Doing LFS when things go wrong can be exhausting. We've all been there (Well, I certainly have).

Going back before the $PATH was readjusted (to get rid on /tools) is probably a good idea. Ch 6 from the top. Losing gcc is a show stopper - nothing would compile. So some recent package must have introduced that error, and that's exactly the sort of thing you don't want to chase. It could be worse. Halfway through ch. 6, I once found I had to delete, change my main OS, & restart ch.5 .
 
Old 11-15-2018, 04:15 AM   #12
lfs1121
Member
 
Registered: Nov 2018
Posts: 31

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by business_kid View Post
@lfs1121: Doing LFS when things go wrong can be exhausting. We've all been there (Well, I certainly have).

Going back before the $PATH was readjusted (to get rid on /tools) is probably a good idea. Ch 6 from the top. Losing gcc is a show stopper - nothing would compile. So some recent package must have introduced that error, and that's exactly the sort of thing you don't want to chase. It could be worse. Halfway through ch. 6, I once found I had to delete, change my main OS, & restart ch.5 .
Well, I just started to do chapter 6 from the beginning. Are you suggesting that I should redoing the process from Chapter 5? Doing LFS is part of my course assignment. Unfortunately, I am almost running out of time for this assignment.
 
Old 11-15-2018, 06:03 AM   #13
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,570
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
Oh dear! From what you have said, I am pretty sure your chroot before doing psmisc was bad. Either you did not mount all your dynamic filesystems, as Spiky suggested, or you did not have LFS defined on your host system. If you had not panicked, the problem could have been solved very simply: exit chroot, set up all necessary filesystems properly (and make sure they are there by running the mount command), go back into chroot, delete the psmisc directory and untar the package afresh.

Unfortunately it seems that you have now started deleting previously installed stuff so you cannot continue.

Repeating chapter 6 from the beginning will probably not work because of the alterations you made to /tools/bin/ld and /tools/bin/gcc in 6.10. Repeating chapter 5 would work, but you say you have a problem with time.

For the future, I suggest that you create a script covering sections 6.2 and 6.4 and keep it in /root ready to run. Here is the one I use:
Code:
#! /bin/bash

# Define LFS variable
export LFS="/mnt/newlfs"

# Mount new LFS partition
mount /dev/sda5

# Mount dynamic directories
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run

#...and now chroot!
chroot "$LFS" /tools/bin/env -i \
 HOME=/root     TERM="$TERM" \
 PS1='(lfs chroot) \u:\w\$ ' \
 PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
/tools/bin/bash --login
If you go in and out of chroot by hand on different days, it is all too easy to miss something out.

Last edited by hazel; 11-15-2018 at 06:10 AM.
 
Old 11-15-2018, 06:30 AM   #14
lfs1121
Member
 
Registered: Nov 2018
Posts: 31

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by hazel View Post
Oh dear! From what you have said, I am pretty sure your chroot before doing psmisc was bad. Either you did not mount all your dynamic filesystems, as Spiky suggested, or you did not have LFS defined on your host system. If you had not panicked, the problem could have been solved very simply: exit chroot, set up all necessary filesystems properly (and make sure they are there by running the mount command), go back into chroot, delete the psmisc directory and untar the package afresh.

Unfortunately it seems that you have now started deleting previously installed stuff so you cannot continue.

Repeating chapter 6 from the beginning will probably not work because of the alterations you made to /tools/bin/ld and /tools/bin/gcc in 6.10. Repeating chapter 5 would work, but you say you have a problem with time.

For the future, I suggest that you create a script covering sections 6.2 and 6.4 and keep it in /root ready to run. Here is the one I use:
Code:
#! /bin/bash

# Define LFS variable
export LFS="/mnt/newlfs"

# Mount new LFS partition
mount /dev/sda5

# Mount dynamic directories
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run

#...and now chroot!
chroot "$LFS" /tools/bin/env -i \
 HOME=/root     TERM="$TERM" \
 PS1='(lfs chroot) \u:\w\$ ' \
 PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
/tools/bin/bash --login
If you go in and out of chroot by hand on different days, it is all too easy to miss something out.
Thank you all so much for the help. I am now restarting the steps from the very beginning. Even redoing from chapter 5 didn't help. I sure learned from the errors I got and learned how to troubleshot them.
 
  


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 v8.2 sec 6.29 Psmisc - cannot find tinfo, ncurses termcap spenced Linux From Scratch 2 06-03-2018 10:19 AM
[SOLVED] [LFS 7.4] Problem with Psmisc-22.20 configuration fedifedi Linux From Scratch 5 10-23-2013 04:56 AM
[SOLVED] problem configureing psmisc-22.10 (Linux From Scratch - Version 6.6 chapter 6.52) frieza Linux From Scratch 2 09-06-2010 11:48 PM
[SOLVED] LFS 6.6/6.6-rc1, Chapter 6.52: psmisc-22.10 crts Linux From Scratch 8 08-22-2010 09:04 AM
LFS 6.3, messed up somewhere prior to chapter 6.12 (gcc), how to restart chapter 6? Funkster Linux From Scratch 2 12-24-2008 06:30 AM

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

All times are GMT -5. The time now is 11:56 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