[#4858] Build fails on OSX Tiger 10.4 — noreply@...

Bugs item #1883, was opened at 2005-05-06 14:55

21 messages 2005/05/06
[#4862] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Yukihiro Matsumoto <matz@...> 2005/05/07

Hi,

[#4865] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Ryan Davis <ryand-ruby@...> 2005/05/07

[#4868] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — nobu.nokada@... 2005/05/07

Hi,

[#5053] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Shugo Maeda <shugo@...> 2005/05/19

Hi,

[#5056] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Mark Hubbart <discordantus@...> 2005/05/19

On 5/19/05, Shugo Maeda <shugo@ruby-lang.org> wrote:

[#4874] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...>

Hello all,

31 messages 2005/05/10
[#4879] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Pit Capitain <pit@...> 2005/05/11

Ilias Lazaridis schrieb:

[#4883] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...> 2005/05/12

Pit Capitain wrote:

[#4884] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ryan Davis <ryand-ruby@...> 2005/05/12

[#4888] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...> 2005/05/12

Ryan Davis wrote:

[#4889] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — ES <ruby-ml@...> 2005/05/12

[#4890] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...> 2005/05/12

ES wrote:

[#4891] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Alexander Kellett <ruby-lists@...> 2005/05/12

On May 12, 2005, at 3:13 PM, Ilias Lazaridis wrote:

[#4911] Pointless argc check in Array#select — noreply@...

Patches item #1900, was opened at 2005-05-12 09:33

11 messages 2005/05/12

[#4919] - Hierarchical/Modular Directory Structure — Ilias Lazaridis <ilias@...>

The source-code structure should be simplified, lowering barriers for

20 messages 2005/05/12

Re: shim for select() for VMS & general porting questions

From: nobuyoshi nakada <nobuyoshi.nakada@...>
Date: 2005-05-27 07:02:58 UTC
List: ruby-core #5109
Hi,

At Fri, 27 May 2005 01:52:40 +0900,
BG - Ben Armstrong wrote in [ruby-core:05103]:
> First, I think our problem is bigger than this pair of files.  I know
> Masamichi was making *all* of his commits to the stable tree, which I
> agree is not the usual thing to do, and should be fixed.  Shouldn't we
> take care to ensure all of the changes he committed to this branch are
> merged into HEAD before proceeding with further patches?

Indeed.

> Second, before I try your new patch I think I should mention we
> encountered two problems with your earlier patch when we tried to
> exercise code that actually does select() on sockets.  In our earlier
> test it appeared that the threads deadlocked and the deadlock condition
> was not detected.  I think this is more than just bad luck because the
> problem was completely reproducible.  Also, just a short while ago when
> we exercised this code again, instead of a deadlock, it threw a "Bus
> Error":
> 
> A:002000> ruby newfiles.new DYMA
> newfiles.new:128: [BUG] Bus Error
> ruby 1.8.2 (2004-12-16) [alpha-vms]
> 
> The stack dump (edited) includes these relevant lines:
> 
>  RUBYSHR  VMS  rb_vms_select            13135 0000000000001064
> 000000000013EF54

Could you tell what line in the source?


* defines.h: Change path of vms.h

* dln.c (dln_load): Modify to call lib$find_image_symbol for VMS.

* ext/socket/getaddrinfo.c, ext/socket/socket.c: Port socket library
  to VMS.

* vms/config.h: Configuration file for OpenVMS port.


Index: defines.h
===================================================================
RCS file: /cvs/ruby/src/ruby/defines.h,v
retrieving revision 1.42
diff -U2 -p -r1.42 defines.h
--- defines.h	14 May 2005 14:57:01 -0000	1.42
+++ defines.h	27 May 2005 06:02:00 -0000
@@ -185,5 +185,5 @@ void xfree _((void*));
 
 #if defined(__VMS)
-#include "vms/vms.h"
+#include "vms.h"
 #endif
 
Index: dln.c
===================================================================
RCS file: /cvs/ruby/src/ruby/dln.c,v
retrieving revision 1.64
diff -U2 -p -r1.64 dln.c
--- dln.c	20 Apr 2005 14:22:57 -0000	1.64
+++ dln.c	27 May 2005 06:02:00 -0000
@@ -1261,4 +1261,17 @@ aix_loaderror(const char *pathname)
 #endif /* NO_DLN_LOAD */
 
+#if defined(__VMS)
+#include <starlet.h>
+#include <rms.h>
+#include <stsdef.h>
+#include <unixlib.h>
+#include <descrip.h>
+#include <lib$routines.h>
+
+static char *vms_filespec;
+static int vms_fileact(char *filespec, int type);
+static long vms_fisexh(long *sigarr, long *mecarr);
+#endif
+
 void*
 dln_load(file)
@@ -1565,7 +1578,14 @@ dln_load(file)
 #define DLN_DEFINED
     {
-	void *handle, (*init_fct)();
+	long status;
+	void (*init_fct)();
 	char *fname, *p1, *p2;
 
+	$DESCRIPTOR(fname_d, "");
+	$DESCRIPTOR(image_d, "");
+	$DESCRIPTOR(buf_d, "");
+
+	decc$to_vms(file, vms_fileact, 0, 0);
+
 	fname = (char *)__alloca(strlen(file)+1);
 	strcpy(fname,file);
@@ -1575,17 +1595,33 @@ dln_load(file)
 	    *p2 = '\0';
 
-	if ((handle = (void*)dlopen(fname, 0)) == NULL) {
+	fname_d.dsc$w_length  = strlen(fname);
+	fname_d.dsc$a_pointer = fname;
+	image_d.dsc$w_length  = strlen(vms_filespec);
+	image_d.dsc$a_pointer = vms_filespec;
+	buf_d.dsc$w_length    = strlen(buf);
+	buf_d.dsc$a_pointer   = buf;
+
+	lib$establish(vms_fisexh);
+
+	status = lib$find_image_symbol (
+		     &fname_d,
+		     &buf_d, 
+		     &init_fct, 
+		     &image_d);
+
+	lib$establish(0);
+
+	if (status == RMS$_FNF) {
 	    error = dln_strerror();
 	    goto failed;
-	}
-
-	if ((init_fct = (void (*)())dlsym(handle, buf)) == NULL) {
+	} else if (!$VMS_STATUS_SUCCESS(status)) {
 	    error = DLN_ERROR();
-	    dlclose(handle);
 	    goto failed;
 	}
+
 	/* Call the init code */
 	(*init_fct)();
-	return handle;
+
+	return 1;
     }
 #endif /* __VMS */
@@ -1830,2 +1866,23 @@ dln_find_1(fname, path, exe_flag)
     }
 }
+
+#if defined(__VMS)
+
+/* action routine for decc$to_vms */
+static int vms_fileact(char *filespec, int type)
+{
+    if (vms_filespec)
+	free(vms_filespec);
+    vms_filespec = malloc(strlen(filespec)+1);
+    strcpy(vms_filespec, filespec);
+    return 1;
+}
+
+/* exception handler for LIB$FIND_IMAGE_SYMBOL */
+static long vms_fisexh(long *sigarr, long *mecarr)
+{
+    sys$unwind(1, 0);
+    return 1;
+}
+
+#endif /* __VMS */
Index: ext/socket/getaddrinfo.c
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/socket/getaddrinfo.c,v
retrieving revision 1.18
diff -U2 -p -r1.18 getaddrinfo.c
--- ext/socket/getaddrinfo.c	20 May 2004 04:34:10 -0000	1.18
+++ ext/socket/getaddrinfo.c	27 May 2005 06:02:00 -0000
@@ -41,5 +41,5 @@
 #include "config.h"
 #include <sys/types.h>
-#ifndef _WIN32
+#if !defined(__WIN32) && !defined(__VMS)
 #include <sys/param.h>
 #if defined(__BEOS__)
@@ -63,4 +63,9 @@
 #endif
 #include <unistd.h>
+#elif defined(__VMS )
+#include <socket.h>
+#include <inet.h>
+#include <in.h>
+#include <netdb.h>
 #else
 #include <winsock2.h>
Index: ext/socket/socket.c
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/socket/socket.c,v
retrieving revision 1.144
diff -U2 -p -r1.144 socket.c
--- ext/socket/socket.c	9 Mar 2005 09:29:51 -0000	1.144
+++ ext/socket/socket.c	27 May 2005 06:02:00 -0000
@@ -71,4 +71,8 @@
 #include "sockport.h"
 
+#if defined(__vms)
+#include <tcp.h>
+#endif
+
 static int do_not_reverse_lookup = 0;
 #define FMODE_NOREVLOOKUP 0x100
@@ -2023,5 +2027,5 @@ sock_s_socketpair(klass, domain, type, p
     VALUE klass, domain, type, protocol;
 {
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__EMX__) && !defined(__QNXNTO__)
+#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__EMX__) && !defined(__QNXNTO__) && !defined(__VMS)
     int d, t, sp[2];
 
Index: vms/config.h
===================================================================
RCS file: /cvs/ruby/src/ruby/vms/config.h,v
retrieving revision 1.2
diff -U2 -p -r1.2 config.h
--- vms/config.h	14 May 2005 14:57:03 -0000	1.2
+++ vms/config.h	14 May 2005 14:57:51 -0000
@@ -1,123 +1,103 @@
-#define HAVE_ACOSH 1
-/* #define HAVE_ALLOCA_H 1 */
-/* #define HAVE_CHROOT 1 */
-#define HAVE_COSH 1
-/* #define HAVE_CRYPT 1 */
-#define HAVE_DAYLIGHT 1
-#define HAVE_DECL_SYS_NERR 1
-#define HAVE_DIRENT_H 1
-#define HAVE_DLOPEN 1
-#define HAVE_DUP2 1
-/* #define HAVE_FCHMOD 1 */
-#define HAVE_FCNTL 1
-#define HAVE_FCNTL_H 1
-#define HAVE_FINITE 1
-#define HAVE_FLOCK 1
-#define HAVE_FMOD 1
-#define HAVE_FREXP 1
-/* #define HAVE_FSEEKO 1 */
-#define HAVE_FSYNC 1
-/* #define HAVE_FTELLO 1 */
-#define HAVE_GETCWD 1
-/* #define HAVE_GETPGID 1 xxxx */
-#define HAVE_GETPGRP 1
-/* #define HAVE_GETPRIORITY 1 */
-/* #define HAVE_GETRLIMIT 1 */
-#define HAVE_PID_T 1
-#define HAVE_GID_T 1
-#define HAVE_UID_T 1
-#define HAVE_HYPOT 1
-#define HAVE_ISASCII 1
-/* #define HAVE_ISINF 1 */
-#define HAVE_ISNAN 1
-/* #define HAVE_LCHMOD 1 */
-/* #define HAVE_LCHOWN 1 */
-#define HAVE_LONG_LONG 1 
-/* #define HAVE_LSTAT 1 */
-#define HAVE_MEMCMP 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MKDIR 1
-#define HAVE_MKTIME 1
-#define HAVE_MODF 1
-#define HAVE_OFF_T 1
-#define HAVE_PAUSE 1
+/* config.h for OpenVMS */
+
+#ifndef VMS_RUBY_STREAM
+#define VMS_RUBY_STREAM "018"
+#endif
+
 /* #define HAVE_PROTOTYPES 1 */
-/* #define HAVE_PWD_H 1 */
-/* #define HAVE_READLINK 1 */
-#define HAVE_SEEKDIR 1
-/* #define HAVE_SETITIMER 1 */
-/* #define HAVE_SETPGID 1 xxxx */
-/* #define HAVE_SETRESGID 1 */
-/* #define HAVE_SETRESUID 1 */
-/* #define HAVE_SETSID 1 xxxx */
-#define HAVE_SIGPROCMASK 1
-#define HAVE_SINH 1
 #define HAVE_STDARG_PROTOTYPES 1
+/* #define HAVE_ATTR_NORETURN 1 */
+/* #define inline __inline */
+#define HAVE_DIRENT_H 1
+#define HAVE_UNISTD_H 1
 #define HAVE_STDLIB_H 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRERROR 1
-#define HAVE_STRFTIME 1
-#define HAVE_STRING_H 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOD 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRUCT_TM_TM_GMTOFF 1
-/* #define HAVE_ST_BLKSIZE 1 */
-/* #define HAVE_ST_BLOCKS 1 */
-#define HAVE_ST_RDEV 1
-/* #define HAVE_SYMLINK 1 */
-/* #define HAVE_SYSCALL 1 */
+#define HAVE_LIMITS_H 1
+
 #define HAVE_SYS_FILE_H 1
-/* #define HAVE_SYS_MKDEV_H 1 */
-/* #define HAVE_SYS_PARAM_H 1 */
-#define HAVE_SYS_RESOURCE_H 1
-/* #define HAVE_SYS_SELECT_H 1 */
-#define HAVE_SYS_TIMES_H 1
+#define HAVE_FCNTL_H 1
+/* #define HAVE_PWD_H 1 */
 #define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TIMES_H 1
+/* #define HAVE_SYS_PARAM_H 1 */
 #define HAVE_SYS_WAIT_H 1
-#define HAVE_TANH 1
-#define HAVE_TELLDIR 1
-/* #define HAVE_TIMEGM 1 */
-#define HAVE_TIMES 1
-#define HAVE_TM_ZONE 1
-#define HAVE_TRUNCATE 1
-#define HAVE_TZNAME 1
-#define HAVE_UNISTD_H 1
-#define HAVE_UTIMES 1
+#define HAVE_STRING_H 1
 #define HAVE_UTIME_H 1
-/* #define HAVE_VSNPRINTF 1 */
-#define HAVE_WAIT4 1
-#define HAVE_WAITPID 1
- #define HAVE__SETJMP 1
-
-#define GETGROUPS_T gid_t
+#define HAVE_MEMORY_H 1
+#define HAVE_PID_T 1
+#define HAVE_GID_T 1
+#define HAVE_UID_T 1
+/* #define HAVE_ST_BLKSIZE 1  */
+#define HAVE_ST_RDEV 1
+/* #define GETGROUPS_T gid_t */
+#define GETGROUPS_T int
 #define RETSIGTYPE void
+/* #define HAVE_ALLOCA 1 */
+/* #define vfork fork */
+#define HAVE_FMOD 1
+#define HAVE_RANDOM 1
+#define HAVE_WAITPID 1
+#define HAVE_GETCWD 1
+#define HAVE_TRUNCATE 1
+/* #define HAVE_CHSIZE 1 */
+#define HAVE_TIMES 1
+/* #define HAVE_UTIMES 1 */
+#define HAVE_FCNTL 1
+/* #define HAVE_SETITIMER 1 */
+/* #define HAVE_GETGROUPS 1 */
+#define HAVE_SIGPROCMASK 1
+#define HAVE_GETLOGIN 1
+#define HAVE_TELLDIR 1
+#define HAVE_SEEKDIR 1
 
 #define RSHIFT(x,y) ((x)>>y)
 #define DEFAULT_KCODE KCODE_EUC
-#define DLEXT ".EXE"
-#define DLEXT2 ""
-#define RUBY_LIB "/RUBY_LIB"
-#define RUBY_SITE_LIB "/RUBY_SYSLIB"
-#define RUBY_SITE_LIB2 "/SYS$SHARE"
-#define RUBY_ARCHLIB ""
-#define RUBY_SITE_ARCHLIB ""
-#define SIZEOF_INT 4
-#define SIZEOF_SHORT 2
-#define SIZEOF_LONG 4
-#define SIZEOF_VOIDP 4
-#define SIZEOF_FLOAT 4
-#define SIZEOF_DOUBLE 8
+#define DLEXT ".exe"
+/* #define DLEXT2 "" */
+
+#define HAVE_STRERROR 1
 
 #if defined(__vax)
-#define RUBY_PLATFORM "vax-vms"
+#define RUBY_PLATFORM     "vax-vms"	/* OpenVMS VAX */
 #elif defined(__alpha)
-#define RUBY_PLATFORM "alpha-vms"
-#elif defined(__ia-64)
-#define RUBY_PLATFORM "ia64-vms"
+#define RUBY_PLATFORM     "alpha-vms"	/* OpenVMS Alpha */
+#elif defined(__ia64)
+#define RUBY_PLATFORM     "ia64-vms"	/* OpenVMS Industry Standard 64 */
 #else
-#define RUBY_PLATFORM "vms"
+#define RUBY_PLATFORM     "unknown-vms"	/* unknown processor */
 #endif
+
+#define RUBY_SITE_LIB2    "/RUBY_LIBROOT/site_ruby/" RUBY_PLATFORM
+#define RUBY_SITE_ARCHLIB "/RUBY_LIBROOT/site_ruby/" VMS_RUBY_STREAM "/" RUBY_PLATFORM
+#define RUBY_SITE_LIB     "/RUBY_LIBROOT/site_ruby"
+#define RUBY_LIB          "/RUBY_LIBROOT/" VMS_RUBY_STREAM
+#define RUBY_ARCHLIB      "/RUBY_LIBROOT/" VMS_RUBY_STREAM "/" RUBY_PLATFORM
+
+#define SIZEOF_INT   4
+#define SIZEOF_SHORT 2
+#define SIZEOF_LONG  4
+#define SIZEOF_VOIDP 4
+#define SIZEOF_FLOAT 4
+#define SIZEOF_DOUBLE 8
+#define SIZEOF_LONG_LONG 8
+
+#define HAVE_MKDIR 	1 /* Dango */
+#define HAVE_SINH 	1 /* Dango */
+#define HAVE_COSH 	1 /* Dango */
+#define HAVE_TANH 	1 /* Dango */
+
+/* function flags for socket ---------------------- */
+
+#define HAVE_GETHOSTNAME 1
+#define HAVE_SENDMSG 1
+#define HAVE_RECVMSG 1
+#define HAVE_GETNAMEINFO 1
+#define HAVE_INET_NTOP 1
+#define HAVE_INET_NTOA 1
+#define HAVE_INET_PTON 1
+#define HAVE_INET_ATON 1
+#define HAVE_GETSERVBYPORT 1
+#define HAVE_UNAME 1
+/*
+#define HAVE_GETHOSTBYNAME2 1
+#define HAVE_GETADDRINFO 1
+*/
Index: vms/vms.h
===================================================================
RCS file: /cvs/ruby/src/ruby/vms/vms.h,v
retrieving revision 1.3
diff -U2 -p -r1.3 vms.h
--- vms/vms.h	26 Dec 2003 01:38:31 -0000	1.3
+++ vms/vms.h	27 May 2005 06:03:22 -0000
@@ -1,2 +1,5 @@
+#ifndef VMSRUBY_VMS_H_INCLUDED
+#define VMSRUBY_VMS_H_INCLUDED
+
 #ifndef __FAST_SETJMP
 #define __FAST_SETJMP	/* use decc$setjmp/decc$longjmp */
@@ -11,3 +14,4 @@ extern int snprintf();
 
 #define LONG_LONG long long
-#define SIZEOF_LONG_LONG sizeof(long long)
+
+#endif


-- 
Nobu Nakada

In This Thread

Prev Next