Hi,

I tried editing V8 to see what I could get working for MINIX.
Thankfully, unless I changed something I shouldn't have, "src/
jsregexp.cc" is no longer an issue for me on MINIX. :)

Sadly, V8 still doesn't work on MINIX 3, and now I have problems with
"src/platform-nullos.cc."

Here are my changes to V8 (svn diff > changes.diff):

---Beginning of Diff.---
Index: tools/utils.py
===================================================================
--- tools/utils.py      (revision 5374)
+++ tools/utils.py      (working copy)
@@ -59,6 +59,8 @@
     return 'openbsd'
   elif id == 'SunOS':
     return 'solaris'
+  elif id == 'Minix':
+    return 'minix'
   else:
     return None

Index: src/SConscript
===================================================================
--- src/SConscript      (revision 5374)
+++ src/SConscript      (working copy)
@@ -199,6 +199,7 @@
   'os:freebsd': ['platform-freebsd.cc', 'platform-posix.cc'],
   'os:openbsd': ['platform-openbsd.cc', 'platform-posix.cc'],
   'os:linux':   ['platform-linux.cc', 'platform-posix.cc'],
+  'os:minix':   ['platform-nullos.cc', 'platform-posix.cc'],
   'os:android': ['platform-linux.cc', 'platform-posix.cc'],
   'os:macos':   ['platform-macos.cc', 'platform-posix.cc'],
   'os:solaris': ['platform-solaris.cc', 'platform-posix.cc'],
@@ -218,6 +219,9 @@
   'os:linux': [
     'd8-posix.cc'
   ],
+  'os:minix': [
+    'd8-posix.cc'
+  ],
   'os:macos': [
     'd8-posix.cc'
   ],
@@ -270,6 +274,11 @@

 def ConfigureObjectFiles():
   env = Environment()
+
+  #minix
+  env.Replace(CC = '/usr/gnu/bin/gcc')
+  env.Replace(CXX = '/usr/gnu/bin/g++')
+
   env.Replace(**context.flags['v8'])
   context.ApplyEnvOverrides(env)
   env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C)
Index: src/jsregexp.cc
===================================================================
--- src/jsregexp.cc     (revision 5374)
+++ src/jsregexp.cc     (working copy)
@@ -384,7 +384,7 @@
     Handle<JSRegExp> regexp,
     Handle<String> subject,
     int index,
-    Vector<int32_t> output) {
+    Vector<int> output) {
   Handle<FixedArray> irregexp(FixedArray::cast(regexp->data()));

   ASSERT(index >= 0);
@@ -480,8 +480,8 @@
   OffsetsVector registers(required_registers);

   IrregexpResult res = RegExpImpl::IrregexpExecOnce(
-      jsregexp, subject, previous_index,
Vector<int32_t>(registers.vector(),
-
registers.length()));
+      jsregexp, subject, previous_index,
Vector<int>(registers.vector(),
+
registers.length()));
   if (res == RE_SUCCESS) {
     int capture_register_count =
         (IrregexpNumberOfCaptures(FixedArray::cast(jsregexp->data()))
+ 1) * 2;
Index: src/jsregexp.h
===================================================================
--- src/jsregexp.h      (revision 5374)
+++ src/jsregexp.h      (working copy)
@@ -114,7 +114,7 @@
   static IrregexpResult IrregexpExecOnce(Handle<JSRegExp> regexp,
                                          Handle<String> subject,
                                          int index,
-                                         Vector<int32_t> registers);
+                                         Vector<int> registers);

   // Execute an Irregexp bytecode pattern.
   // On a successful match, the result is a JSArray containing
Index: src/dtoa-config.c
===================================================================
--- src/dtoa-config.c   (revision 5374)
+++ src/dtoa-config.c   (working copy)
@@ -39,7 +39,7 @@

 #if !(defined(__APPLE__) && defined(__MACH__)) && \
     !defined(WIN32) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
&& \
-    !defined(__sun)
+    !defined(__sun) && !defined(_MINIX)
 #include <endian.h>
 #endif
 #include <math.h>
@@ -49,6 +49,7 @@
  * emulation is used, even if the byte order is little endian */
 #if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) &&
