Patch to remove -Dalpha for Alphas...

Started by Ryan Kirkpatrickover 27 years ago2 messages
#1Ryan Kirkpatrick
rkirkpat@nag.cs.colorado.edu
1 attachment(s)

Ok, I have finally gotten all of the defines for Dec/Alpha and
Linux/Alpha sorted out as Marc asked. There is no longer any need for
'-Dalpha' or '-Dlinuxalpha' in either the Dec/Alpha or the Linux/Alpha
template files (./src/template/{alpha,linuxalpha}). I have replaced every
instance of 'alpha' or '__alpha__' with '__alpha', as that appears to be
the common symbol between C compilers on both operating systems (RH4.2 &
DecUnix 4.0b) for alpha.
Attached is the patch against the April 25 snapshot. I have
compiled and tested it on my UDB, and it does as well as straight 6.3.2. I
also compiled the patched version on my Pentium 100, and verified it does
not break anything there (and therefore should not on any other platform,
I hope...). I don't have access to a Dec/Alpha box, so would someone
please test it on such a machine? I don't see any problems occuring, but
it is best to check and make sure. If there are any problems, send a
detailed description to me and I will get it sorted out. Of course,
patches are fine too. :)
While this patch doesn't improve the stablity of pgsql on
Linux/Alpha, at least it paves the road, making future improvments easier
and more sane. In the future, I recommend anything that needs to be
'#ifdef'ed as alpha-spefic use the symbol '__alpha' and then everything
should work automatically, with out messing with template files, CFLAGS
lines, or defines!
Thats about it for now, talk to you all later!

----------------------------------------------------------------------------
| "For to me to live is Christ, and to die is gain." |
| --- Philippians 1:21 (KJV) |
----------------------------------------------------------------------------
| Ryan Kirkpatrick | Boulder, Colorado | rkirkpat@nag.cs.colorado.edu |
----------------------------------------------------------------------------
| http://www-ugrad.cs.colorado.edu/~rkirkpat/ |
----------------------------------------------------------------------------

Attachments:

patchtext/plain; charset=US-ASCII; name=patchDownload
diff -uNr pgsql/src/backend/main/main.c pgsql.new/src/backend/main/main.c
--- pgsql/src/backend/main/main.c	Sun Apr 12 02:00:44 1998
+++ pgsql.new/src/backend/main/main.c	Sat Apr 25 09:58:08 1998
@@ -15,7 +15,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#if defined(alpha) && !defined(linux)
+#if defined(__alpha) && !defined(linux)
 #include <sys/sysinfo.h>
 #include <machine/hal_sysinfo.h>
 #define ASSEMBLER
