Fwd: [TESTERS] [PostgreSQL 9.1 alpha5] OpenBSD and Loongson

Started by Josh Berkusalmost 15 years ago2 messages
#1Josh Berkus
josh@agliodbs.com
2 attachment(s)

-------- Original Message --------
Subject: [TESTERS] [PostgreSQL 9.1 alpha5] OpenBSD and Loongson
Date: Thu, 7 Apr 2011 16:22:46 +0200
From: postgresql@raveland.org
To: pgsql-testers@postgresql.org

Hi,

I need the following patch to make PostgreSQL happy
on Loongson with OpenBSD (http://www.openbsd.org/loongson.html).
These restrictions no longer exist on OpenBSD.
Tested with the latest alpha (9.1 alpha5) and with
the latest 9 release (9.0.3).

Regards,

Attachments:

patch-src_backend_port_dynloader_openbsd_ctext/plain; name=patch-src_backend_port_dynloader_openbsd_cDownload
$OpenBSD$
--- src/backend/port/dynloader/openbsd.c.orig	Thu Apr  7 03:30:11 2011
+++ src/backend/port/dynloader/openbsd.c	Thu Apr  7 03:32:13 2011
@@ -57,28 +57,18 @@ BSD44_derived_dlerror(void)
 void *
 BSD44_derived_dlopen(const char *file, int num)
 {
-#if defined(__mips__)
-	snprintf(error_message, sizeof(error_message),
-			 "dlopen (%s) not supported", file);
-	return NULL;
-#else
 	void	   *vp;
 
 	if ((vp = dlopen((char *) file, num)) == NULL)
 		snprintf(error_message, sizeof(error_message),
 				 "dlopen (%s) failed: %s", file, dlerror());
 	return vp;
-#endif
 }
 
 void *
 BSD44_derived_dlsym(void *handle, const char *name)
 {
-#if defined(__mips__)
-	snprintf(error_message, sizeof(error_message),
-			 "dlsym (%s) failed", name);
-	return NULL;
-#elif defined(__ELF__)
+#if defined(__ELF__)
 	return dlsym(handle, name);
 #else
 	void	   *vp;

Attached Message Parttext/plain; name="Attached Message Part"Download
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Josh Berkus (#1)
Re: Fwd: [TESTERS] [PostgreSQL 9.1 alpha5] OpenBSD and Loongson

Josh Berkus <josh@agliodbs.com> writes:

I need the following patch to make PostgreSQL happy
on Loongson with OpenBSD (http://www.openbsd.org/loongson.html).
These restrictions no longer exist on OpenBSD.
Tested with the latest alpha (9.1 alpha5) and with
the latest 9 release (9.0.3).

I'm a bit inclined to think the right fix is not exactly what is
proposed here, but rather to make the openbsd (and freebsd) versions of
this file look like the netbsd one, viz

#if !defined(HAVE_DLOPEN)
snprintf(error_message, sizeof(error_message),
"dlopen (%s) not supported", file);
return NULL;
#else

Since you can't do much useful without dlopen support in any modern
version of Postgres, it doesn't seem like there is much risk of breaking
any working situation --- so we might as well back-patch, too.

regards, tom lane