Opened 14 years ago

Closed 14 years ago

Last modified 9 months ago

#2065 closed defect (fixed)

MT32emu: doesn't compile under gcc 3.4.2 / i386

Reported by: sev- Owned by: sev-
Priority: low Component: Audio: MT32
Keywords: Cc:
Game:

Description

I get this error when try to compile current CVS with
gcc version 3.4.2 [FreeBSD] 20040728:

sound/softsynth/mt32/i386.cpp: In function `bool
MT32Emu::DetectSIMD()':
sound/softsynth/mt32/i386.cpp:58: error: PIC register
`ebx' clobbered in `asm'

Ticket imported from: #1221549. Ticket imported from: bugs/2065.

Change History (13)

comment:1 Changed 14 years ago by sev-

No idea how this appeared in Feature requests. Moving to bugs.

comment:2 Changed 14 years ago by fingolfin

This seems related to bug #1224138 and apparently is due
to a problem with the inline assembler?

comment:3 Changed 14 years ago by sev-

Yes, it is related to inline assembler but I guess nature of
the two is completely different. When #1224138 has problems
with MMX instruction set, this one has to do with calling
convention as I think.

comment:4 Changed 14 years ago by eriktorbjorn

The thread at
http://lists.xensource.com/archives/html/xen-devel/2005-02/msg01034.html
sounds similar to this. I don't see that they ever reached
any final conclusion but someone wrote that:

"CPUID returns information in eax, ebx, ecx, and edx. With
-fPIC you have to push ebx onto the stack before calling
cpuid and pop it afterward as Bin points out is what the
patch to xen-unstable does."

to which someone else replied that

"The compiler used to generate the push/pop just fine for
gcc-3.3. This is an issue specific to gcc-3.4."

By the way, does that mean that the error only happens when
compiling with plugin support? I never use that myself,
which may explain why I never saw it even when compiling
with GCC 3.4.

comment:5 Changed 14 years ago by sev-

Hmm, I was compiling with plugins for a while and just tried
to do a static build. Yes, these errors appear only when
compiling plugin support.

Solution to this would be avoid using ebx, but gcc
documentation on asm constraints is quite cryptic, so I
can't do it by myself.

comment:6 Changed 14 years ago by SF/lysek

Same here on gcc version 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8)

comment:7 Changed 14 years ago by fingolfin

Summary: MT32emu: doesn't compile under gcc 3.4.2MT32emu: doesn't compile under gcc 3.4.2 / i386

comment:8 Changed 14 years ago by fingolfin

What is the status of this item?

comment:9 Changed 14 years ago by sev-

Still hapens with 3.4.2 when building plugins. Though if I
compile this file individually without -fPIC, linking stage
goes OK and program works.

Proper fix in ScummVM framework would be to move those asm
routines separately and compile with nasm.

Lowering priority

comment:10 Changed 14 years ago by sev-

Priority: highlow

comment:11 Changed 14 years ago by sev-

Owner: changed from kingguppy to sev-
Resolution: fixed
Status: newclosed

comment:12 Changed 14 years ago by sev-

It appeared to be easier when I looked at it more deeply.
Fixed in CVS and backported to 0.8.0.

comment:13 Changed 9 months ago by digitall

Component: Audio: MT32
Note: See TracTickets for help on using tickets.