View previous topic :: View next topic |
Author |
Message |
greyspoke Apprentice
Joined: 08 Jan 2010 Posts: 173
|
Posted: Sat Jan 18, 2025 1:48 pm Post subject: "cross-compiling" amd64 to i686 |
|
|
I was set off down the path of using crossdev to compile for my i686 home server to get update times down to less than a week(!) when I was confronted with this message:
Code: | * Refusing to create a cross-compiler using the same
* target name as your host utils.
* Consider using sys-devel/multilib-gcc-wrapper package.
|
With some more digging I found that crossdev deliberately does not regard what I am trying to do as sufficiently crossy for it. I mean, what's 32 bits among friends eh?
So should I follow the binary package guide and do it via chrooting? But multilib-gcc-wrapper doesn't seem to come into that. If I am to use multilib-gcc-wrapper, how exactly?
Code: | ====== $ equery files multilib-gcc-wrapper
* Searching for multilib-gcc-wrapper ...
* Contents of sys-devel/multilib-gcc-wrapper-0-r2:
/usr
/usr/bin
/usr/bin/i686-pc-linux-gnu-c++
/usr/bin/i686-pc-linux-gnu-c++-14
/usr/bin/i686-pc-linux-gnu-cc
/usr/bin/i686-pc-linux-gnu-cpp
/usr/bin/i686-pc-linux-gnu-cpp-14
/usr/bin/i686-pc-linux-gnu-g++
/usr/bin/i686-pc-linux-gnu-g++-14
/usr/bin/i686-pc-linux-gnu-gcc
/usr/bin/i686-pc-linux-gnu-gcc-14
/usr/bin/i686-pc-linux-gnu-gfortran
/usr/bin/i686-pc-linux-gnu-gfortran-14
|
Which is all great I am sure but I really don't have a clue what to do with all that.
Thanks. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54734 Location: 56N 3W
|
Posted: Sat Jan 18, 2025 1:58 pm Post subject: |
|
|
greyspoke,
You can't create an i686 cross compiler on an amd64 multilib install as the toolchain can support both 64 bit and 32 bit code.
You pass -m32 or -m64 depending on what your want.
Its OK on a no-multilib install, as there is no 32 bit support at all.
You want Build In A Chroot
Beware what happens if the build system cannot execute all the instructions on the target _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
greyspoke Apprentice
Joined: 08 Jan 2010 Posts: 173
|
Posted: Sat Jan 18, 2025 3:13 pm Post subject: |
|
|
Thanks Neddy.
I don't have a multilib install so I will follow the instructions in your wiki page and make a chroot. And uninstall multilib-gcc-wrapper. Would -m32 get passed automatically to the compiler with a 32bit CHOST set, or would it have to go in CFLAGS? I assume that mounting parts of the slow computer filesystem on the fast computer is an alternative to syncing the portage trees and other stuff and having it access binary packages located on the fast computer via rsync etc.?
Thanks |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54734 Location: 56N 3W
|
Posted: Sat Jan 18, 2025 4:39 pm Post subject: |
|
|
greyspoke,
crossdev detected a multilib install somehow, which is why in refused to make an i686 cross compiler.
The chroot with as install that mimics your server will produce 32 bit code anyway.
The compiler outside of the chroot will not be used.
In fact the chroot will be 32 bit only, everywhere.
As you say that you don't have a multilib install, your host kernel will need 32 bit support, or it won't run any 32 bit code.
That guide is a bit rough round the edges, which is why its still in my wiki namespace. Feedback welcome. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
|