\
     !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sun)
&& \
+    !defined(_MINIX) && \
     __FLOAT_WORD_ORDER == __BIG_ENDIAN
 #define  IEEE_MC68k
 #else
@@ -57,7 +58,7 @@

 #define __MATH_H__
 #if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__)
|| \
-    defined(__OpenBSD__) || defined(__sun)
+    defined(__OpenBSD__) || defined(__sun) || defined(_MINIX)
 /* stdlib.h on FreeBSD and Apple's 10.5 and later SDKs will mangle
the
  * name of strtod.  If it's included after strtod is redefined as
  * gay_strtod, it will mangle the name of gay_strtod, which is
Index: SConstruct
===================================================================
--- SConstruct  (revision 5374)
+++ SConstruct  (working copy)
@@ -130,7 +130,7 @@
     },
     'visibility:hidden': {
       # Use visibility=default to disable this.
-      'CXXFLAGS':     ['-fvisibility=hidden']
+      #minix: 'CXXFLAGS':     ['-fvisibility=hidden']
     },
     'mode:debug': {
       'CCFLAGS':      ['-g', '-O0'],
@@ -140,8 +140,11 @@
       }
     },
     'mode:release': {
-      'CCFLAGS':      ['-O3', '-fomit-frame-pointer', '-fdata-
sections',
-                       '-ffunction-sections'],
+      'CCFLAGS':      ['-O3', '-fomit-frame-pointer',
+                       #MINIX 3: Non-ELF
+                       #'-fdata-sections',
+                       #'-ffunction-sections'
+                      ],
       'os:android': {
         'CCFLAGS':    ['-mthumb', '-Os'],
         'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
@@ -154,6 +157,17 @@
         'LIBS': ['pthread']
       }
     },
+    'os:minix': {
+      'CCFLAGS':      [
+                        '-ansi',
+                        '-Wno-char-subscripts',
+                        '-fno-strict-aliasing'
+                      ] + GCC_EXTRA_CCFLAGS,
+      'library:shared': {
+        'CPPDEFINES': ['V8_SHARED'],
+        'LIBS': ['pthread']
+      }
+    },
     'os:macos': {
       'CCFLAGS':      ['-ansi', '-mmacosx-version-min=10.4'],
       'library:shared': {
@@ -308,6 +322,9 @@
         }
       }
     },
+    'os:minix': {
+      'WARNINGFLAGS': ['-pedantic']
+    },
     'os:macos': {
       'WARNINGFLAGS': ['-pedantic']
     },
@@ -344,6 +361,9 @@
     'os:linux': {
       'LIBS': ['pthread'],
     },
+    'os:minix': {
+      'LIBS': ['pthread'],
+    },
     'os:macos': {
       'LIBS': ['pthread'],
     },
@@ -396,6 +416,9 @@
     'os:linux': {
       'LIBS':         ['pthread'],
     },
+    'os:minix': {
+      'LIBS':         ['pthread'],
+    },
     'os:macos': {
       'LIBS':         ['pthread'],
     },
@@ -460,6 +483,9 @@
     'os:linux': {
       'LIBS':         ['pthread'],
     },
+    'os:minix': {
+      'LIBS':         ['pthread'],
+    },
     'os:macos': {
       'LIBS':         ['pthread'],
     },
@@ -599,6 +625,9 @@
     'os:linux': {
       'LIBS': ['pthread'],
     },
+    'os:minix': {
+      'LIBS': ['pthread'],
+    },
     'os:macos': {
       'LIBS': ['pthread'],
     },
@@ -666,7 +695,7 @@
     'help': 'the toolchain to use (' + TOOLCHAIN_GUESS + ')'
   },
   'os': {
-    'values': ['freebsd', 'linux', 'macos', 'win32', 'android',
'openbsd', 'solaris'],
+    'values': ['freebsd', 'linux', 'minix', 'macos', 'win32',
'android', 'openbsd', 'solaris'],
     'default': OS_GUESS,
     'help': 'the os to build for (' + OS_GUESS + ')'
   },

---Ending of Diff.---

Thank you for your help!
pikpik

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to