Discussion:
[Gc] gc / Interix
Eric Lindblad
2016-03-27 18:11:33 UTC
Permalink
To Whom m it May Concern,

I would enquire if you might assess what are the appropriate gc code modifications for porting to the Interix sub-system. I am on SFU 3.5 Interix (32 bit) where I appropriated getopt.h, inttypes.h and stdint.h from SFU 6.0 Interix, but I realise that there also have been released amd64 and ia64 Interix versions. Though presently my interests are gc as a dependency for running the pager/text browser w3m (where a static gc is suitable) if the Microsoft Corp. developers would oblige my request and resuscitate the Interix project - beginning with 8.1 Microsoft no longer enabled new Windows versions for Interix - the gc port (including shared libraries and threading) might be useful for other applications to be run under SFU/SUA Interix.

I use WeirdX (http://www.jcraft.com/weirdx/) as a X Server with a tab window manager (twm).

Ohara for gc6.4.tar.gz on the Japanese webpage at http://air.s.kanazawa-u.ac.jp/~ohara/interix.html
in his "gc_interix.diff" (./configure --disable-threads --enable-cplusplus) has the following code:

# $OpenXM: OpenXM_contrib2/asir2000/gc_interix.diff,v 1.1 2004/02/27 18:32:21 ohara Exp $
--- include/private/gc_priv.h.orig Tue Jun 24 14:11:42 2003
+++ include/private/gc_priv.h Thu Feb 26 08:10:31 2004
@@ -19,6 +19,10 @@
# ifndef GC_PRIVATE_H
# define GC_PRIVATE_H

+#if defined(__INTERIX)
+#define __CYGWIN__
+#endif
+
#if defined(mips) && defined(SYSTYPE_BSD) && defined(sony_news)
/* sony RISC NEWS, NEWSOS 4 */
# define BSD_TIME

Where if one modifies include/private/gcconfig.h, it being obvious to add this '__INTERIX' clause

# if defined(__INTERIX)
# define I386
# define INTERIX
# define mach_type_known
# endif

which attends to the error message "include/private/gcconfig.h:456: error: parse error before '--' token", on gc6.4.tar.gz, and, on newer versions, e.g., gc-7.2d.tar.gz, to the returned error message "The collector has not been ported to this machine/OS combination.", for gc-6.8.tar.gz Martin Koeppe (http://www.debian-interix.net/debian-interix/pool/unreleased35/main/libg/libgc/) has also this code modification for include/private/gcconfig.h,

# undef STACK_GRAN
# define STACK_GRAN 0x10000
# define HEURISTIC1
+# ifdef INTERIX
+# define OS_TYPE "INTERIX"
+ extern int _data_start__[];
+ extern int _bss_end__[];
+# define DATASTART ((ptr_t) _data_start__)
+# define DATAEND ((ptr_t) _bss_end__)
+# define STACKBOTTOM ({ptr_t rv; \
+ __asm __volatile ("movl %%fs:4,%%eax" \
+ :"=a"(rv)); rv;})
+# define USE_MMAP
+# define USE_MMAP_ANON
# endif
# ifdef OS2
# define OS_TYPE "OS2"

and he adds this in configure.in.

AC_DEFINE(GC_AIX_THREADS)
AC_DEFINE(_REENTRANT)
;;
+ *-*-interix*)
+ AC_DEFINE(_REENTRANT)
+ ;;
*-*-hpux11*)

Sincerely,
Eric Lindblad
http://www.nurmi-labs.blogspot.com

P.S. For some code compilation under Interix
one also adds the flag "-D_ALL_SOURCE".

Loading...