Jeroen Ruigrok/asmodai wrote:
> -On [20030905 20:52], Tom Lane ([EMAIL PROTECTED]) wrote:
> >Alternatively, find out what symbols your compiler predeclares.
> >If my theory is right then your pg_config_os.h file is failing to
> >define HAS_TEST_AND_SET; why?
> 
> Indeed, pg_config_os.h does not set anything for __ia64__.
> 
> When I added definitions for Itanium and Opteron to the
> src/include/port/freebsd.h (attached) I get the following:

This post brings up a problem with our configuration system.  Right now,
we test for compiler flags and set HAS_TEST_AND_SET based on the CPU in
each include/port/{os}.h file.  However, this requires us to know about
each CPU enabled on each OS, and requires us to add duplicate
CPU-specific code for each platform.  See below for FreeBSD:

        --- freebsd.h.orig      Fri Sep  5 21:38:06 2003
        +++ freebsd.h   Fri Sep  5 21:41:38 2003
        @@ -44,5 +44,14 @@
         #if defined(__powerpc__)
         #define HAS_TEST_AND_SET
         typedef unsigned int slock_t;
        +#endif
         
        +#if defined(__ia64__)
        +#define HAS_TEST_AND_SET
        +typedef unsigned int slock_t;
        +#endif
        +
        +#if defined(__x64_64__)
        +#define HAS_TEST_AND_SET
        +typedef unsigned int slock_t;
         #endif

For example, we will need the last two defines for all platforms that
support Intel.  I wonder if we should have the HAS_TEST_AND_SET defined
in s_lock.h where the actual test-and-set is defined.  This would
eliminate redundancy, and fix the FreeBSD problem reported with
Opteron/Itanium.  I think we still need an slock_t typedef, but it is
probably the same for all CPU's on that platform.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to