Hi,
I believe this thread is getting a bit difficult to follow for some. Some things I need to clear up:
- * The problem in the beginning was: I was using a i686 VM, running a Gentoo with CHOST=i586 -> binary package of eix errors with illegal instruction
* I ditched the VM (to reduce complexity) and changed to a 32-bit Gentoo chroot (on a Arch Linux multilib system). Eix binary package built there still fails with "illegal instruction".
* I can run eix compiled locally on any of the environments.
* The only problem is that a binary package compiled in a chroot (or a VM) fails with illegal instruction
Tony0945 wrote:
I would quickpkg eix on the k6-3 box. Then, I would copy everything to the VM, making the VM a clone of the k6-3 box.
I'm not sure I'm following; what would the point be here? I mean, I can get
locally compiled eix to run on the k6-3 box, and I can get eix to run on the chroot (or VM - but I'm not using a VM currently!). The problem is that a eix binary package built on the slave chroot on a more powerful box errors with "Illegal Instruction" on the K6-3 box.
Are you suggesting I'd make a clone of the k6-3 box and start compiling there in a VM? Which VM can run -march=k6-3 code on some processor which does not have the AMD-specific instructions (I believe Virtualbox can not do this)? Would qemu work? I have no previous experience with VMs before this endeavor...
Tony0945 wrote:
Don't know which VM you are using, but on the virtualbox site there are some instructions for cloning from a harddrive. --
I find cloning hard drives, disks filesystems etc. quite trivial, that is not a problem here. Thanks anyways!
NeddySeagoon wrote:
Its not USE=pie if you have the 17.0 profile on the k6-3 and in the build environment.
PIE related issues usually show up at link time, not run time.
Ok, I misunderstood some of the comments on this thread them. I though some were suggesting that binaries compiled with pie enabled might fail on i586 (or -march=k6-3) for some reason, in some situations... or a compilation bug surfaces this way?
NeddySeagoon wrote:
The USE=pie flag on gcc is a bit odd as USE flags go.
It controls the default gcc behaviour, when -fpie or -fno-pie are not specified explicitly when gcc is invoked.
On other packages, it changes how the packages are built.
Be aware that setting USE=-pie on gcc will have no effect.
USE=pie is forced on by the profile. It appears as (pie). If you really want to turn pie off, you must first unforce it.
Yes, I think I got how it works, thank you

.
FWIW, I unforced pie use flag, and rebuild gcc without pie (and this was reported by emerge as expected). Also emerge -e @system (for the slave build box, and generated the @system packages for the k6-3 box). Actually, I found the command in my history on the chroot slave:
Code: Select all
emerge -uDNvat world
emerge -e @system && COMMON_FLAGS="-O2 -march=k6-3 -pipe -fomit-frame-pointer" FEATURES=buildpkg emerge -eB @system && emerge -e @world
The first one reported the changed use flags for gcc, and recompiled it (along with openssh and pam). I didn't use bootstrap.sh (I figured it is not needed in this case?).
(I know I recompiled things needlessly by running emerge -e @system and emerge -e @world - this was done overnight so I didn't care)
After that emerge -1 --rebuilt-binaries eix on the k6-3 box. Still eix fails with "illegal instruction". However, I didn't install system-wide all binary packages (the k6-3 box is slow even with binary pacakge installations). I will update them with the new non-pie binaries and see if that has any effect.
Thanks for that, here are mine (again - the only difference to previous should be that I've disabled pie):
build slave chroot make.conf and
the k6-3 box make.conf.
Some things different:
- * I don't have -m32 in CFLAGS. Didn't see it before anywhere, should I use it on the build slave?
* As already pointed previously, I've gone the trouble needed to change CHOST to i586.
As suggested previously in this thread by NeddySeagoon, there is another major difference (?), too: systemset is build with -march=i586 and with "FEATURES=-buildpkg", and when I built @system set packages for the k6-3 box, I override these on the command line. I've verifies from the binary pacakges environments and they seem to be built correctly (with -march=k6-3 for the @system set binaries). In case you're curious, see
my env/systemset and
systemset file.
I could try CHOST=i486 on the build host. I could make another chroot on the k6-3 box (without i586) and install binary packages there and see if they work (maybe I should have done that before!). Any other ideas?
EDIT: Jsut to make sure, my chroot script on the Arch Linux. Anyone spot anything which could cause problems here?
Code: Select all
$ cat chgentoo.sh
#!/bin/bash
CHROOTDIR=$1
if [ ! -d "$CHROOTDIR" ] ; then
echo Not dir $CHROOTDIR
exit 1
fi
mount --types proc /proc/ "${CHROOTDIR}"/proc/
mount --rbind /sys/ "${CHROOTDIR}"/sys
mount --rbind /dev/ "${CHROOTDIR}"/dev
mount --make-rslave "${CHROOTDIR}"/sys/
mount --make-rslave "${CHROOTDIR}"/dev
linux32 chroot "${CHROOTDIR}" /bin/bash -l
umount "${CHROOTDIR}"/proc/ "${CHROOTDIR}"/sys "${CHROOTDIR}"/dev
In any case, thanks for everybodys time! Especially considering this is a completely secondary project for me and in a very fringe compilation environment/situation. Would be nice to see what the error is, however! After all, it could be a gcc (or some other?) bug which only surfaces in specific situations, and could benefit the thing as a whole...