You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project does not produce (yet?) an image bootable with qemu-system-aarch64 on Apple Silicon. Maybe the errors and notes provided here can be useful later.
Some observations:
The first indication that something is off is in cat $LFS/jhalfs/logs/505-gcc-libstdc++-12.2.0 of 505-gcc-libstdc++
rm: cannot remove '/vagrant/jhalfs/mnt/build_dir/usr/lib/libstdc++.la': No such file or directory
rm: cannot remove '/vagrant/jhalfs/mnt/build_dir/usr/lib/libstdc++fs.la': No such file or directory
rm: cannot remove '/vagrant/jhalfs/mnt/build_dir/usr/lib/libsupc++.la': No such file or directory
It can be notes that the la files are being written into the usr/lib4 folder instead.
For now the error can be ignored by modifying $LFS/jhalfs/lfs-commands/chapter05/505-gcc-libstdc++
When kill -15 11111 is used, the target proceeds and finishes the without errors.
The logs cat $LFS/jhalfs/test-logs/803-glibc-2.36 shows the tests finished
Summary of test results:
169 FAIL
4440 PASS
51 UNSUPPORTED
16 XFAIL
2 XPASS
make[2]: *** [Makefile:647: tests] Error 1
make[2]: Target 'check' not remade because of errors.
make[2]: Leaving directory '/sources/glibc-2.36'
make[1]: *** [Makefile:9: check] Error 2
and differ slightly vs the corresponding log on x86_64/amd64 (which does not require kill)
Summary of test results:
5 FAIL
5032 PASS
124 UNSUPPORTED
16 XFAIL
4 XPASS
make[2]: *** [Makefile:647: tests] Error 1
make[2]: Target 'check' not remade because of errors.
make[2]: Leaving directory '/sources/glibc-2.36'
make[1]: *** [Makefile:9: check] Error 2
make[1]: Leaving directory '/sources/glibc-2.36/build'
The next error appears in 814-expect. The build log $LFS/jhalfs/logs/814-expect-5.45.4 shows the build platform $(uname -m) == aarch64) is uknown to expect
...
checking if running Sequent running SVR4... no
checking build system type... tclconfig/config.guess: unable to guess system type
This script, last modified 2003-10-07, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run (tclconfig/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <[email protected]>in order to provide the needed
information to handle your system.
config.guess timestamp = 2003-10-07
uname -m = aarch64
uname -r = 5.15.64-0-virt
uname -s = Linux
uname -v = #1-Alpine SMP Mon, 05 Sep 2022 08:02:49 +0000
/usr/bin/uname -p = unknown
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch =
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = aarch64
UNAME_RELEASE = 5.15.64-0-virt
UNAME_SYSTEM = Linux
UNAME_VERSION = #1-Alpine SMP Mon, 05 Sep 2022 08:02:49 +0000
configure: error: cannot guess build type; you must specify one
This can be remediated by adjusting $LFS/jhalfs/fs-commands/chapter08/814-expect to use arm (not arm64)
./configure
...
--build=arm
...
The next error happens in 824-gcc, the log cat jhalfs/logs/824-gcc-12.2.0 shows the build fails to find py files under ./user/lib
...
'/usr/lib/bfd-plugins/liblto_plugin.so' ->'../../libexec/gcc/aarch64-unknown-linux-gnu/12.2.0/liblto_plugin.so'
mkdir: created directory '/usr/share/gdb'
mkdir: created directory '/usr/share/gdb/auto-load'
mkdir: created directory '/usr/share/gdb/auto-load/usr'
mkdir: created directory '/usr/share/gdb/auto-load/usr/lib'
mv: cannot stat '/usr/lib/*gdb.py': No such file or directory
Let's ignore the error by commenting out the line mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib in $LFS/jhalfs/lfs-commands/chapter08/824-gcc and proceed.
The next issue appears in 847-libffi, but can only be noticed when trying to build 851-meson, whose log cat $LFS/jhalfs/logs/851-meson-0.63.2 shows
Processing /sources/meson-0.63.2
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [64 lines of output]
/usr/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
running dist_info
creating /tmp/pip-modern-metadata-_hbvr78y/meson.egg-info
...
File "/usr/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 26, in<module>
from .macosx_libfile import calculate_macosx_platform_tag
File "/usr/lib/python3.10/site-packages/wheel/macosx_libfile.py", line 41, in<module>
import ctypes
File "/usr/lib/python3.10/ctypes/__init__.py", line 8, in<module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
....
As a workaroun libffi can to configured with --disable-multi-os-directory flag in $LFS/jhalfs/lfs-commands/chapter08/847-libffi, rebuilt, then python also rebuilt. Meson should then install without any modifications.
The next build issue appears for 856-findutils whose build log cat $LFS/jhalfs/logs/856-findutils-4.9.0 reports there is no Makefile
make[1]: Entering directory '/sources/findutils-4.9.0'
There seems to be no Makefile in this directory.
You must run ./configure before running 'make'.
make[1]: *** [GNUmakefile:108: abort-due-to-no-makefile] Error 1
make[1]: Leaving directory '/sources/findutils-4.9.0'
This can be remediated in $LFS/jhalfs/lfs-commands/chapter08/856-findutils which needs the aarch64 platform added x86_64|aarch64) ./configure --prefix=/usr --localstatedir=/var/lib/locate ;;.
At the time the error is found in 873-procps-ng-4.0.0 log cat $LFS/jhalfs/logs/873-procps-ng-4.0.0 it becomes clear that many libraries are placed in ./usr/lib64 and this location is not used for configure
checking for libsystemd-login... no
configure: error: Package requirements (libsystemd-login) were not met:
No package 'libsystemd-login' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables SYSTEMD_CFLAGS
and SYSTEMD_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
As a drastic workaround, linking everthing present under ./usr/lib64 can be considered
The build of 1002-kernel requires changing $LFS/jhalfs/lfs-commands/chapter10/1002-kernel to use Image instead of bzImagecp -v arch/arm64/boot/Image /boot/vmlinuz-5.19.13-lfs-r11.2-125-systemd+.
The boot process is unclear yet. The main question may be how to boot a BIOS based qemu image as compared to UEFI one as asked here and here. Currently qemu-system-aarch64 -m 256M -smp 1 -drive file=build_dir.img,format=raw,if=virtio -machine type=virt,accel=hvf,highmem=off -cpu cortex-a72 results only in qemu monitor shown. The surprising fact (?? verify this once more) is that even booting UEFI ubuntu arm64 as descibed in https://gist.github.com/nrjdalal/e70249bb5d2e9d844cc203fd11f74c55 stays at qemu monitor.
The text was updated successfully, but these errors were encountered:
It looks like you are using an x86 book for building on aarch64: this cannot work, although there are not so many changes needed. You can find an aarch64 lfs book at two places:
in the xry111/arm64 branch of https://git.linuxfromscratch.org/lfs.git
For the first one, you need to clone the repo, and use it as a working copy for jhalfs. For the second one, you can enter xry111/arm64 as the branch. Then all the build problem should be solved (well, I'm not the maintainer of those branches, so...).
The project does not produce (yet?) an image bootable with
qemu-system-aarch64
on Apple Silicon. Maybe the errors and notes provided here can be useful later.Some observations:
The first indication that something is off is in
cat $LFS/jhalfs/logs/505-gcc-libstdc++-12.2.0
of 505-gcc-libstdc++It can be notes that the
la
files are being written into theusr/lib4
folder instead.For now the error can be ignored by modifying
$LFS/jhalfs/lfs-commands/chapter05/505-gcc-libstdc++
rm -vf $LFS/usr/lib/lib{stdc++,stdc++fs,supc++}.la
At the end of the lfs build, the following files may be present
ls ./usr/lib64/*.la ./usr/lib64/libasan.la ./usr/lib64/libgomp.la ./usr/lib64/libssp.la ./usr/lib64/libsupc++.la ./usr/lib64/libatomic.la ./usr/lib64/libhwasan.la ./usr/lib64/libssp_nonshared.la ./usr/lib64/libtsan.la ./usr/lib64/libcc1.la ./usr/lib64/libitm.la ./usr/lib64/libstdc++.la ./usr/lib64/libubsan.la ./usr/lib64/libffi.la ./usr/lib64/liblsan.la ./usr/lib64/libstdc++fs.la
The next issue appears for 803-glibc-2.36, where it hangs at
make -k check
.When
kill -15 11111
is used, the target proceeds and finishes the without errors.The logs
cat $LFS/jhalfs/test-logs/803-glibc-2.36
shows the tests finishedand differ slightly vs the corresponding log on
x86_64/amd64
(which does not requirekill
)The next error appears in 814-expect. The build log
$LFS/jhalfs/logs/814-expect-5.45.4
shows the build platform$(uname -m) == aarch64)
is uknown to expectThis can be remediated by adjusting
$LFS/jhalfs/fs-commands/chapter08/814-expect
to usearm
(notarm64
)The next error happens in 824-gcc, the log
cat jhalfs/logs/824-gcc-12.2.0
shows the build fails to find py files under./user/lib
Let's ignore the error by commenting out the line
mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib
in$LFS/jhalfs/lfs-commands/chapter08/824-gcc
and proceed.The next issue appears in 847-libffi, but can only be noticed when trying to build 851-meson, whose log
cat $LFS/jhalfs/logs/851-meson-0.63.2
showsAs a workaroun libffi can to configured with --disable-multi-os-directory flag in
$LFS/jhalfs/lfs-commands/chapter08/847-libffi
, rebuilt, then python also rebuilt. Meson should then install without any modifications.The next build issue appears for 856-findutils whose build log
cat $LFS/jhalfs/logs/856-findutils-4.9.0
reports there is no MakefileThis can be remediated in
$LFS/jhalfs/lfs-commands/chapter08/856-findutils
which needs theaarch64
platform addedx86_64|aarch64) ./configure --prefix=/usr --localstatedir=/var/lib/locate ;;
.At the time the error is found in 873-procps-ng-4.0.0 log
cat $LFS/jhalfs/logs/873-procps-ng-4.0.0
it becomes clear that many libraries are placed in./usr/lib64
and this location is not used for configureAs a drastic workaround, linking everthing present under
./usr/lib64
can be consideredThe build of 1002-kernel requires changing
$LFS/jhalfs/lfs-commands/chapter10/1002-kernel
to useImage
instead ofbzImage
cp -v arch/arm64/boot/Image /boot/vmlinuz-5.19.13-lfs-r11.2-125-systemd+
.The boot process is unclear yet. The main question may be how to boot a BIOS based qemu image as compared to UEFI one as asked here and here. Currently
qemu-system-aarch64 -m 256M -smp 1 -drive file=build_dir.img,format=raw,if=virtio -machine type=virt,accel=hvf,highmem=off -cpu cortex-a72
results only in qemu monitor shown. The surprising fact (?? verify this once more) is that even booting UEFI ubuntuarm64
as descibed in https://gist.github.com/nrjdalal/e70249bb5d2e9d844cc203fd11f74c55 stays at qemu monitor.The text was updated successfully, but these errors were encountered: