Skip site navigation (1) Skip section navigation (2)

Re: darwin pgsql patches

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Peter Bierman <bierman(at)apple(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: darwin pgsql patches
Date: 2000-11-29 16:30:33
Message-ID: Pine.LNX.4.21.0011291723070.796-100000@peter.localdomain (view raw or flat)
Thread:
Lists: 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(at)gmx(dot)net       http://yi.org/peter-e/


In response to

Responses

pgsql-patches by date

Next:From: Peter BiermanDate: 2000-11-29 22:21:03
Subject: Re: darwin pgsql patches
Previous:From: Tom LaneDate: 2000-11-29 16:05:54
Subject: Re: darwin pgsql patches

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group