apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54840] New: atomics/unix/ppc.c won't compile on OS X
Date Sat, 13 Apr 2013 13:19:51 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54840

            Bug ID: 54840
           Summary: atomics/unix/ppc.c won't compile on OS X
           Product: APR
           Version: 1.4.6
          Hardware: Macintosh
                OS: Mac OS X 10.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
          Assignee: bugs@apr.apache.org
          Reporter: mattiase@acm.org
    Classification: Unclassified

The inline asm routines in atomics/unix/ppc.c won't compile on OS X 10.5:

ld: bcc out of range (83248 max is +/-64K) from _apr_atomic_add32 in
atomic/unix/.libs/ppc.o to _apr_atomic_add32$stub in .libs/libapr-1.0.dylib in
_apr_atomic_add32 from atomic/unix/.libs/ppc.o

The reason for this is that in the code

    asm volatile ("loop_%=:\n"                  /* lost reservation     */
                  "    lwarx   %0,0,%3\n"      /* load and reserve     */
                  "    add     %1,%0,%4\n"     /* add val and prev     */
                  PPC405_ERR77_SYNC             /* ppc405 Erratum 77    */
                  "    stwcx.  %1,0,%3\n"      /* store new value      */
                  "    bne-    loop_%=\n"      /* loop if lost         */

the label loop_%= doesn't work properly. Replacing it with traditional local
labels (1, 2, ...) works nicely. Any reason it was not done that way?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message