Discussion:
[lfs-support] Building LFS under Debian
Alan Corey
2018-07-08 16:25:43 UTC
Permalink
LFS is a work of art, I can't believe it's been around 20 years and
I'd never heard of it. 20 years ago I was downloading Slackware on
floppies and lugging them home from college.

The paths are sort of intricate to a newcomer though. There are the
paths I see, the paths the chroot is going to see, then paths used as
prefix and lib-path. At couple diagrams might help in the beginning.
I'm still stuck on binutils, chapter 5,
http://www.linuxfromscratch.org/lfs/view/stable/chapter05/binutils-pass1.html

I started out making a mountpoint called /lfs to mount the partition
I'm working in, then decided it was a bad idea. What I have looks
like:

/lost+found
/media
/mnt
lfs
sources
binutils-2.30
build
tools
/opt
/proc

Filezilla has nice directory trees BTW if somebody wants to do
screenshots for documenting. :) Anyway I'm not sure that's right.
Does the page mean to make build inside of binutils or is it outside
to be used again later? My $LFS is set to /mnt/lfs

I made a little cfg script for consistency rather than doing it from
memory, it's mostly copied from the web page:
#!/bin/sh
../configure --prefix=/tools \
--with-sysroot=$LFS \
--with-lib-path=/tools/lib \
--target=$LFS_TGT \
--disable-nls \
--disable-werror

configure echos it back as
../configure --prefix=/tools --with-sysroot=/mnt/lfs
--with-lib-path=/tools/lib --target=aarch64-lfs-linux-gnu
--disable-nls --disable-werror

in the config.log. OK, I'll attach the log.

What worries me is the
gcc: error trying to exec 'as': execvp: Too many levels of symbolic links
In the conftest. Debian has this kludgy alternatives system where gcc
is /usr/bin/gcc but that's
lrwxrwxrwx 1 root root 5 Apr 4 06:16 gcc -> gcc-7
and that's
lrwxrwxrwx 1 root root 23 Jun 26 03:52 gcc-7 -> aarch64-linux-gnu-gcc-7
And aarch64-linux-gnu-gcc-7 is the real name of gcc 7
maybe that's just part of conftest but configure dies with an error
and no makefile. as is:
as -> aarch64-linux-gnu-as in /usr/bin

These kludgy scripts, and PAM/Selinux/Apparmor are what I'm hoping to
get away from with linuxfromscratch. Yes, I usually have a few gcc
and as and g++ versions around but it seems like there should be a
better way.

