View previous topic :: View next topic |
Author |
Message |
CptClyde n00b
Joined: 18 Jan 2023 Posts: 13
|
Posted: Tue May 09, 2023 1:04 pm Post subject: [SOLVED] crossdev i386 failing |
|
|
I need to compile PHP8 and all it's prerequisites for a 20 year old i386 machine and was hoping I could do it with crossdev. Is this the right tool for the job?
However I seem to be unable to get the most basic of steps to complete.
Code: | # crossdev --stable -t i386-glibc-linux-gnu
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* crossdev version: 20230209
* Host Portage ARCH: amd64
* Host Portage System: x86_64-pc-linux-gnu (i686-pc-linux-gnu x86_64-pc-linux-gnu)
* Target Portage ARCH: x86
* Target System: i386-glibc-linux-gnu
* Stage: 4 (C/C++ compiler)
* USE=multilib: no
* Target ABIs: default
* binutils: binutils-[stable]
* gcc: gcc-[stable]
* headers: linux-headers-[stable]
* libc: glibc-[stable]
* CROSSDEV_OVERLAY: /var/db/repos/crossdev
* PORT_LOGDIR: /var/log/portage
* PORTAGE_CONFIGROOT: /
* Portage flags:
_ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ -
* leaving metadata/layout.conf alone in /var/db/repos/crossdev
_ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ -
* Log: /var/log/portage/cross-i386-glibc-linux-gnu-binutils.log
* Emerging cross-binutils ... [ ok ]
* Log: /var/log/portage/cross-i386-glibc-linux-gnu-gcc-stage1.log
* Emerging cross-gcc-stage1 ...
[ ok ]
* Log: /var/log/portage/cross-i386-glibc-linux-gnu-linux-headers.log
* Emerging cross-linux-headers ... [ ok ]
* Log: /var/log/portage/cross-i386-glibc-linux-gnu-glibc.log
* Emerging cross-glibc ...
* error: glibc failed :(
*
* If you file a bug, please attach the following logfiles:
* /var/log/portage/cross-i386-glibc-linux-gnu-info.log
* /var/log/portage/cross-i386-glibc-linux-gnu-glibc.log.xz
* /var/tmp/portage/cross-i386-glibc-linux-gnu/glibc*/temp/glibc-config.logs.tar.xz
|
Is there something obvious here I'm missing? I cannot find any example tuples for a simple i386 cross build.
Last edited by CptClyde on Tue May 09, 2023 2:18 pm; edited 1 time in total |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1662
|
Posted: Tue May 09, 2023 1:18 pm Post subject: Re: crossdev i386 failing |
|
|
CptClyde wrote: | I need to compile PHP8 and all it's prerequisites for a 20 year old i386 machine and was hoping I could do it with crossdev. Is this the right tool for the job?
However I seem to be unable to get the most basic of steps to complete.
...
Is there something obvious here I'm missing? I cannot find any example tuples for a simple i386 cross build. |
A 20 year old machine should still target i686 unless the CPU predates Pentium II. Linux and supporting tools have been dropping i386 support of late as very few things still run that nearly 30 year old CPU.
i386 for 386, i486 for 486, i586 for Pentium, i686 for Pentium II-4. AMD processors are a bit muddy in this era but should be simple to figure out. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54258 Location: 56N 3W
|
Posted: Tue May 09, 2023 1:24 pm Post subject: |
|
|
CptClyde,
i386 support was dropped from glibc at around version 2.2
The kernel does not have the floating point emulation either.
If you really really need to target code to an i386 CPU, you will need an old codebase to do it.
The 486 is the oldest supported system.
You may have used an i386 stage tarball on a 486 or later system.
That's OK but the upgrade path requires a CHOST change. There is a guide on the Wiki.
What CPU do you actually want to build for? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
CptClyde n00b
Joined: 18 Jan 2023 Posts: 13
|
Posted: Tue May 09, 2023 1:45 pm Post subject: |
|
|
Ah yes okay that makes sense, sorry for my ignorance. Okay so I guess I should be trying i686
here is the cat /proc/cpuinfo output:
Code: | cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping : 9
cpu MHz : 2993.772
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl cid
bogomips : 5898.24 |
.... and actualls uname -a even reports a i686 kernel at version 2.4.
This is an old "embedded" server unit (not Gentoo, not actually sure what it was, possibly LFS?) so I'm hoping to build some things using my gentoo crossdev and then copy it all onto that server. Is this the "correct" way to attempt such a thing? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54258 Location: 56N 3W
|
Posted: Tue May 09, 2023 3:47 pm Post subject: |
|
|
CptClyde,
That can work, yes.
Be aware that you cannot install Code: | crossdev --stable -t i686-glibc-linux-gnu | on a multilib amd64 Gentoo as it can generate 32 bit code anyway.
The i686 cross compiler would overwrite some of the hosts files.
You can have a 32 bit chroot and build for your 20 year old system there.
I would not expect modern code to run on such an old install. Lots of things will just be too old to support the binaries.
Try it :)
You may want to shut down to 20 year old system and copy its filesystem tree into say /usr/oldbox in your Gentoo. Just like you were installing a new Gentoo, where the old system is in effect the stage3.
Can you mount /proc and /dev and /sys then chroot into it,
/sys did not exist 20 years ago.
If the chroot works, the old user space is runnnig on top oy your Gentoo kernel and services.
Poke about ... does it still work?
Now build php8 for it and test. If it breaks, you can throw it away.
If you want a 20 year old Gentoo to play with, see Historical Gentoo. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
CptClyde n00b
Joined: 18 Jan 2023 Posts: 13
|
Posted: Wed May 10, 2023 12:50 pm Post subject: |
|
|
Some good ideas you give there thank you very much. My machine is NOT multi lib and seems to be working so far..... I think? Is there an easy way to find out??
This should be an interesting experiment for sure, I am not convinced that php8 will ever be able to run on this old server.
Good point about the chroot in a multi-lib system. That would be a handy alternative. Thank you. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54258 Location: 56N 3W
|
Posted: Wed May 10, 2023 4:28 pm Post subject: |
|
|
CptClyde,
Code: | crossdev --stable -t i686-glibc-linux-gnu | will refuse to build on a multilib install.
If it worked, you are /no-multilib/. Code: | eselect profile list | will show your selected profile too.
Once crossdev has done its thing, you will have an 'empty' target root at /usr/i686-glibc-linux-gnu
Fix its profile as the embedded profile is not useful.
Populate /usr/i686-glibc-linux-gnu/etc/portage/* to suit your target and build for your target.
Cross compiling is a lot more user friendly now than it was ever a few years ago but one or two things are cross build hostile.
I'll make a prediction ...
Your /usr/i686-glibc-linux-gnu/ target root is going to become a complete 2023 version of what you wish was on the old server.
You may as well plan to cut your losses an run your old server on that.
It's important to make the distinction between running Gentoo and building Gentoo. The two can be, and often are, separated.
You are starting on that path now.
e.g. You can run Gentoo on an original Raspberry Pi with 250MB RAM, and one 700MHz arm6j core. You really wouldn't want to build it there.
The build/run split is often lost an users accustomed to Intel/AMD desktop hardware. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
|