#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 |
| Version: | 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 , 21 years ago
comment:2 by , 21 years ago
This seems related to bug #1224138 and apparently is due to a problem with the inline assembler?
comment:3 by , 21 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 , 21 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 , 21 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:7 by , 21 years ago
| Summary: | MT32emu: doesn't compile under gcc 3.4.2 → MT32emu: doesn't compile under gcc 3.4.2 / i386 |
|---|
comment:9 by , 21 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 , 21 years ago
| Priority: | high → low |
|---|
comment:11 by , 20 years ago
| Owner: | changed from to |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
comment:12 by , 20 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 , 7 years ago
| Component: | → Audio: MT32 |
|---|

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