Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
486 stage3 is broken (binaries cannot be executed by K6)?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 6650
Location: almost Mile High in the USA

PostPosted: Wed Apr 25, 2018 2:49 pm    Post subject: 486 stage3 is broken (binaries cannot be executed by K6)? Reply with quote

I fscked up my 486 install (actually, K6-233 that I occasionally use on older machines) so I had to reinstall.

So I untarred the 486 stage3 snapshot on a hard drive with my i7 and rebuilt the packages I was using on that disk; fortunately @world file was still there along with my USE flags/masks.

The snapshot was named stage3-i486-20180423T214502Z.tar.xz

About 43 packages installed, none of which were gcc.

However once done, I verified with qemu with 486 emulation that the disk still works, looks good.

Code:
CHOST="i486-pc-linux-gnu"
CFLAGS="-Os -march=i486 -pipe"


However when I brought the disk back to the K6, that's when things started breaking. The disk boots just fine. Got into the command prompt, and basically things worked... until I tried gcc:

Code:
littlefoot /var/log # gcc
Illegal instruction


What the... gosh darnit another one of these i7 instructions most likely, but I thought I specifically set -march=i486 ...
But then I remembered: I didn't rebuild gcc either!

So is this a stage build bug?
Code:
littlefoot /usr/i486-pc-linux-gnu/gcc-bin/6.4.0 $ ls -l i486-pc-linux-gnu-gcc
-rwxr-xr-x 1 root root 958148 Feb 19 20:29 i486-pc-linux-gnu-gcc
littlefoot /usr/i486-pc-linux-gnu/gcc-bin/6.4.0 $ ./i486-pc-linux-gnu-gcc
Illegal instruction
littlefoot /usr/i486-pc-linux-gnu/gcc-bin/6.4.0 $ cd /usr/bin
littlefoot /usr/bin $ ls -l groff
-rwxr-xr-x 1 root root 91540 Feb 28 17:01 groff
littlefoot /usr/bin $ ./groff
Illegal instruction


In case people were curious at what happened, I gnu-parted the disk so I could get a small bootable msdos partition on the disk. However I forgot to set the partition type to MSDOS/FAT16 so I had the bright idea of deleting the partition I made with parted and recreating it in MSDOS. However, MSDOS FDISK.EXE F**KED UP and created a partition that overlapped Linux. I didn't notice until I format C:/s which reported a partition much larger than what it should be... I stopped it but it was too late, the disk was corrupted.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3325

PostPosted: Wed Apr 25, 2018 3:52 pm    Post subject: Reply with quote

I ran a K6-III for many years, but only self-hosted, which I know would mean much waiting. I ran it as i586, since the K6-III was one instruction (CMPXCH?) shy of i686, but certainly i486 is a viable target.

If you're really stuck, try starting from the stage3 tarball on the k6.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6636

PostPosted: Wed Apr 25, 2018 4:29 pm    Post subject: Re: 486 stage3 is broken (binaries cannot be executed by K6) Reply with quote

I think it's again a problem with user and coffee abuse :)
eccerr0r wrote:
The snapshot was named stage3-i486-20180423T214502Z.tar.xz

About 43 packages installed, none of which were gcc.


eccerr0r wrote:
until I tried gcc:

The only real logical answer you should get to this is "unknown command" :)

If you have a gcc, where does it comes from if stage3 didn't provide any?
The answer should also answer why your gcc is not working with the K6.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 6650
Location: almost Mile High in the USA

PostPosted: Wed Apr 25, 2018 4:39 pm    Post subject: Reply with quote

Well, obviously gcc is part of stage3, not because I didn't install it (if it weren't clear, I used the old @world file and remerged @world so I could get back to where I was with the machine prior to the mishap).

I was simply trying to rule out the problem that if I did install gcc with the i7 and the i7 built gcc wrong: then it would be my fault. But I hadn't, so it is a stage3 problem.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2455
Location: Illinois, USA

PostPosted: Wed Apr 25, 2018 6:16 pm    Post subject: Reply with quote

Is there a k6-3 binhost somewhere?

Is there somewhere I can post a working k6-3 gcc, glibc, and libtool for you?
Would you trust it if I can? I'll be glad too.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 6650
Location: almost Mile High in the USA

PostPosted: Wed Apr 25, 2018 8:36 pm    Post subject: Reply with quote

Well, I should be okay cross compiling I would hope, I was more wondering if there was a systemic issue with the Gentoo auto builder for building install media.

It's weird (but maybe not so weird) that qemu set to 486 works fine. I suspect it's because the non-privileged new instructions don't get trapped by qemu - they'll only trap CPUID and privileged instructions that would trap anyway, and thus qemu is no replacement for real hardware testing...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 9933
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Apr 25, 2018 8:53 pm    Post subject: Reply with quote

Release Engineering reports that an inadvertent consequence of an architectural update to Catalyst has caused recent 486 stages to be built with "-march=i686". They're definitely hosed.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 6650
Location: almost Mile High in the USA

PostPosted: Wed Apr 25, 2018 10:38 pm    Post subject: Reply with quote

Ah cool so I'm not seeing things :D

So only C++ applications are affected or more than just that?

----------

I rebuilt the world (emerge -e @world) on a i686 with the proper forced CFLAGS/CXXFLAGS to i486, and now happy to report that i486 is working, at least running on a K6-233. Now I need to make a backup of this system...or not...

I shouldn't have needed to rebuild @world - luckily I had a i686 at my disposal.

This K6-233 is slow. It has 256MB @PC66 SDRAM, but has 0K L2 cache because the chipset has no idea how to cache 256MB RAM.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum