Re: portability of build?
"Rahul Chandra" ([email protected] via lfs-support Mailing List) <[email protected]> Sat, 08 Mar 2025 15:12:48 -0500
| Newsgroups | gmane.linux.lfs.support |
|---|---|
| Message-ID | <[email protected]> |
On March 8, 2025 2:40:11 PM EST, Thomas Seeling <[email protected]> wrote: > Hallo, > > I have built 12.2 on an i7-6700, which runs fine since its release. > After building it last year after release I created a tar backup of > this base system. > > For playing around I bought a cheap ThinkCenter M600 mini-PC with a > Celeron N3010 and NVME (I couldn't resist at 25 € :-) ). I installed > Fedora 41 and intend to use it as dual-boot. I could transfer the plain > base LFS system to the free partition, and it boots up fine with > Fedora's grub. > > Then I noticed that LFS compiles grub with i386-pc only, so I planned > to keep Fedora's grub for the time being since the M600 is setup with > UEFI on a GPT NVME. Compiling grub with UEFI support is explained later > in the BLFS book, and this leads to my second (and third) problem. > > I wanted to install additional software like grub for UEFI, unzip and > nfs-utils (with dependencies) and I noticed 2 problems: gcc stops > compiling unzip source code with "illegal opcode". Copying the |unzip| > binary from another x86_64 machine works on the Celeron. Trying to > |./configure| a package goes into an infinite loop, creating a huge > |configure.lineno| file. > > In an old > [thread](https://lists.gnu.org/archive/html/autoconf/2009-09/msg00147.html > <https://lists.gnu.org/archive/html/autoconf/2009-09/msg00147.html>) > about `autoreconf` from 2009 :-) I found a first hint: simply trying > out the command `expr 1 + 1` on the command line, et voilà: it says > `Illegal instruction`, same as `gcc` when I tried to compile `unzip` > manually. This simple failure makes `configure.lineno` run in an > endless loop and `configure` does never finish. > > So I guess it boils down to the fact that I cannot "downgrade" the > hardware and use the same binary code which was compiled on a much > better CPU although both are x86_64. > > Any ideas or comments here? I built LFS 12.3 on the mini machine > overnight and it seems to work now (in chroot I can do "expr 1 + 1" > :-). Could I cross-build on a fast machine and force a "lower" target > CPU which is still x86_64? I assumed the codeset gcc produces would be > universal among x86_64. A running LFS seemed to prove that it works, > but subsequent failures make me doubt that again. I wonder how standard > distributions are built. Fedora installed on the Celeron quite fine and > runs without any hiccups. > > Thanks for any thoughts on this. > > Stay healthy, > > Thomas > (Sent from the wrong address the first time) Hi! The illegal opcode means that the system can't find an instruction on the CPU. Luckily you don't need to rebuild your whole system. Most of the time you'll only have to rebuild libffi and GMP, and if you have it installed it Qt with a lower CPU build flag (see LFS pages for details). Thanks to dynamic linking everything depending on them should automatically work. Most of the time this error is because of AVX or SSE4.2 being missing. I don't know why Intel still to this day doesn't put those instructions on their lower end chips. Anyways just rebuild those 2 and you should be good to go. Further reading if you are interested <https://en.m.wikipedia.org/wiki/X86-64> Look at the section about microarchitecture levels. Your Celeron is either v1 or v2 while your build is likely for v3. -- --Rahul -- http://lists.linuxfromscratch.org/sympa/info/lfs-support Unsubscribe: See the above information page