Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 85220 - games-emulation/openmsx-0.5.0 x86 fails to build (non pic aware cpuid asm/c++ code)
Summary: games-emulation/openmsx-0.5.0 x86 fails to build (non pic aware cpuid asm/c++...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard: patch pending/upstream?
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-14 07:37 UTC by Jukka Lehtomäki
Modified: 2005-07-24 17:00 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
src/HostCPU.cc (HostCPU.cc,1.57 KB, text/plain)
2005-03-14 19:28 UTC, Jukka Lehtomäki
Details
Patch to fix asm (cpuid and mmx usage) for PIC compliance (openmsx-x86-pic-cpuidmmx.patch,2.08 KB, patch)
2005-07-24 06:00 UTC, Kevin F. Quinn (RETIRED)
Details | Diff
Patch to fix asm (cpuid and mmx usage) for PIC compliance - take 2 (openmsx-x86-pic-cpuidmmx.patch,2.27 KB, patch)
2005-07-24 06:49 UTC, Kevin F. Quinn (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jukka Lehtomäki 2005-03-14 07:37:39 UTC
Compiling MSXBunsetsu.cc...
src/HostCPU.cc: In constructor `openmsx::HostCPU::HostCPU()':
src/HostCPU.cc:41: error: PIC register `ebx' clobbered in `asm'
src/HostCPU.cc:50: error: PIC register `ebx' clobbered in `asm'
src/HostCPU.cc:59: error: PIC register `ebx' clobbered in `asm'
src/HostCPU.cc: In constructor `openmsx::HostCPU::HostCPU()':
src/HostCPU.cc:41: error: PIC register `ebx' clobbered in `asm'
src/HostCPU.cc:50: error: PIC register `ebx' clobbered in `asm'
src/HostCPU.cc:59: error: PIC register `ebx' clobbered in `asm'
make: *** [derived/x86-linux-i686/obj/HostCPU.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** Waiting for unfinished jobs....

!!! ERROR: games-emulation/openmsx-0.5.0 failed.
!!! Function src_compile, Line 37, Exitcode 2

Reproducible: Always
Steps to Reproduce:
1.emerge openmsx
Comment 1 solar (RETIRED) gentoo-dev 2005-03-14 17:47:11 UTC
please attach the src/HostCPU.cc
Comment 2 Jukka Lehtomäki 2005-03-14 19:28:21 UTC
Created attachment 53487 [details]
src/HostCPU.cc
Comment 3 Marco Morales 2005-03-20 13:13:20 UTC
gcc version?
Comment 4 Jukka Lehtomäki 2005-03-20 13:58:48 UTC
i686-pc-linux-gnu 3.4.3.20050110

I've got the bug 77694 too.
Comment 5 Jukka Lehtomäki 2005-03-20 14:35:46 UTC
[5] i686-pc-linux-gnu-3.4.3-vanilla * fixed my problem.
Comment 6 solar (RETIRED) gentoo-dev 2005-03-21 09:53:58 UTC
Sorry.. this is a semi common bug with standard c code with cpuid asm not being 
pic aware. There will be a alot of fixes in misc packages for this normal cpuid 
asm. Perhaps somebody feeling motivated to run this package hardened vs vanilla will want to adapt that c/asm code to this c++/asm code in the form of a patch 
and attach it here. (that should solve the problem)
Comment 7 solar (RETIRED) gentoo-dev 2005-03-21 10:06:16 UTC
This is more or less what you need to make the patch

$PORTDIR/sys-apps/lshw/files/02.00b-cpuid-PIC.patch
Comment 8 solar (RETIRED) gentoo-dev 2005-04-10 16:44:26 UTC
adding chainsaw to the CC: as this bug seems to have stalled for a few weeks.
Comment 9 Kevin F. Quinn (RETIRED) gentoo-dev 2005-07-24 06:00:04 UTC
Created attachment 64200 [details, diff]
Patch to fix asm (cpuid and mmx usage) for PIC compliance
Comment 10 Kevin F. Quinn (RETIRED) gentoo-dev 2005-07-24 06:07:22 UTC
Patch supplied; re-assigned to package maintainer to arrange verification/testing.

The cpuid part of the patch is straightforward enough; openmsx starts up for me
so I think that's ok.

The other part of the patch modifies some mmx code slightly, to regain ebx for
the PIC ABI.  However since I don't have any ROMs, I don't know if this works or
not.  It's a simple enough change, but as always with asm code it's easy to
break things.  The modified mmx assembler is in the scaler code, so to verify
test the various scalers.
Comment 11 Kevin F. Quinn (RETIRED) gentoo-dev 2005-07-24 06:09:02 UTC
btw patch is against 0.5.2
Comment 12 Kevin F. Quinn (RETIRED) gentoo-dev 2005-07-24 06:49:37 UTC
Created attachment 64201 [details, diff]
Patch to fix asm (cpuid and mmx usage) for PIC compliance - take 2

Slight fixup; forgot to indicate new clobber of mm6
(shows how easy it is to mess things up in asm).
Comment 13 Jukka Lehtomäki 2005-07-24 09:43:06 UTC
http://www.funet.fi/pub/README

***************freely distributable material***************
This system has plenty of freely distributable material on its FTPable
areas. We have also other services, see at the end of this document for
pointers.

If you have any questions regarding MATERIALS in this archive, read
first `Contacts about material in here' below.  If you can't locate correct
person/mail alias with it, try `problems@nic.funet.fi', but do not do that
as your only attempt!

http://www.funet.fi/pub/msx/system_roms/openMSX/
http://www.funet.fi/pub/msx/games/
***********************************************************
Comment 14 Jukka Lehtomäki 2005-07-24 17:00:54 UTC
Patch to fix asm (cpuid and mmx usage) for PIC compliance - take 2

openmsx-0.5.2.ebuild
epatch "${FILESDIR}/openmsx-x86-pic-cpuidmmx.patch"

KEYWORDS="~x86" build ok.