Alan
--
-------------
No, I won't call it "climate change", do you have a "reality problem"? - AB1JX
Impeach Impeach Impeach Impeach Impeach Impeach Impeach Impeach
spiky
2018-07-08 16:31:30 UTC
Permalink
Post by Alan Corey
LFS is a work of art, I can't believe it's been around 20 years and
I'd never heard of it. 20 years ago I was downloading Slackware on
floppies and lugging them home from college.
The paths are sort of intricate to a newcomer though. There are the
paths I see, the paths the chroot is going to see, then paths used as
prefix and lib-path. At couple diagrams might help in the beginning.
I'm still stuck on binutils, chapter 5,
http://www.linuxfromscratch.org/lfs/view/stable/chapter05/binutils-pass1.html
I started out making a mountpoint called /lfs to mount the partition
I'm working in, then decided it was a bad idea. What I have looks
/lost+found
/media
/mnt
lfs
sources
binutils-2.30
build
tools
/opt
/proc
Filezilla has nice directory trees BTW if somebody wants to do
screenshots for documenting. :) Anyway I'm not sure that's right.
Does the page mean to make build inside of binutils or is it outside
to be used again later? My $LFS is set to /mnt/lfs
I made a little cfg script for consistency rather than doing it from
#!/bin/sh
../configure --prefix=/tools \
--with-sysroot=$LFS \
--with-lib-path=/tools/lib \
--target=$LFS_TGT \
--disable-nls \
--disable-werror
configure echos it back as
../configure --prefix=/tools --with-sysroot=/mnt/lfs
--with-lib-path=/tools/lib --target=aarch64-lfs-linux-gnu
--disable-nls --disable-werror
in the config.log. OK, I'll attach the log.
What worries me is the
gcc: error trying to exec 'as': execvp: Too many levels of symbolic links
In the conftest. Debian has this kludgy alternatives system where gcc
is /usr/bin/gcc but that's
lrwxrwxrwx 1 root root 5 Apr 4 06:16 gcc -> gcc-7
and that's
lrwxrwxrwx 1 root root 23 Jun 26 03:52 gcc-7 -> aarch64-linux-gnu-gcc-7
And aarch64-linux-gnu-gcc-7 is the real name of gcc 7
maybe that's just part of conftest but configure dies with an error
as -> aarch64-linux-gnu-as in /usr/bin
These kludgy scripts, and PAM/Selinux/Apparmor are what I'm hoping to
get away from with linuxfromscratch. Yes, I usually have a few gcc
and as and g++ versions around but it seems like there should be a
better way.
Alan
The build dir gose inside binutils.
Untar package cd package dir follow book, always remove the used dir
after you have built it.
spiky
2018-07-08 17:15:52 UTC
Permalink
Post by Alan Corey
LFS is a work of art, I can't believe it's been around 20 years and
I'd never heard of it. 20 years ago I was downloading Slackware on
floppies and lugging them home from college.
The paths are sort of intricate to a newcomer though. There are the
paths I see, the paths the chroot is going to see, then paths used as
prefix and lib-path. At couple diagrams might help in the beginning.
I'm still stuck on binutils, chapter 5,
http://www.linuxfromscratch.org/lfs/view/stable/chapter05/binutils-pass1.html
I started out making a mountpoint called /lfs to mount the partition
I'm working in, then decided it was a bad idea. What I have looks
/lost+found
/media
/mnt
lfs
sources
binutils-2.30
build
tools
/opt
/proc
Filezilla has nice directory trees BTW if somebody wants to do
screenshots for documenting. :) Anyway I'm not sure that's right.
Does the page mean to make build inside of binutils or is it outside
to be used again later? My $LFS is set to /mnt/lfs
I made a little cfg script for consistency rather than doing it from
#!/bin/sh
../configure --prefix=/tools \
--with-sysroot=$LFS \
--with-lib-path=/tools/lib \
--target=$LFS_TGT \
--disable-nls \
--disable-werror
configure echos it back as
../configure --prefix=/tools --with-sysroot=/mnt/lfs
--with-lib-path=/tools/lib --target=aarch64-lfs-linux-gnu
--disable-nls --disable-werror
in the config.log. OK, I'll attach the log.
What worries me is the
gcc: error trying to exec 'as': execvp: Too many levels of symbolic links
In the conftest. Debian has this kludgy alternatives system where gcc
is /usr/bin/gcc but that's
lrwxrwxrwx 1 root root 5 Apr 4 06:16 gcc -> gcc-7
and that's
lrwxrwxrwx 1 root root 23 Jun 26 03:52 gcc-7 -> aarch64-linux-gnu-gcc-7
And aarch64-linux-gnu-gcc-7 is the real name of gcc 7
maybe that's just part of conftest but configure dies with an error
as -> aarch64-linux-gnu-as in /usr/bin
These kludgy scripts, and PAM/Selinux/Apparmor are what I'm hoping to
get away from with linuxfromscratch. Yes, I usually have a few gcc
and as and g++ versions around but it seems like there should be a
better way.
Alan
Did you also run the version check script chapter 2.2?
Bruce Dubbs
2018-07-08 17:18:03 UTC
Permalink
Post by Alan Corey
LFS is a work of art, I can't believe it's been around 20 years and
I'd never heard of it. 20 years ago I was downloading Slackware on
floppies and lugging them home from college.
The paths are sort of intricate to a newcomer though. There are the
paths I see, the paths the chroot is going to see, then paths used as
prefix and lib-path. At couple diagrams might help in the beginning.
I'm still stuck on binutils, chapter 5,
http://www.linuxfromscratch.org/lfs/view/stable/chapter05/binutils-pass1.html
I started out making a mountpoint called /lfs to mount the partition
I'm working in, then decided it was a bad idea. What I have looks
/lost+found
/media
/mnt
lfs
sources
binutils-2.30
build
tools
/opt
/proc
Whys is there no lost+found in /mnt/lfs? If you mounted your lfs
partition on /mnt, it should be there. However the rest looks OK.
Post by Alan Corey
Filezilla has nice directory trees BTW if somebody wants to do
screenshots for documenting. :) Anyway I'm not sure that's right.
Does the page mean to make build inside of binutils or is it outside
to be used again later? My $LFS is set to /mnt/lfs
It should be inside. One issue that trips many up is that the
procedures in Section 5.3:

untar
cd
follow instructions as written
cd back to sources
rm expanded directory

Every time.

Another thing that trips up new users is doing some things as root. The
LFS environment variable needs to be set for root also. See the caution
in Sectipn 2.6. Setting The $LFS Variable.
Post by Alan Corey
I made a little cfg script for consistency rather than doing it from
#!/bin/sh
../configure --prefix=/tools \
--with-sysroot=$LFS \
--with-lib-path=/tools/lib \
--target=$LFS_TGT \
--disable-nls \
--disable-werror
configure echos it back as
../configure --prefix=/tools --with-sysroot=/mnt/lfs
--with-lib-path=/tools/lib --target=aarch64-lfs-linux-gnu
--disable-nls --disable-werror
We do not test LFS on an ARM processor. What you have above looks OK,
but I cannot say the system will be built properly or not. I suggest
double checking the host system requirements (Section 2.2).
Post by Alan Corey
in the config.log. OK, I'll attach the log.
What worries me is the
gcc: error trying to exec 'as': execvp: Too many levels of symbolic links
In the conftest. Debian has this kludgy alternatives system where gcc
is /usr/bin/gcc but that's
lrwxrwxrwx 1 root root 5 Apr 4 06:16 gcc -> gcc-7
and that's
lrwxrwxrwx 1 root root 23 Jun 26 03:52 gcc-7 -> aarch64-linux-gnu-gcc-7
And aarch64-linux-gnu-gcc-7 is the real name of gcc 7
maybe that's just part of conftest but configure dies with an error
as -> aarch64-linux-gnu-as in /usr/bin
Those symlinks are probably OK. Debian uses the same thing on x86_64.

-- Bruce
Post by Alan Corey
These kludgy scripts, and PAM/Selinux/Apparmor are what I'm hoping to
get away from with linuxfromscratch. Yes, I usually have a few gcc
and as and g++ versions around but it seems like there should be a
better way.
Alan
--
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
Pierre Labastie
2018-07-08 20:35:14 UTC
Permalink
Post by Alan Corey
LFS is a work of art, I can't believe it's been around 20 years and
I'd never heard of it. 20 years ago I was downloading Slackware on
floppies and lugging them home from college.
The paths are sort of intricate to a newcomer though. There are the
paths I see, the paths the chroot is going to see, then paths used as
prefix and lib-path. At couple diagrams might help in the beginning.
I'm still stuck on binutils, chapter 5,
http://www.linuxfromscratch.org/lfs/view/stable/chapter05/binutils-pass1.html
I started out making a mountpoint called /lfs to mount the partition
I'm working in, then decided it was a bad idea. What I have looks
/lost+found
/media
/mnt
lfs
sources
binutils-2.30
build
tools
/opt
/proc
Looks OK, except you did not mention the symbolic link:
/tools -> /mnt/lfs/tools

This symlink is important and supposed to exist by (almost) all the
instructions in chapter 5...
Post by Alan Corey
Filezilla has nice directory trees BTW if somebody wants to do
screenshots for documenting. :) Anyway I'm not sure that's right.
Does the page mean to make build inside of binutils or is it outside
to be used again later? My $LFS is set to /mnt/lfs
I made a little cfg script for consistency rather than doing it from
#!/bin/sh
../configure --prefix=/tools \
--with-sysroot=$LFS \
--with-lib-path=/tools/lib \
--target=$LFS_TGT \
--disable-nls \
--disable-werror
configure echos it back as
../configure --prefix=/tools --with-sysroot=/mnt/lfs
--with-lib-path=/tools/lib --target=aarch64-lfs-linux-gnu
--disable-nls --disable-werror
So your CPU is ARM, isn't it? I guess not many people on this list have
experience with that architecture. This does not mean they can't help, but
their support may be limited.
Post by Alan Corey
in the config.log. OK, I'll attach the log.
What worries me is the
gcc: error trying to exec 'as': execvp: Too many levels of symbolic links
In the conftest. Debian has this kludgy alternatives system where gcc
is /usr/bin/gcc but that's
lrwxrwxrwx 1 root root 5 Apr 4 06:16 gcc -> gcc-7
and that's
lrwxrwxrwx 1 root root 23 Jun 26 03:52 gcc-7 -> aarch64-linux-gnu-gcc-7
And aarch64-linux-gnu-gcc-7 is the real name of gcc 7
maybe that's just part of conftest but configure dies with an error
as -> aarch64-linux-gnu-as in /usr/bin
Does compiling a simple program work?
Try something like (first as a normal user then as the lfs user):

echo 'int main(){}' > simple.c
gcc simple.c
# if there is no error
rm simple.c a.out

If it does not work, this is a problem with debian. If it works, well...
configure should work too.
Post by Alan Corey
These kludgy scripts, and PAM/Selinux/Apparmor are what I'm hoping to
get away from with linuxfromscratch. Yes, I usually have a few gcc
and as and g++ versions around but it seems like there should be a
better way.
Spiky has answered with a few advises, which I recommend too, especially the
"version-check.sh" script.

Pierre
--
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/Pos
Ken Moffat
2018-07-08 21:20:55 UTC
Permalink
Post by Pierre Labastie
So your CPU is ARM, isn't it? I guess not many people on this list have
experience with that architecture. This does not mean they can't help, but
their support may be limited.
Apart from all the good comments from everyone, I think I need to
stress this point, and to note that understanding *how* LFS fits
together is easiest if you have a spare x86_64 partition where you
can install it - that approach is common and comparatively
well-tested, i686 should work but is nowadays only rarely tested.
Everything else will have differences.

But on the aarch64 machine you (Alan) need to get a working toolchain
on your host before you can get anywhere.

If that machine is some sort of Raspberry Pi, perhaps
http://intestinate.com/pilfs/ might have something useful on changes
to the process (seems to have last been updated in March, and refers
to a 4.14 kernel).

ĸen
--
Keyboard not found, Press F1 to continue
--
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
Don Cross
2018-07-08 22:33:20 UTC
Permalink
Post by Ken Moffat
Post by Pierre Labastie
So your CPU is ARM, isn't it? I guess not many people on this list have
experience with that architecture. This does not mean they can't help,
but
Post by Pierre Labastie
their support may be limited.
Apart from all the good comments from everyone, I think I need to
stress this point, and to note that understanding *how* LFS fits
together is easiest if you have a spare x86_64 partition where you
can install it - that approach is common and comparatively
well-tested, i686 should work but is nowadays only rarely tested.
Everything else will have differences.
But on the aarch64 machine you (Alan) need to get a working toolchain
on your host before you can get anywhere.
If that machine is some sort of Raspberry Pi, perhaps
http://intestinate.com/pilfs/ might have something useful on changes
to the process (seems to have last been updated in March, and refers
to a 4.14 kernel).
Äžen
I successfully completed a PiLFS build on a Raspberry Pi 3 a couple of
months ago. I took extensive notes along the way. One thing I would
recommend as you follow along with
http://intestinate.com/pilfs/guide.html
is to disable parallel building: edit ch6-build.sh and set PARALLEL_JOBS=1.
I left the default on my first attempt and something went wrong with step #
6.23 (ncurses). I suspect it either ran out of memory or there was a race
condition in the build process. Also, on my second (successful) attempt, I
did not install all locales (INSTALL_ALL_LOCALES=0). Everything worked fine
after these 2 changes. I can provide more details if that would be helpful.
- Don

Continue reading on narkive:
Loading...