Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#17748 closed defect (duplicate)

apr-1.3.3: 4-way universal build: duplicate case value and bad 64-32 bit switch logic

Reported by: eborisch@… Owned by: danielluke (Daniel J. Luke)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: universal Cc:
Port: apr


Ticket #15523 is still true; please fix.

How to fix: as noted on - patch include/apr.h from

typedef long apr_int64_t;
typedef unsigned long apr_uint64_t;


typedef long long apr_int64_t;
typedef unsigned long long apr_uint64_t;

Also, atomic/unix/ia32.c needs to have the two if clauses at the end changed to something like this:

#if !(defined(__LP64__) )
    asm volatile ("lock; cmpxchgl %2, %1"
                  : "=a" (prev), "=m" (*mem)
                  : "r" (with), "m" (*mem), "0" (cmp));
    asm volatile ("lock; cmpxchgq %q2, %1"
                  : "=a" (prev), "=m" (*mem)
                  : "r" ((unsigned long)with), "m" (*mem),
                    "0" ((unsigned long)cmp));
    return prev;

APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
    void *prev;
#if !(defined(__LP64__) )
    asm volatile ("xchgl %2, %1"
                  : "=a" (prev), "+m" (*mem)
                  : "0" (with));
   asm volatile ("xchgq %q2, %1"
                  : "=a" (prev), "+m" (*mem)
                  : "r" ((unsigned long)with));
    return prev;

These are both issues with doing the 32-bit and 64-bit builds concurrently.

Change History (4)

comment:1 Changed 14 years ago by dbevans (David B. Evans)

Cc: dluke@… removed
Keywords: apr removed
Owner: changed from macports-tickets@… to dluke@…

Assigning to maintainer.

comment:2 Changed 14 years ago by eborisch@…

A better patch may be to change apr.h as above, but to also put this in:

#ifdef __LP64__

replacing the existing "#define APR_SIZEOF_VOIDP 8" that exists after configure... With this, no change is needed to atomic/unix/ia32.c

comment:3 Changed 14 years ago by ryandesign (Ryan Schmidt)

Resolution: duplicate
Status: newclosed

Duplicate of #17090.

comment:4 Changed 14 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.