Re: darwin pgsql patches - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: darwin pgsql patches
Date
Msg-id Pine.LNX.4.21.0011291723070.796-100000@peter.localdomain
Whole thread Raw
In response to darwin pgsql patches  (Peter Bierman <bierman@apple.com>)
Responses Re: darwin pgsql patches
Re: darwin pgsql patches
List pgsql-patches
Peter Bierman writes:

> Here are patches to CVS top of tree that allow darwin to completely
> build and install. Unfortunately, the sem...() shim does not function
> correctly yet, so it's not stable enough to use.

We've been through this before.  Newer Darwin kernels have semaphore
support, which means that you'll at least have to compensate for that.  I
believe we agreed that semaphore support for older kernels would be
available as a patch.


>  #include "postgres.h"
>  #include "storage/ipc.h"
>  #include "storage/proc.h"
> -#include <sys/sem.h>
> +//#include <sys/sem.h>
> +#include "sem.h"

No C++ comments.

> -void *pg_dlopen(const char *filename)
> +void *pg_dlopen(char *filename)

Why?

> +#if defined(darwin) && defined(__ppc__)
> +static void
> +tas_dummy()
> +{
> +       __asm__("               \n\
> +               .globl  tas     \n\
> +               .globl  _tas    \n\
> +_tas:                          \n\
> +tas:                           \n\
> +               lwarx   r5,0,r3 \n\
> +               cmpwi   r5,0    \n\
> +               bne     fail    \n\
> +               addi    r5,r5,1 \n\
> +               stwcx.  r5,0,r3 \n\
> +               beq     success \n\
> +fail:          li      r3,1    \n\
> +               blr             \n\
> +success:                       \n\
> +               li r3,0         \n\
> +               blr             \n\
> +    ");
> +}
> +
> +#endif  /* __ppc__ && darwin */

Here the question was why the existing powerpc code doesn't work.  There
are only syntax differences.  Any idea?

> +#if defined(darwin)
> +#include "../backend/port/darwin/sem.h"
> +#endif

This doesn't work.  There's no guarantee that the source tree is the same
as the build tree.


> 4c6,7
> < CFLAGS=-O0
> ---
> > #CFLAGS=-O2

No commented out things.  Either you take -02 or -O0 or you set CFLAGS to
something else, but it has to be set to something.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: darwin pgsql patches
Next
From: Peter Bierman
Date:
Subject: Re: darwin pgsql patches