Bug 2305 - buildengine has non-PIC friendly x86 asm
Status: RESOLVED WONTFIX
Alias: None
Product: Build Engine
Classification: Unclassified
Component: General
Version: unspecified
Hardware: PC Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact:
URL: http://bugs.gentoo.org/show_bug.cgi?i...
Depends on:
Blocks:
 
Reported: 2005-06-23 21:33 EDT by SpanKY
Modified: 2005-06-23 22:44:51 EDT
0 users

See Also:



Description SpanKY 2005-06-23 21:33:36 EDT
if you try to compile the build engine as PIC, it'll fail in a few places ...

engine.c: In function `nsqrtasm':
engine.c:397: error: PIC register `ebx' clobbered in `asm'
engine.c: In function `krecipasm':
engine.c:488: error: PIC register `ebx' clobbered in `asm'
engine.c: In function `setgotpic':
engine.c:607: error: PIC register `ebx' clobbered in `asm'


a_gnu.c: In function `is_vmware_running':
a_gnu.c:24: error: PIC register `ebx' clobbered in `asm'
a_gnu.c: In function `mmxoverlay':
a_gnu.c:37: error: PIC register `ebx' clobbered in `asm'
a_gnu.c: In function `vlineasm4':
a_gnu.c:297: error: PIC register `ebx' clobbered in `asm'
a_gnu.c: In function `mvlineasm4':
a_gnu.c:321: error: PIC register `ebx' clobbered in `asm'


game.c: In function `addlava':
game.c:569: error: can't find a register in class `BREG' while reloading `asm'


the func _asm_krecipasm in a_nasm.asm will also need to be updated ...

in some cases, simply using the edx or ecx register instead of ebx is enough to
resolve the issue
Comment 1 Ryan C. Gordon 2005-06-23 22:44:51 EDT
Changing all of these is a huge pain; don't compile with -fPIC, since this isn't
a shared library and doesn't need it. If you must have -fPIC, then don't use the
asm code...there are C fallbacks for everything.

If someone wants to submit a patch, I'll take it, but remember that you have to
change all the asm, not just the GNU and nasm bits so that we don't think a bug
has cropped up because the asm code doesn't match the original DOS version.

Also remember that gcc only reports this class of error once per compile, so you
aren't seeing a complete list of what needs patching.

--ryan.