@@ -42,7 +42,7 @@
 {
 	int			len;
 
-#if defined(alpha)
+#if defined(__alpha)
 #ifdef NOFIXADE
 	int			buffer[] = {SSIN_UACPROC, UAC_SIGBUS};
 
@@ -70,7 +70,7 @@
 	syscall(SYS_sysmips, MIPS_FIXADE, 0, NULL, NULL, NULL);
 #endif
 
-#if defined(alpha)
+#if defined(__alpha)
 	if (setsysinfo(SSI_NVPAIRS, buffer, 1, (caddr_t) NULL,
 				   (unsigned long) NULL) < 0)
 	{
diff -uNr pgsql/src/backend/storage/buffer/s_lock.c pgsql.new/src/backend/storage/buffer/s_lock.c
--- pgsql/src/backend/storage/buffer/s_lock.c	Wed Feb 25 22:35:28 1998
+++ pgsql.new/src/backend/storage/buffer/s_lock.c	Sat Apr 25 10:00:23 1998
@@ -37,7 +37,7 @@
 #include "storage/ipc.h"
 #include "storage/s_lock.h"
 
-#if defined(__alpha__) && defined(linux)
+#if defined(__alpha) && defined(linux)
 void
 S_LOCK(slock_t *lock)
 {
diff -uNr pgsql/src/backend/utils/adt/float.c pgsql.new/src/backend/utils/adt/float.c
--- pgsql/src/backend/utils/adt/float.c	Sun Apr 12 02:00:52 1998
+++ pgsql.new/src/backend/utils/adt/float.c	Sat Apr 25 09:59:17 1998
@@ -132,7 +132,7 @@
  * until the distributions are updated.
  *								--djm 12/16/96
  */
-#if ( defined(linux) && defined(alpha) ) && !defined(UNSAFE_FLOATS)
+#if ( defined(linux) && defined(__alpha) ) && !defined(UNSAFE_FLOATS)
 #define UNSAFE_FLOATS
 #endif
 
diff -uNr pgsql/src/include/port/linux.h pgsql.new/src/include/port/linux.h
--- pgsql/src/include/port/linux.h	Wed Feb 25 22:42:56 1998
+++ pgsql.new/src/include/port/linux.h	Sat Apr 25 10:00:52 1998
@@ -13,7 +13,7 @@
 #if defined(PPC)
 typedef unsigned int slock_t;
 
-#elif defined(__alpha__)
+#elif defined(__alpha)
 typedef long int slock_t;
 
 #else
@@ -42,6 +42,6 @@
 #undef NEED_I386_TAS_ASM
 #endif
 
-#if defined(__alpha__)
+#if defined(__alpha)
 #undef NEED_I386_TAS_ASM
 #endif
diff -uNr pgsql/src/include/storage/s_lock.h pgsql.new/src/include/storage/s_lock.h
--- pgsql/src/include/storage/s_lock.h	Sat Feb 28 22:47:24 1998
+++ pgsql.new/src/include/storage/s_lock.h	Sat Apr 25 10:06:25 1998
@@ -97,7 +97,7 @@
  * (see storage/ipc.h).
  */
 
-#if (defined(__alpha__) || defined(__alpha)) && !defined(linux)
+#if defined(__alpha) && !defined(linux)
 
 #define S_LOCK(lock)	do \
 						{ \
@@ -340,7 +340,7 @@
 #endif							/* NEED_I386_TAS_ASM */
 
 
-#if defined(__alpha__) && defined(linux)
+#if defined(__alpha) && defined(linux)
 
 void		S_LOCK(slock_t *lock);
 
@@ -348,7 +348,7 @@
 
 #define S_INIT_LOCK(lock)	S_UNLOCK(lock)
 
-#endif							/* defined(__alpha__) && defined(linux) */
+#endif							/* defined(__alpha) && defined(linux) */
 
 #if defined(linux) && defined(sparc)
 
diff -uNr pgsql/src/include/utils/memutils.h pgsql.new/src/include/utils/memutils.h
--- pgsql/src/include/utils/memutils.h	Sun Apr 12 02:00:53 1998
+++ pgsql.new/src/include/utils/memutils.h	Sat Apr 25 10:02:44 1998
@@ -67,7 +67,7 @@
  */
 #if defined(sun) && ! defined(sparc)
 #define LONGALIGN(LEN)	SHORTALIGN(LEN)
-#elif defined (alpha)
+#elif defined (__alpha)
 
  /*
   * even though "long alignment" should really be on 8-byte boundaries for
diff -uNr pgsql/src/template/alpha pgsql.new/src/template/alpha
--- pgsql/src/template/alpha	Mon Mar 23 02:01:34 1998
+++ pgsql.new/src/template/alpha	Sat Apr 25 10:06:47 1998
@@ -5,7 +5,7 @@
 # This is defined here because a bunch of clients include tmp/c.h,
 # which is where the work is done on HP-UX.  It only affects the
 # backend on Ultrix and OSF/1.
-CFLAGS:-DNOFIXADE -Dalpha
+CFLAGS:-DNOFIXADE
 SHARED_LIB:
 ALL:
 SRCH_INC:
diff -uNr pgsql/src/template/linuxalpha pgsql.new/src/template/linuxalpha
--- pgsql/src/template/linuxalpha	Sun Apr 12 02:00:57 1998
+++ pgsql.new/src/template/linuxalpha	Sat Apr 25 10:06:53 1998
@@ -1,5 +1,5 @@
 AROPT:crs
-CFLAGS:-O2 -Dalpha -Dlinuxalpha
+CFLAGS:-O2
 SHARED_LIB:-fpic
 ALL:
 SRCH_INC:
#2Ryan Kirkpatrick
rkirkpat@nag.cs.colorado.edu
In reply to: Ryan Kirkpatrick (#1)
Re: [PORTS] Patch to remove -Dalpha for Alphas...

On Mon, 27 Apr 1998, Peter Stockwell wrote:

Hi Ryan

So far so good. For some reason, the DEC/alpha patch didn't recognize
your diffs and rather than fathom that out, I installed them manually.

They were unified diffs, and I have known some versions of patch
to not like those.

Compilation (gcc 2.7.2.3) completed just fine. A silly configuration
problem has caused a delay in trying the regression tests for the
patched version, but I would expect it to complete OK. I'll be in
touch to confirm this.

....

I have now run the regression tests on the retrieved snapshot and
achieved the same result as before (time failures, others trivial), so
it looks successful. I have done the build using gcc (2.7.2.3) - I
have not tried to use the native cc.

Good! At least I have not broken anything major! I think that
should prove that my patches don't break Dec/Alpha. Thanks for your help.

----------------------------------------------------------------------------
| "For to me to live is Christ, and to die is gain." |
| --- Philippians 1:21 (KJV) |
----------------------------------------------------------------------------
| Ryan Kirkpatrick | Boulder, Colorado | rkirkpat@nag.cs.colorado.edu |
----------------------------------------------------------------------------
| http://www-ugrad.cs.colorado.edu/~rkirkpat/ |
----------------------------------------------------------------------------