Edit report at http://bugs.php.net/bug.php?id=53310&edit=1
ID: 53310 Updated by: f...@php.net Reported by: stefan at whocares dot de Summary: fpm_atomic.h uses SPARC v9 only code, doesn't work on v8 -Status: Open +Status: Analyzed Type: Feature/Change Request Package: FPM related Operating System: Linux (Debian for Sparc) PHP Version: 5.3.3 Block user comment: N New Comment: As the sparc documentation says (http://developers.sun.com/solaris/articles/atomic_sparc/#CAS): The SPARC v9 manual introduced the newest atomic instruction: compare and swap (cas) I don't know how to fix this right now. If you know someone who can, he's welcome. I've already asked for help. wait and see Previous Comments: ------------------------------------------------------------------------ [2010-11-15 00:21:50] stefan at whocares dot de Description: ------------ Compiling with PHP-FPM enabled on an older SPARC system will result in /tmp/cc6w5Fh0.s: Assembler messages: /tmp/cc6w5Fh0.s:39: Error: Architecture mismatch on "cas". /tmp/cc6w5Fh0.s:39: (Requires v9|v9a|v9b; requested architecture is sparclite.) Unfortunately my knowledge of SPARC assembly language isn't nearly good enough to fix that. I know that the v9 "cas" opcode does an atomic "compare and swap" operation but I wouldn't know how to translate that into v8 code. Test script: --------------- Copy /sapi/fpm/fpm/fpm_atomic.h to fpm_atomic.c and add bogus main() function: int main () { int result; atomic_t mylock; result = fpm_spinlock(&mylock, 1); } Compile using "gcc -mcpu=v8 fpm_atomic.c" will result in error message given. Expected result: ---------------- Should compile without error. Actual result: -------------- sparky:~# gcc -mcpu=v8 fpm_atomic.c /tmp/cciAbMrC.s: Assembler messages: /tmp/cciAbMrC.s:121: Error: Architecture mismatch on "cas". /tmp/cciAbMrC.s:121: (Requires v9|v9a|v9b; requested architecture is sparclite.) sparky:~# ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53310&edit=1