Port report: NetBSD 2.0 mac68k

Started by Rémi Zaraabout 21 years ago9 messages
#1Rémi Zara
remi_zara@mac.com
3 attachment(s)

Hi,

Here is a port report for NetBSD 2.0 mac68k, with sources of
postgresql8.0.0rc1.

Here is the configure line used :
./configure --prefix=/data/postgresql/pgsql-8.0.0rc1 --with-openssl
--with-python --with-perl --with-tcl --with-krb5 --with-pam

But some tweaking was necessary to make it work:
* krb5.h is in /usr/include/krb5 on netbsd (set via CPPFLAGS)
* krb5_encrypt is to be found in -lkrb5 -ldes -lasn1 -lroken -lcrypto

--enable-thread-safety does not work because the thread safety test
fails (src/tools/thread/thread_test)
configure:18831: ./conftest
conftest in free(): error: freelist is destroyed.
[1]: Abort trap (core dumped) ./conftest${ac_e...

Then the tas code in src/backend/storage/lmgr/s_lock.c cannot be
compiled and linked on this system without modification:
the '_' in front of the tas symbol should be removes, and '%' added in
front of register names. I've attached a diff that makes these
modifications only for NetBSD mac68k ELF.

With these modifications, make and make install are OK !

template1=# SELECT version();
version
------------------------------------------------------------------------
---------------------------------
PostgreSQL 8.0.0rc1 on m68k-unknown-netbsdelf2.0, compiled by GCC gcc
(GCC) 3.3.3 (NetBSD nb3 20040520)
(1 row)

in make check, two tests fail: float8 and misc.
I've attached the regression.diffs file.

Regards,

Rémi Zara

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

Attachments:

regression.diffsapplication/octet-stream; name=regression.diffs; x-unix-mode=0644Download
*** ./expected/float8.out	Fri Apr 23 20:32:20 2004
--- ./results/float8.out	Mon Dec 13 09:16:25 2004
***************
*** 13,21 ****
  SELECT '-10e400'::float8;
  ERROR:  "-10e400" is out of range for type double precision
  SELECT '10e-400'::float8;
! ERROR:  "10e-400" is out of range for type double precision
  SELECT '-10e-400'::float8;
! ERROR:  "-10e-400" is out of range for type double precision
  -- bad input
  INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
  ERROR:  invalid input syntax for type double precision: "     "
--- 13,29 ----
  SELECT '-10e400'::float8;
  ERROR:  "-10e400" is out of range for type double precision
  SELECT '10e-400'::float8;
!  float8 
! --------
!       0
! (1 row)
! 
  SELECT '-10e-400'::float8;
!  float8 
! --------
!      -0
! (1 row)
! 
  -- bad input
  INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
  ERROR:  invalid input syntax for type double precision: "     "
***************
*** 367,375 ****
  INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
  ERROR:  "-10e400" is out of range for type double precision
  INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
- ERROR:  "10e-400" is out of range for type double precision
  INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
- ERROR:  "-10e-400" is out of range for type double precision
  -- maintain external table consistency across platforms
  -- delete all values and reinsert well-behaved ones
  DELETE FROM FLOAT8_TBL;
--- 375,381 ----

======================================================================

*** ./expected/misc.out	Mon Dec 13 08:48:44 2004
--- ./results/misc.out	Mon Dec 13 09:33:38 2004
***************
*** 737,745 ****
    i   | length | octet_length | oldstyle_length 
  ------+--------+--------------+-----------------
        |        |              |                
!     0 |      2 |            2 |               2
!  1000 |      2 |            2 |            1002
!     0 |  50000 |        50000 |           50000
  (4 rows)
  
  drop table oldstyle_test;
--- 737,745 ----
    i   | length | octet_length | oldstyle_length 
  ------+--------+--------------+-----------------
        |        |              |                
!     0 |      2 |            2 |        74373268
!  1000 |      2 |            2 |        74373220
!     0 |  50000 |        50000 |         3903512
  (4 rows)
  
  drop table oldstyle_test;

======================================================================

diff.txttext/plain; name=diff.txt; x-unix-mode=0644Download
--- src/backend/storage/lmgr/s_lock.c.orig	2004-12-14 20:50:08.000000000 +0000
+++ src/backend/storage/lmgr/s_lock.c	2004-12-14 20:59:28.000000000 +0000
@@ -136,6 +136,26 @@
 
 
 #if defined(__m68k__)
+#if defined(__NetBSD__) && defined(__ELF__)
+static void
+tas_dummy()                                             /* really means: extern int tas(slock_t
+                                                                 * **lock); */
+{
+	__asm__         __volatile__(
+										  "\
+.global         tas                            \n\
+tas:                                                   \n\
+			movel   %sp@(0x4),%a0     \n\
+			tas     %a0@                     \n\
+			beq     _success        \n\
+			moveq   #-128,%d0        \n\
+			rts                                     \n\
+_success:                                               \n\
+			moveq   #0,%d0           \n\
+			rts                                     \n\
+");
+}
+#else
 static void
 tas_dummy()						/* really means: extern int tas(slock_t
 								 * **lock); */
@@ -154,6 +174,7 @@
 			rts					\n\
 ");
 }
