Thread: Postgresql 7.3.4 compile failes on NetBSD 1.6 mac68k

Postgresql 7.3.4 compile failes on NetBSD 1.6 mac68k

From
Rémi Zara
Date:
Hi,

I'm trying to compile Postgresql 7.3.4 on NetBSD 1.6 mac68k.
First, I Had to add '%' signs in src/backend/storage/lmgr/s_lock.c
before register names.

--- postgresql-7.3.4/src/backend/storage/lmgr/s_lock.c  Sat Sep 21
02:14:05 2002
+++ s_lock.c    Mon Sep 22 20:51:25 2003
@@ -99,13 +99,13 @@

          "\
  .global                _tas                            \n\
  _tas:                                                  \n\
-                       movel   sp@(0x4),a0     \n\
-                       tas     a0@                     \n\
+                       movel   %sp@(0x4),%a0   \n\
+                       tas     %a0@                    \n\
                         beq     _success        \n\
-                       moveq   #-128,d0        \n\
+                       moveq   #-128,%d0       \n\
                         rts                                     \n\
  _success:                                              \n\
-                       moveq   #0,d0           \n\
+                       moveq   #0,%d0          \n\
                         rts                                     \n\
  ");
  }

Then, linking fails with undefined reference to the 'tas' function:

access/SUBSYS.o: In function `XLogWrite':
access/SUBSYS.o(.text+0x19dbc): undefined reference to `tas'
access/SUBSYS.o: In function `XLogInsert':
access/SUBSYS.o(.text+0x19470): undefined reference to `tas'
access/SUBSYS.o(.text+0x19a38): undefined reference to `tas'
access/SUBSYS.o: In function `AdvanceXLInsertBuffer':
access/SUBSYS.o(.text+0x19b94): undefined reference to `tas'
access/SUBSYS.o: In function `XLogFlush':
access/SUBSYS.o(.text+0x1a358): undefined reference to `tas'
access/SUBSYS.o(.text+0x1c844): more undefined references to `tas'
follow

Any Idea ?

Regards,

Rémi Zara
--
Rémi Zara
web: http://www.remi-zara.net/

Re: Postgresql 7.3.4 compile failes on NetBSD 1.6 mac68k

From
Tom Lane
Date:
=?ISO-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:
> I'm trying to compile Postgresql 7.3.4 on NetBSD 1.6 mac68k.
> First, I Had to add '%' signs in src/backend/storage/lmgr/s_lock.c
> before register names.
> Then, linking fails with undefined reference to the 'tas' function:

Some of the other platforms' tas functions make a point of defining
both "tas" and "_tas".  Does it help if you do likewise?

            regards, tom lane

Re: Postgresql 7.3.4 compile failes on NetBSD 1.6 mac68k

From
Tom Lane
Date:
=?ISO-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:
> Here is the patch to make postgresql compile on m68k 1.6.x NetBSD:

I can't apply this as-is, since (I believe) adding the % marks would
break the code for other m68k platforms.  What we need is an #if test
that determines whether % or no-% is the appropriate syntax for
registers.  Any ideas?

            regards, tom lane

Re: Postgresql 7.3.4 compile failes on NetBSD 1.6 mac68k

From
Rémi Zara
Date:
Hi,

It was indeed the '_' that was causing problem. It is due to the fact
that NetBSD switch to ELF with release 1.6

Here is the patch to make postgresql compile on m68k 1.6.x NetBSD:

--- postgresql-7.3.4/src/backend/storage/lmgr/s_lock.c  Sat Sep 21
02:14:05 2002
+++ s_lock.c    Thu Sep 25 18:47:34 2003
@@ -97,15 +97,15 @@
  {
         __asm__         __volatile__(

          "\
-.global                _tas                            \n\
-_tas:                                                  \n\
-                       movel   sp@(0x4),a0     \n\
-                       tas     a0@                     \n\
+.global                tas                             \n\
+tas:                                                   \n\
+                       movel   %sp@(0x4),%a0   \n\
+                       tas     %a0@                    \n\
                         beq     _success        \n\
-                       moveq   #-128,d0        \n\
+                       moveq   #-128,%d0       \n\
                         rts                                     \n\
  _success:                                              \n\
-                       moveq   #0,d0           \n\
+                       moveq   #0,%d0          \n\
                         rts                                     \n\
  ");
  }

Regards,

Rémi ZARA


Le jeudi, 25 sep 2003, à 04:57 Europe/Paris, Tom Lane a écrit :

> =?ISO-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:
>> I'm trying to compile Postgresql 7.3.4 on NetBSD 1.6 mac68k.
>> First, I Had to add '%' signs in src/backend/storage/lmgr/s_lock.c
>> before register names.
>> Then, linking fails with undefined reference to the 'tas' function:
>
> Some of the other platforms' tas functions make a point of defining
> both "tas" and "_tas".  Does it help if you do likewise?
>
>             regards, tom lane
>
>
--
Rémi Zara
web: http://www.remi-zara.net/


Re: Postgresql 7.3.4 compile failes on NetBSD 1.6 mac68k

From
Bruce Momjian
Date:
Would someone report on the answer to this m68k question?

---------------------------------------------------------------------------

Tom Lane wrote:
> =?ISO-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:
> > Here is the patch to make postgresql compile on m68k 1.6.x NetBSD:
>
> I can't apply this as-is, since (I believe) adding the % marks would
> break the code for other m68k platforms.  What we need is an #if test
> that determines whether % or no-% is the appropriate syntax for
> registers.  Any ideas?
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
>

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