http://bugs.winehq.org/show_bug.cgi?id=18787
Summary: Implement interlocked.c for Solaris/x86 using Sun C Product: Wine Version: 1.1.22 Platform: PC OS/Version: Solaris Status: UNCONFIRMED Severity: minor Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: baggett.patrick@gmail.com
When compiling Wine from source tarball on Solaris 10 5/09 with Sun Studio 12 cc I get the following message:
"You must implement the interlocked* functions for your compiler"
Sun C uses the same inline assembly language format as GCC, so simply changing line 27 at top of libs/port/interlocked.c to read:
#if defined(__GNUC__) || defined(__SUNPRO_C)
causes it to successfully compile using the inline assembly. Given the trivial nature of this, is there any way this can be merged?
http://bugs.winehq.org/show_bug.cgi?id=18787
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source CC| |austinenglish@gmail.com
--- Comment #1 from Austin English austinenglish@gmail.com 2009-06-04 22:42:52 --- Have you tested wine to verify it works?
Patches should be sent to wine-patches@winehq.org.
http://bugs.winehq.org/show_bug.cgi?id=18787
--- Comment #2 from Patrick Baggett baggett.patrick@gmail.com 2009-06-05 13:50:53 --- No, I haven't tested it, but given the trivial nature of the functions (3-5 instructions), it is sufficient to simply check the instructions generated. Using objdump I find that they all have correct assembly language code. Any x86 programmer may verify the code generated below:
00000060 <interlocked_cmpxchg>: 60: 8b 44 24 0c mov 0xc(%esp),%eax 64: 8b 4c 24 08 mov 0x8(%esp),%ecx 68: 8b 54 24 04 mov 0x4(%esp),%edx 6c: f0 0f b1 0a lock cmpxchg %ecx,(%edx) 70: c3 ret
0000007c <interlocked_cmpxchg_ptr>: 7c: 8b 44 24 0c mov 0xc(%esp),%eax 80: 8b 4c 24 08 mov 0x8(%esp),%ecx 84: 8b 54 24 04 mov 0x4(%esp),%edx 88: f0 0f b1 0a lock cmpxchg %ecx,(%edx) 8c: c3 ret
00000098 <interlocked_cmpxchg64>: 98: 53 push %ebx 99: 56 push %esi 9a: 8b 74 24 0c mov 0xc(%esp),%esi 9e: 8b 5c 24 10 mov 0x10(%esp),%ebx a2: 8b 4c 24 14 mov 0x14(%esp),%ecx a6: 8b 44 24 18 mov 0x18(%esp),%eax aa: 8b 54 24 1c mov 0x1c(%esp),%edx ae: f0 0f c7 0e lock cmpxchg8b (%esi) b2: 5e pop %esi b3: 5b pop %ebx b4: c3 ret
000000c0 <interlocked_xchg>: c0: 8b 44 24 08 mov 0x8(%esp),%eax c4: 8b 54 24 04 mov 0x4(%esp),%edx c8: f0 87 02 lock xchg %eax,(%edx) cb: c3 ret
000000d8 <interlocked_xchg_ptr>: d8: 8b 44 24 08 mov 0x8(%esp),%eax dc: 8b 54 24 04 mov 0x4(%esp),%edx e0: f0 87 02 lock xchg %eax,(%edx) e3: c3 ret
000000f0 <interlocked_xchg_add>: f0: 8b 44 24 08 mov 0x8(%esp),%eax f4: 8b 54 24 04 mov 0x4(%esp),%edx f8: f0 0f c1 02 lock xadd %eax,(%edx) fc: c3 ret
http://bugs.winehq.org/show_bug.cgi?id=18787
--- Comment #3 from Austin English austinenglish@gmail.com 2009-06-07 02:56:12 --- It works, but the compile soon bombs out later: aaustin@opensolaris:~/wine-git/libs/wine$ make /usr/bin/cc -c -I. -I. -I../../include -I../../include -D__WINESRC__ -DWINE_UNICODE_API="" -D_REENTRANT -fPIC -g -D__i386__ -o config.o ./config.c -DBINDIR='"/usr/local/bin"' -DDLLDIR='"/usr/local/lib/wine"' -DLIB_TO_BINDIR="`../../tools/relpath /usr/local/lib /usr/local/bin`" -DLIB_TO_DLLDIR="`../../tools/relpath /usr/local/lib /usr/local/lib/wine`" -DBIN_TO_DLLDIR="`../../tools/relpath /usr/local/bin /usr/local/lib/wine`" -DLIB_TO_DATADIR="`../../tools/relpath /usr/local/lib /usr/local/share/wine`" -DBIN_TO_DATADIR="`../../tools/relpath /usr/local/bin /usr/local/share/wine`" "../../include/windef.h", line 64: #error: You need to define __stdcall for your compiler cc: acomp failed for ./config.c make: *** [config.o] Error 1
This is on OpenSolaris.
http://bugs.winehq.org/show_bug.cgi?id=18787
Matt Lewandowsky matt@greenviolet.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |matt@greenviolet.net
--- Comment #4 from Matt Lewandowsky matt@greenviolet.net 2009-08-17 19:59:13 --- (In reply to comment #3) Fixing that leads to other issues. I suspect that it will be a case of going through most of wine and evaluating whether "#ifdef __GNU_C" stuff applies to Sun Studio. Fun task for someone with free time. :)
http://bugs.winehq.org/show_bug.cgi?id=18787
YCZhang sunsolex@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #5 from YCZhang sunsolex@yahoo.com 2010-01-24 16:06:05 --- *** This bug has been confirmed by popular vote. ***
http://bugs.winehq.org/show_bug.cgi?id=18787
Ken Mays maybird1776@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |maybird1776@yahoo.com
--- Comment #6 from Ken Mays maybird1776@yahoo.com 2011-08-27 12:40:54 CDT --- (In reply to comment #5)
*** This bug has been confirmed by popular vote. ***
This should become closed as the Solaris/OpenSolaris community now usses GCC as their primary compiler. Support for Sun Studio is now closed without a contract.
http://bugs.winehq.org/show_bug.cgi?id=18787
--- Comment #7 from Austin English austinenglish@gmail.com 2011-08-28 19:58:37 CDT --- (In reply to comment #6)
(In reply to comment #5)
*** This bug has been confirmed by popular vote. ***
This should become closed as the Solaris/OpenSolaris community now usses GCC as their primary compiler. Support for Sun Studio is now closed without a contract.
Just because it's less common/not the default, doesn't mean this bug is invalid.
http://bugs.winehq.org/show_bug.cgi?id=18787
--- Comment #8 from Matt Lewandowsky matt@greenviolet.net 2011-08-29 00:34:37 CDT --- (In reply to comment #6)
It depends on what you define as "the community". Even illumos is generally built with the closed-source Studio compiler by most developers at this time (and it's required that any patches compile with Studio, even if only tested with GCC by the submitter), as GCC support is still newish.
AFAICR, Studio support has always been for-charge aside from posting to the forum and to blog posts and hoping that you get a response (both of these are relatively recent, even). Indeed, Oracle Studio is licensed about the same as it was under Sun, if not actually slightly more liberally. In fact, they still offer their Betas to the public and still maintain their Linux compiler.
Fortunately or not, Studio's support offerings are about the same now as before Oracle came onto the scene. Arguably, it is even easier to download now than it was via SDLC. I have not seen a mass migration away from Studio any more than there was with Sun's GCC included in Solaris 9 and 10. Even OpenIndiana has Studio in their package repository, most likely due to the fact that most open-source software expects Studio to be available on Solaris.
Porter advice still tends to be "Try to get stuff to work with Studio before doing things with GCC", as far as I've seen. This bug is in that spirit.
http://bugs.winehq.org/show_bug.cgi?id=18787
--- Comment #9 from Ken Mays maybird1776@yahoo.com 2011-08-29 08:46:57 CDT --- (In reply to comment #7)
(In reply to comment #6)
(In reply to comment #5)
*** This bug has been confirmed by popular vote. ***
This should become closed as the Solaris/OpenSolaris community now usses GCC as their primary compiler. Support for Sun Studio is now closed without a contract.
Just because it's less common/not the default, doesn't mean this bug is invalid.
Point taken. Then, Wine build just needs patches for Sun Studio support. I validated Wine 1.1.44/1.3.27 builds completed successfully with GCC 3.4.3/OpenIndiana 151 so we'd need to review successful Wine builds with Oracle's Sun Studio 12.2.
http://bugs.winehq.org/show_bug.cgi?id=18787
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv@dawncrow.de
--- Comment #10 from André H. nerv@dawncrow.de 2013-04-21 13:16:28 CDT --- I wanted to help and downloaded Oracle Solaris Studio 12.3 for Linux and it doesn't work with a hello world application, so i didn't tried with Wine. Too bad.
https://bugs.winehq.org/show_bug.cgi?id=18787
--- Comment #11 from Austin English austinenglish@gmail.com --- Is this still an issue in current (1.7.36 or newer) wine? If so, please attach terminal output.
https://bugs.winehq.org/show_bug.cgi?id=18787
--- Comment #12 from Austin English austinenglish@gmail.com --- Presumably still present in wine-3.13. interlocked.c now uses gcc defines by default on i386, but given that windef.h doesn't have a __SUNPRO_C check, I can't imagine this works.
I'd suggest filing a bug with illumos, since they're the best positioned (and most likely interested) in fixing this. If someone does, please link that bug here.