Opened 15 years ago

Closed 15 years ago

Last modified 2 years 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 by sev-, 15 years ago

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

comment:2 by fingolfin, 15 years ago

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

comment:3 by sev-, 15 years ago

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 by eriktorbjorn, 15 years ago

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 by sev-, 15 years ago

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 by SF/lysek, 15 years ago

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

comment:7 by fingolfin, 15 years ago

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

comment:8 by fingolfin, 15 years ago

What is the status of this item?

comment:9 by sev-, 15 years ago

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 by sev-, 15 years ago

Priority: highlow

comment:11 by sev-, 15 years ago

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

comment:12 by sev-, 15 years ago

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

comment:13 by digitall, 2 years ago

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