+#endif   /$ __NetBSD__ && __ELF__ */
 #endif   /* __m68k__ */
 
 
smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload
#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Rémi Zara (#1)
Re: Port report: NetBSD 2.0 mac68k

I am confused by the threading failure. I don't see any free() call in
thread_test.c. Would you go to the tools/thread directory and run the
program manually and use a debugger to see the failure line? Is there
some threading flag NetBSD requires for compiles or linking?

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

R���mi Zara wrote:

Hi,

Here is a port report for NetBSD 2.0 mac68k, with sources of
postgresql8.0.0rc1.

Here is the configure line used :
./configure --prefix=/data/postgresql/pgsql-8.0.0rc1 --with-openssl
--with-python --with-perl --with-tcl --with-krb5 --with-pam

But some tweaking was necessary to make it work:
* krb5.h is in /usr/include/krb5 on netbsd (set via CPPFLAGS)
* krb5_encrypt is to be found in -lkrb5 -ldes -lasn1 -lroken -lcrypto

--enable-thread-safety does not work because the thread safety test
fails (src/tools/thread/thread_test)
configure:18831: ./conftest
conftest in free(): error: freelist is destroyed.
[1] Abort trap (core dumped) ./conftest${ac_e...

Then the tas code in src/backend/storage/lmgr/s_lock.c cannot be
compiled and linked on this system without modification:
the '_' in front of the tas symbol should be removes, and '%' added in
front of register names. I've attached a diff that makes these
modifications only for NetBSD mac68k ELF.

With these modifications, make and make install are OK !

template1=# SELECT version();
version
------------------------------------------------------------------------
---------------------------------
PostgreSQL 8.0.0rc1 on m68k-unknown-netbsdelf2.0, compiled by GCC gcc
(GCC) 3.3.3 (NetBSD nb3 20040520)
(1 row)

in make check, two tests fail: float8 and misc.
I've attached the regression.diffs file.

Regards,

R?mi Zara

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

[ Attachment, skipping... ]

[ Attachment, skipping... ]

-- 
  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
#3Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Rémi Zara (#1)
Re: Port report: NetBSD 2.0 mac68k

I will apply the ASM changes that affect only NetBSD mac68k ELF.

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

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

R���mi Zara wrote:

Hi,

Here is a port report for NetBSD 2.0 mac68k, with sources of
postgresql8.0.0rc1.

Here is the configure line used :
./configure --prefix=/data/postgresql/pgsql-8.0.0rc1 --with-openssl
--with-python --with-perl --with-tcl --with-krb5 --with-pam

But some tweaking was necessary to make it work:
* krb5.h is in /usr/include/krb5 on netbsd (set via CPPFLAGS)
* krb5_encrypt is to be found in -lkrb5 -ldes -lasn1 -lroken -lcrypto

--enable-thread-safety does not work because the thread safety test
fails (src/tools/thread/thread_test)
configure:18831: ./conftest
conftest in free(): error: freelist is destroyed.
[1] Abort trap (core dumped) ./conftest${ac_e...

Then the tas code in src/backend/storage/lmgr/s_lock.c cannot be
compiled and linked on this system without modification:
the '_' in front of the tas symbol should be removes, and '%' added in
front of register names. I've attached a diff that makes these
modifications only for NetBSD mac68k ELF.

With these modifications, make and make install are OK !

template1=# SELECT version();
version
------------------------------------------------------------------------
---------------------------------
PostgreSQL 8.0.0rc1 on m68k-unknown-netbsdelf2.0, compiled by GCC gcc
(GCC) 3.3.3 (NetBSD nb3 20040520)
(1 row)

in make check, two tests fail: float8 and misc.
I've attached the regression.diffs file.

Regards,

R?mi Zara

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

[ Attachment, skipping... ]

[ Attachment, skipping... ]

-- 
  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
#4Rémi Zara
remi_zara@mac.com
In reply to: Bruce Momjian (#2)
1 attachment(s)
Re: Port report: NetBSD 2.0 mac68k

Le 16 déc. 04, à 22:48, Bruce Momjian a écrit :

I am confused by the threading failure. I don't see any free() call in
thread_test.c. Would you go to the tools/thread directory and run the
program manually and use a debugger to see the failure line? Is there
some threading flag NetBSD requires for compiles or linking?

Ok. I must have made an error reporting the output of the thread safety
test.
Here is the output, for ./configure --enable-thread-safety:

configure:18831: ./conftest
Your errno is thread-safe.
Your system uses strerror() which is not thread-safe. **
Your system uses getpwuid() which is not thread-safe. **
Your system has getaddrinfo(); it does not need gethostbyname()
or gethostbyname_r().

** YOUR PLATFORM IS NOT THREAD-SAFE. **

Regards,

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

Attachments:

smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload
#5Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Rémi Zara (#4)
Re: Port report: NetBSD 2.0 mac68k

R���mi Zara wrote:

Le 16 d?c. 04, ? 22:48, Bruce Momjian a ?crit :

I am confused by the threading failure. I don't see any free() call in
thread_test.c. Would you go to the tools/thread directory and run the
program manually and use a debugger to see the failure line? Is there
some threading flag NetBSD requires for compiles or linking?

Ok. I must have made an error reporting the output of the thread safety
test.
Here is the output, for ./configure --enable-thread-safety:

configure:18831: ./conftest
Your errno is thread-safe.
Your system uses strerror() which is not thread-safe. **
Your system uses getpwuid() which is not thread-safe. **
Your system has getaddrinfo(); it does not need gethostbyname()
or gethostbyname_r().

** YOUR PLATFORM IS NOT THREAD-SAFE. **

OK, that is the right output, but I thought NetBSD 2.0 had native
threading.

-- 
  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
#6Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Rémi Zara (#1)
1 attachment(s)
Re: Port report: NetBSD 2.0 mac68k

OK, I modified the m64k spinlock patch to more cleanly merge into our
code, attached. Applied.

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

R���mi Zara wrote:

Hi,

Here is a port report for NetBSD 2.0 mac68k, with sources of
postgresql8.0.0rc1.

Here is the configure line used :
./configure --prefix=/data/postgresql/pgsql-8.0.0rc1 --with-openssl
--with-python --with-perl --with-tcl --with-krb5 --with-pam

But some tweaking was necessary to make it work:
* krb5.h is in /usr/include/krb5 on netbsd (set via CPPFLAGS)
* krb5_encrypt is to be found in -lkrb5 -ldes -lasn1 -lroken -lcrypto

--enable-thread-safety does not work because the thread safety test
fails (src/tools/thread/thread_test)
configure:18831: ./conftest
conftest in free(): error: freelist is destroyed.
[1] Abort trap (core dumped) ./conftest${ac_e...

Then the tas code in src/backend/storage/lmgr/s_lock.c cannot be
compiled and linked on this system without modification:
the '_' in front of the tas symbol should be removes, and '%' added in
front of register names. I've attached a diff that makes these
modifications only for NetBSD mac68k ELF.

With these modifications, make and make install are OK !

template1=# SELECT version();
version
------------------------------------------------------------------------
---------------------------------
PostgreSQL 8.0.0rc1 on m68k-unknown-netbsdelf2.0, compiled by GCC gcc
(GCC) 3.3.3 (NetBSD nb3 20040520)
(1 row)

in make check, two tests fail: float8 and misc.
I've attached the regression.diffs file.

Regards,

R?mi Zara

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

[ Attachment, skipping... ]

[ Attachment, skipping... ]

-- 
  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

Attachments:

/bjm/difftext/plainDownload
Index: src/backend/storage/lmgr/s_lock.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/storage/lmgr/s_lock.c,v
retrieving revision 1.32
diff -c -c -r1.32 s_lock.c
*** src/backend/storage/lmgr/s_lock.c	30 Aug 2004 23:47:20 -0000	1.32
--- src/backend/storage/lmgr/s_lock.c	18 Dec 2004 20:19:35 -0000
***************
*** 136,147 ****
  
  
  #if defined(__m68k__)
  static void
! tas_dummy()						/* really means: extern int tas(slock_t
! 								 * **lock); */
  {
  	__asm__		__volatile__(
! 										 "\
  .global		_tas				\n\
  _tas:							\n\
  			movel	sp@(0x4),a0	\n\
--- 136,161 ----
  
  
  #if defined(__m68k__)
+ /* really means: extern int tas(slock_t* **lock); */
  static void
! tas_dummy()
  {
  	__asm__		__volatile__(
! #if defined(__NetBSD__) && defined(__ELF__)
! /* no underscore for label and % for registers */
! 										"\
! .global		tas 				\n\
! tas:							\n\
! 			movel	%sp@(0x4),%a0	\n\
! 			tas 	%a0@		\n\
! 			beq 	_success	\n\
! 			moveq	#-128,%d0	\n\
! 			rts 				\n\
! _success:						\n\
! 			moveq	#0,%d0		\n\
! 			rts 				\n"
! #else
! 										"\
  .global		_tas				\n\
  _tas:							\n\
  			movel	sp@(0x4),a0	\n\
***************
*** 151,158 ****
  			rts					\n\
  _success:						\n\
  			moveq 	#0,d0		\n\
! 			rts					\n\
! ");
  }
  #endif   /* __m68k__ */
  
--- 165,173 ----
  			rts					\n\
  _success:						\n\
  			moveq 	#0,d0		\n\
! 			rts					\n"
! #endif   /* __NetBSD__ && __ELF__ */
! );
  }
  #endif   /* __m68k__ */
  
#7Rémi Zara
remi_zara@mac.com
In reply to: Bruce Momjian (#6)
1 attachment(s)
Re: Port report: NetBSD 2.0 mac68k

Le 21 déc. 04, à 06:45, Bruce Momjian a écrit :

Rémi Zara wrote:

Le 16 d?c. 04, ? 22:48, Bruce Momjian a ?crit :

I am confused by the threading failure. I don't see any free() call
in
thread_test.c. Would you go to the tools/thread directory and run
the
program manually and use a debugger to see the failure line? Is
there
some threading flag NetBSD requires for compiles or linking?

Ok. I must have made an error reporting the output of the thread
safety
test.
Here is the output, for ./configure --enable-thread-safety:

configure:18831: ./conftest
Your errno is thread-safe.
Your system uses strerror() which is not thread-safe. **
Your system uses getpwuid() which is not thread-safe. **
Your system has getaddrinfo(); it does not need gethostbyname()
or gethostbyname_r().

** YOUR PLATFORM IS NOT THREAD-SAFE. **

Shame. You don't see strerror_r() or getpwuid_r() around anywhere. If
not please bug the NetBSD people to add them. They can also make
strerror() thread-safe rather than adding strerror_r(). Thanks.

It seems that getpwuid_r() is being implemented in NetBSD-current.
I don't know about strerror_r().

Regards,

Rémi Zara

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

Attachments:

smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload
#8Peter Eisentraut
peter_e@gmx.net
In reply to: Rémi Zara (#1)
Re: Port report: NetBSD 2.0 mac68k

Am Dienstag, 14. Dezember 2004 23:07 schrieb Rᅵmi Zara:

Here is a port report for NetBSD 2.0 mac68k, with sources of
postgresql8.0.0rc1.

It seems we have fixed the assembly syntax and the float8 failure, but the
failure in the misc test seems pretty bogus. Has anyone looked into that
further?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#8)
Re: Port report: NetBSD 2.0 mac68k

Peter Eisentraut <peter_e@gmx.net> writes:

Am Dienstag, 14. Dezember 2004 23:07 schrieb R�mi Zara:

Here is a port report for NetBSD 2.0 mac68k, with sources of
postgresql8.0.0rc1.

It seems we have fixed the assembly syntax and the float8 failure, but the
failure in the misc test seems pretty bogus. Has anyone looked into that
further?

We fixed it:
http://archives.postgresql.org/pgsql-committers/2004-12/msg00341.php

There is still a contrib check failure on that platform, but we
concluded that it represented a compiler bug. I think we can call the
platform supported anyway.

regards, tom lane