You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(56) |
Sep
(40) |
Oct
(30) |
Nov
(144) |
Dec
(23) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(41) |
Feb
(29) |
Mar
(31) |
Apr
(39) |
May
(193) |
Jun
(45) |
Jul
(19) |
Aug
(3) |
Sep
(23) |
Oct
(83) |
Nov
(92) |
Dec
(123) |
| 2007 |
Jan
(90) |
Feb
(267) |
Mar
(120) |
Apr
(51) |
May
(40) |
Jun
(121) |
Jul
(109) |
Aug
(173) |
Sep
(77) |
Oct
(52) |
Nov
(121) |
Dec
(62) |
| 2008 |
Jan
(76) |
Feb
(53) |
Mar
(98) |
Apr
(87) |
May
(26) |
Jun
(27) |
Jul
(23) |
Aug
(136) |
Sep
(79) |
Oct
(68) |
Nov
(29) |
Dec
(14) |
| 2009 |
Jan
(7) |
Feb
(2) |
Mar
(11) |
Apr
(75) |
May
(1) |
Jun
(95) |
Jul
(19) |
Aug
(4) |
Sep
(8) |
Oct
(93) |
Nov
(43) |
Dec
(21) |
| 2010 |
Jan
(20) |
Feb
(23) |
Mar
(18) |
Apr
(6) |
May
(20) |
Jun
(23) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(2) |
Feb
(6) |
Mar
(15) |
Apr
(5) |
May
(9) |
Jun
(14) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(17) |
Jul
(37) |
Aug
|
Sep
(1) |
Oct
(6) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
(7) |
Jun
(11) |
Jul
(8) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(2) |
Dec
(4) |
| 2015 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(9) |
Jul
(1) |
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(7) |
May
(2) |
Jun
(2) |
Jul
(5) |
Aug
(1) |
Sep
(2) |
Oct
(17) |
Nov
(4) |
Dec
(7) |
| 2018 |
Jan
(5) |
Feb
(14) |
Mar
(2) |
Apr
(5) |
May
(2) |
Jun
(5) |
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(5) |
Dec
|
| 2019 |
Jan
(4) |
Feb
(2) |
Mar
(3) |
Apr
(1) |
May
(8) |
Jun
(14) |
Jul
(2) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(15) |
Dec
(2) |
| 2020 |
Jan
(10) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(9) |
Jun
(4) |
Jul
(16) |
Aug
(10) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
|
| 2021 |
Jan
(11) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(6) |
Nov
(4) |
Dec
(4) |
| 2022 |
Jan
(4) |
Feb
(2) |
Mar
(2) |
Apr
|
May
(6) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(5) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(13) |
Dec
|
| 2024 |
Jan
(1) |
Feb
|
Mar
(5) |
Apr
|
May
(10) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(14) |
| 2025 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
|
From: Matthew F. <fl...@ml...> - 2006-05-27 07:54:14
|
GMP header installed in /usr/pkg/include on NetBSD 3.0. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-27 12:54:15 UTC (rev 4612) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-27 14:54:14 UTC (rev 4613) @@ -69,6 +69,10 @@ FLAGS += -I/usr/local/include endif +ifeq ($(TARGET_OS), netbsd) +FLAGS += -I/usr/pkg/include +endif + ifeq ($(TARGET_OS), openbsd) FLAGS += -I/usr/local/include endif |
|
From: Matthew F. <fl...@ml...> - 2006-05-27 05:54:15
|
gcc 4.1 on x86 ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-27 12:39:06 UTC (rev 4611) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-27 12:54:15 UTC (rev 4612) @@ -40,6 +40,9 @@ OPTWARNFLAGS += -Winline endif endif +ifeq ($(findstring $(GCC_VERSION), 4.1),$(GCC_VERSION)) +OPTWARNFLAGS += -Winline +endif DEBUGFLAGS += -gstabs+ endif |
|
From: Matthew F. <fl...@ml...> - 2006-05-27 05:39:07
|
Work around missing RLIMIT_AS. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit-consts.c ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit-consts.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit-consts.c 2006-05-26 17:29:11 UTC (rev 4610) +++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Rlimit/rlimit-consts.c 2006-05-27 12:39:06 UTC (rev 4611) @@ -1,6 +1,12 @@ #include "platform.h" +#if (defined (RLIMIT_AS)) const C_Int_t MLton_Rlimit_AS = RLIMIT_AS; +#elif (defined (RLIMIT_DATA)) +const C_Int_t MLton_Rlimit_AS = RLIMIT_DATA; +#else +#error MLton_Rlimit_AS not defined +#endif const C_Int_t MLton_Rlimit_CORE = RLIMIT_CORE; const C_Int_t MLton_Rlimit_CPU = RLIMIT_CPU; const C_Int_t MLton_Rlimit_DATA = RLIMIT_DATA; |
|
From: Wesley T. <we...@ml...> - 2006-05-26 10:29:16
|
Support using MLton in a path with spaces. Changed -cc-opt to not separate on spaces, -cc-opts will do this still. Ditto for the rest of these options.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/bin/mlton-script
U mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun
U mlton/branches/on-20050822-x86_64-branch/package/mingw/mlton.bat
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/bin/mlton-script
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bin/mlton-script 2006-05-26 03:54:30 UTC (rev 4609)
+++ mlton/branches/on-20050822-x86_64-branch/bin/mlton-script 2006-05-26 17:29:11 UTC (rev 4610)
@@ -72,43 +72,39 @@
fi
doit "$lib" \
- -cc "$gcc" \
- -cc-opt "-I$lib/include" \
- -cc-opt '-O1' \
- -cc-opt '-fno-strict-aliasing -fomit-frame-pointer -w' \
- -mlb-path-map "$lib/mlb-path-map" \
- -target-as-opt amd64 \
- '-m32
- -mtune=opteron' \
- -target-cc-opt amd64 \
- '-m32
- -mtune=opteron' \
- -target-cc-opt darwin '-I/sw/include' \
- -target-cc-opt freebsd '-I/usr/local/include' \
- -target-cc-opt solaris \
+ -cc "$gcc" \
+ -cc-opt "-I$lib/include" \
+ -cc-opt '-O1' \
+ -cc-opts '-fno-strict-aliasing -fomit-frame-pointer -w' \
+ -mlb-path-map "$lib/mlb-path-map" \
+ -target-as-opts amd64 '-m32 -mtune=opteron' \
+ -target-cc-opts amd64 '-m32 -mtune=opteron' \
+ -target-cc-opts darwin '-I/sw/include' \
+ -target-cc-opts freebsd '-I/usr/local/include' \
+ -target-cc-opts solaris \
'-Wa,-xarch=v8plusa
- -mcpu=ultrasparc' \
- -target-cc-opt sparc '-mcpu=v8 -m32' \
- -target-cc-opt x86 \
+ -mcpu=ultrasparc' \
+ -target-cc-opts sparc '-mcpu=v8 -m32' \
+ -target-cc-opts x86 \
'-fno-strength-reduce
-fschedule-insns
-fschedule-insns2
-malign-functions=5
-malign-jumps=2
- -malign-loops=2' \
- -target-link-opt aix '-lgmp' \
- -target-link-opt amd64 '-m32' \
- -target-link-opt cygwin '-lgmp' \
- -target-link-opt darwin "$darwinLinkOpts -lgmp" \
- -target-link-opt freebsd '-L/usr/local/lib/ -lgmp' \
- -target-link-opt hpux '-lgmp' \
- -target-link-opt linux '-lgmp' \
- -target-link-opt mingw \
- '-lgmp -lws2_32 -lkernel32 -lpsapi -lnetapi32' \
- -target-link-opt netbsd \
- '-Wl,-R/usr/pkg/lib -L/usr/local/lib/ -lgmp' \
- -target-link-opt openbsd '-L/usr/local/lib/ -lgmp' \
- -target-link-opt solaris '-lgmp -lnsl -lsocket -lrt' \
- -link-opt '-lgdtoa -lm' \
- -profile-exclude '<basis>' \
+ -malign-loops=2' \
+ -target-link-opts aix '-lgmp' \
+ -target-link-opts amd64 '-m32' \
+ -target-link-opts cygwin '-lgmp' \
+ -target-link-opts darwin "$darwinLinkOpts -lgmp" \
+ -target-link-opts freebsd '-L/usr/local/lib/ -lgmp' \
+ -target-link-opts hpux '-lgmp' \
+ -target-link-opts linux '-lgmp' \
+ -target-link-opts mingw \
+ '-lgmp -lws2_32 -lkernel32 -lpsapi -lnetapi32' \
+ -target-link-opts netbsd \
+ '-Wl,-R/usr/pkg/lib -L/usr/local/lib/ -lgmp' \
+ -target-link-opts openbsd '-L/usr/local/lib/ -lgmp' \
+ -target-link-opts solaris '-lgmp -lnsl -lsocket -lrt' \
+ -link-opts '-lgdtoa -lm' \
+ -profile-exclude '<basis>' \
"$@"
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun 2006-05-26 03:54:30 UTC (rev 4609)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun 2006-05-26 17:29:11 UTC (rev 4610)
@@ -129,8 +129,12 @@
| Control.Elaborate.Other =>
usage (concat ["invalid -", flag, " flag: ", s])
open Control Popt
- fun push r = SpaceString (fn s => List.push (r, s))
datatype z = datatype MLton.Platform.Arch.t
+ fun splitString f opts =
+ List.foreach (String.tokens (opts, Char.isSpace), f)
+ fun splitString2 f (target, opts) =
+ List.foreach (String.tokens (opts, Char.isSpace),
+ fn opt => f (target, opt))
in
List.map
(
@@ -150,6 +154,10 @@
(Normal, "as-opt", " <opt>", "pass option to assembler",
SpaceString (fn s =>
List.push (asOpts, {opt = s, pred = OptPred.Yes}))),
+ (Expert, "as-opts", " <opts>", "pass options to assembler",
+ SpaceString
+ (splitString (fn s =>
+ List.push (asOpts, {opt = s, pred = OptPred.Yes})))),
(Expert, "build-constants", " {false|true}",
"output C file that prints basis constants",
boolRef buildConstants),
@@ -158,6 +166,10 @@
(Normal, "cc-opt", " <opt>", "pass option to C compiler",
SpaceString (fn s =>
List.push (ccOpts, {opt = s, pred = OptPred.Yes}))),
+ (Expert, "cc-opts", " <opts>", "pass options to C compiler",
+ SpaceString
+ (splitString (fn s =>
+ List.push (ccOpts, {opt = s, pred = OptPred.Yes})))),
(Expert, "coalesce", " <n>", "coalesce chunk size for C codegen",
Int (fn n => coalesce := SOME n)),
(Normal, "codegen",
@@ -289,6 +301,10 @@
(Normal, "link-opt", " <opt>", "pass option to linker",
SpaceString (fn s =>
List.push (linkOpts, {opt = s, pred = OptPred.Yes}))),
+ (Expert, "link-opts", " <opts>", "pass options to linker",
+ SpaceString
+ (splitString (fn s =>
+ List.push (linkOpts, {opt = s, pred = OptPred.Yes})))),
(Expert, "loop-passes", " <n>", "loop optimization passes (1)",
Int
(fn i =>
@@ -428,7 +444,7 @@
(Normal, "profile-stack", " {false|true}", "profile the stack",
boolRef profileStack),
(Normal, "runtime", " <arg>", "pass arg to runtime via @MLton",
- push runtimeArgs),
+ SpaceString (fn s => List.push (runtimeArgs, s))),
(Expert, "show-anns", " {false|true}", "show annotations",
boolRef showAnns),
(Normal, "show-basis", " <file>", "write out the final basis environment",
@@ -481,14 +497,29 @@
(SpaceString2
(fn (target, opt) =>
List.push (asOpts, {opt = opt, pred = OptPred.Target target})))),
+ (Expert, "target-as-opts", " <target> <opts>", "target-dependent assembler options",
+ (SpaceString2
+ (splitString2
+ (fn (target, opt) =>
+ List.push (asOpts, {opt = opt, pred = OptPred.Target target}))))),
(Normal, "target-cc-opt", " <target> <opt>", "target-dependent C compiler option",
(SpaceString2
(fn (target, opt) =>
List.push (ccOpts, {opt = opt, pred = OptPred.Target target})))),
+ (Expert, "target-cc-opts", " <target> <opts>", "target-dependent C compiler options",
+ (SpaceString2
+ (splitString2
+ (fn (target, opt) =>
+ List.push (ccOpts, {opt = opt, pred = OptPred.Target target}))))),
(Normal, "target-link-opt", " <target> <opt>", "target-dependent linker option",
(SpaceString2
(fn (target, opt) =>
List.push (linkOpts, {opt = opt, pred = OptPred.Target target})))),
+ (Expert, "target-link-opts", " <target> <opts>", "target-dependent linker options",
+ (SpaceString2
+ (splitString2
+ (fn (target, opt) =>
+ List.push (linkOpts, {opt = opt, pred = OptPred.Target target}))))),
(Expert, #1 trace, " name1,...", "trace compiler internals", #2 trace),
(Expert, "type-check", " {false|true}", "type check ILs",
boolRef typeCheck),
@@ -592,19 +623,18 @@
fun tokenize l =
String.tokens (concat (List.separate (l, " ")), Char.isSpace)
fun addTargetOpts opts =
- tokenize
- (List.fold
- (!opts, [], fn ({opt, pred}, ac) =>
- if (case pred of
- OptPred.Target s =>
- let
- val s = String.toLower s
- in
- s = archStr orelse s = OSStr
- end
- | OptPred.Yes => true)
- then opt :: ac
- else ac))
+ List.fold
+ (!opts, [], fn ({opt, pred}, ac) =>
+ if (case pred of
+ OptPred.Target s =>
+ let
+ val s = String.toLower s
+ in
+ s = archStr orelse s = OSStr
+ end
+ | OptPred.Yes => true)
+ then opt :: ac
+ else ac)
val asOpts = addTargetOpts asOpts
val ccOpts = addTargetOpts ccOpts
val linkOpts =
@@ -788,13 +818,13 @@
trace (Top, "Link")
(fn () =>
System.system
- (gcc,
- List.concat
- [targetOpts,
- ["-o", output],
- if !debug then gccDebug else [],
- inputs,
- linkOpts]))
+ (gcc,
+ List.concat
+ [targetOpts,
+ ["-o", output],
+ if !debug then gccDebug else [],
+ inputs,
+ linkOpts]))
()
(* gcc on Cygwin appends .exe, which I don't want, so
* move the output file to it's rightful place.
@@ -833,39 +863,34 @@
else temp ".o"
fun compileC (c: Counter.t, input: File.t): File.t =
let
- val (debugSwitches, switches) =
- (gccDebug @ ["-DASSERT=1"], ccOpts)
- val switches =
- if !debug
- then debugSwitches @ switches
- else switches
- val switches =
- targetOpts @ ("-std=gnu99" :: "-c" :: switches)
+ val debugSwitches = gccDebug @ ["-DASSERT=1"]
val output = mkOutputO (c, input)
val _ =
System.system
- (gcc,
- List.concat [switches,
- ["-o", output, input]])
+ (gcc,
+ List.concat
+ [targetOpts,
+ [ "-std=gnu99", "-c" ],
+ if !debug then debugSwitches else [],
+ ccOpts,
+ ["-o", output],
+ [input]])
in
output
end
fun compileS (c: Counter.t, input: File.t): File.t =
let
- val (debugSwitches, switches) =
- ([asDebug], asOpts)
- val switches =
- if !debug
- then debugSwitches @ switches
- else switches
- val switches =
- targetOpts @ ("-c" :: switches)
val output = mkOutputO (c, input)
val _ =
System.system
(gcc,
- List.concat [switches,
- ["-o", output, input]])
+ List.concat
+ [targetOpts,
+ ["-c"],
+ if !debug then [asDebug] else [],
+ asOpts,
+ ["-o", output],
+ [input]])
in
output
end
Modified: mlton/branches/on-20050822-x86_64-branch/package/mingw/mlton.bat
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/package/mingw/mlton.bat 2006-05-26 03:54:30 UTC (rev 4609)
+++ mlton/branches/on-20050822-x86_64-branch/package/mingw/mlton.bat 2006-05-26 17:29:11 UTC (rev 4610)
@@ -26,13 +26,13 @@
set world=%lib%\world.mlton
set mlton=%lib%\mlton-compile.exe
-set ccopts=-I%lib%\include -O1 -fno-strict-aliasing -fomit-frame-pointer -w
+set ccopts=-O1 -fno-strict-aliasing -fomit-frame-pointer -w
set ccopts=%ccopts% -fno-strength-reduce -fschedule-insns -fschedule-insns2
set ccopts=%ccopts% -malign-functions=5 -malign-jumps=2 -malign-loops=2
set linkopts=-lgdtoa -lm
set linkopts=%linkopts% -lgmp -lws2_32 -lkernel32 -lpsapi -lnetapi32
-%mlton% @MLton load-world %world% ram-slop 0.5 -- %lib% -cc %cc% -cc-opt "%ccopts%" -mlb-path-map %lib%\mlb-path-map -link-opt "%linkopts%" %*
+%mlton% @MLton load-world %world% ram-slop 0.5 -- %lib% -cc %cc% -cc-opt "-I%lib%\include" -cc-opts "%ccopts%" -mlb-path-map "%lib%\mlb-path-map" -link-opts "%linkopts%" %*
goto :eof
:setdir
|
|
From: Wesley T. <we...@ml...> - 2006-05-25 20:54:31
|
This method has a new name
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c 2006-05-26 03:28:08 UTC (rev 4608)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c 2006-05-26 03:54:30 UTC (rev 4609)
@@ -33,7 +33,7 @@
return (HANDLE)t;
}
-int getpagesize (void) {
+size_t GC_pageSize (void) {
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
return sysinfo.dwPageSize;
|
|
From: Wesley T. <we...@ml...> - 2006-05-25 20:28:08
|
avoid warning about #if of undefined value ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h 2006-05-26 03:23:45 UTC (rev 4607) +++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h 2006-05-26 03:28:08 UTC (rev 4608) @@ -20,6 +20,8 @@ // classifies subnormals as normals. So, we disable it here, which causes the // runtime to use our own version. #define HAS_FPCLASSIFY FALSE +#define HAS_FPCLASSIFY32 FALSE +#define HAS_FPCLASSIFY64 FALSE #define HAS_MSG_DONTWAIT TRUE #define HAS_REMAP FALSE #define HAS_SIGALTSTACK FALSE |
|
From: Wesley T. <we...@ml...> - 2006-05-25 20:23:46
|
There is no uint, only unsigned int
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/include/x86-main.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/include/x86-main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/x86-main.h 2006-05-26 03:08:38 UTC (rev 4606)
+++ mlton/branches/on-20050822-x86_64-branch/include/x86-main.h 2006-05-26 03:23:45 UTC (rev 4607)
@@ -66,7 +66,7 @@
Pointer lc_stackP; \
\
if (DEBUG_X86CODEGEN) \
- fprintf (stderr, "MLton_jumpToSML(0x%08x) starting\n", (uint)jump); \
+ fprintf (stderr, "MLton_jumpToSML(0x%08x) starting\n", (unsigned int)jump); \
lc_stackP = c_stackP; \
if (reserveEsp) \
__asm__ __volatile__ \
@@ -82,7 +82,7 @@
); \
c_stackP = lc_stackP; \
if (DEBUG_X86CODEGEN) \
- fprintf (stderr, "MLton_jumpToSML(0x%08x) done\n", (uint)jump); \
+ fprintf (stderr, "MLton_jumpToSML(0x%08x) done\n", (unsigned int)jump); \
return; \
} \
void MLton_callFromC () { \
|
|
From: Wesley T. <we...@ml...> - 2006-05-25 20:08:41
|
All remaining warnings on MinGW are actually things we should fix
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c 2006-05-25 15:45:42 UTC (rev 4605)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c 2006-05-26 03:08:38 UTC (rev 4606)
@@ -12,7 +12,8 @@
return Windows_mmapAnon (start, length);
}
-void GC_release (void *base, size_t length) {
+void GC_release (void *base,
+ __attribute__ ((unused)) size_t length) {
Windows_release (base);
}
@@ -90,10 +91,11 @@
/* MLton.Itimer */
/* ------------------------------------------------- */
-int setitimer (int which,
- const struct itimerval *value,
- struct itimerval *ovalue) {
- // !!! perhaps used code from alarm?
+__attribute__ ((noreturn))
+int setitimer (__attribute__ ((unused)) int which,
+ __attribute__ ((unused)) const struct itimerval *value,
+ __attribute__ ((unused)) struct itimerval *ovalue) {
+ // !!! perhaps use code from alarm?
die ("setitimer not implemented");
}
@@ -162,7 +164,10 @@
/* OS.IO */
/* ------------------------------------------------- */
-int poll (struct pollfd *ufds, unsigned int nfds, int timeout) {
+__attribute__ ((noreturn))
+int poll (__attribute__ ((unused)) struct pollfd *ufds,
+ __attribute__ ((unused)) unsigned int nfds,
+ __attribute__ ((unused)) int timeout) {
die ("poll not implemented");
}
@@ -174,8 +179,10 @@
HANDLE fh, fhmap;
DWORD fileSize, fileSizeHi;
void* pMem = NULL;
-
- fh = (HANDLE)_get_osfhandle (fd);
+ long tmp;
+
+ tmp = _get_osfhandle (fd);
+ fh = (HANDLE)tmp;
fileSize = GetFileSize (fh, &fileSizeHi);
fhmap = CreateFileMapping (fh, NULL, PAGE_READONLY, 0, fileSize, NULL);
if (fhmap) {
@@ -203,19 +210,29 @@
return chdir (fname);
}
-int chown (const char *path, uid_t owner, gid_t group) {
+__attribute__ ((noreturn))
+int chown (__attribute__ ((unused)) const char *path,
+ __attribute__ ((unused)) uid_t owner,
+ __attribute__ ((unused)) gid_t group) {
die ("chown not implemented");
}
-int fchown (int fd, uid_t owner, gid_t group) {
+__attribute__ ((noreturn))
+int fchown (__attribute__ ((unused)) int fd,
+ __attribute__ ((unused)) uid_t owner,
+ __attribute__ ((unused)) gid_t group) {
die ("fchown not implemented");
}
-long fpathconf (int filedes, int name) {
+__attribute__ ((noreturn))
+long fpathconf (__attribute__ ((unused)) int filedes,
+ __attribute__ ((unused)) int name) {
die ("fpathconf not implemented");
}
-int link (const char *oldpath, const char *newpath) {
+__attribute__ ((noreturn))
+int link (__attribute__ ((unused)) const char *oldpath,
+ __attribute__ ((unused)) const char *newpath) {
die ("link not implemented");
}
@@ -228,19 +245,28 @@
return mkdir (pathname, mode);
}
-int mkfifo (const char *pathname, mode_t mode) {
+__attribute__ ((noreturn))
+int mkfifo (__attribute__ ((unused)) const char *pathname,
+ __attribute__ ((unused)) mode_t mode) {
die ("mkfifo not implemented");
}
-long pathconf (const char *path, int name) {
+__attribute__ ((noreturn))
+long pathconf (__attribute__ ((unused)) const char *path,
+ __attribute__ ((unused)) int name) {
die ("pathconf not implemented");
}
-int readlink (const char *path, char *buf, size_t bufsiz) {
+__attribute__ ((noreturn))
+int readlink (__attribute__ ((unused)) const char *path,
+ __attribute__ ((unused)) char *buf,
+ __attribute__ ((unused)) size_t bufsiz) {
die ("readlink not implemented");
}
-int symlink (const char *oldpath, const char *newpath) {
+__attribute__ ((noreturn))
+int symlink (__attribute__ ((unused)) const char *oldpath,
+ __attribute__ ((unused)) const char *newpath) {
die ("symlink not implemented");
}
@@ -262,7 +288,10 @@
/* Posix.IO */
/* ------------------------------------------------- */
-int fcntl (int fd, int cmd, ...) {
+__attribute__ ((noreturn))
+int fcntl (__attribute__ ((unused)) int fd,
+ __attribute__ ((unused)) int cmd,
+ ...) {
die ("fcntl not implemented");
}
@@ -306,33 +335,53 @@
/* Posix.ProcEnv */
/* ------------------------------------------------- */
-char *ctermid (char *s) {
+__attribute__ ((noreturn))
+char *ctermid (__attribute__ ((unused)) char* s) {
die ("*ctermid not implemented");
}
+
+__attribute__ ((noreturn))
gid_t getegid (void) {
die ("getegid not implemented");
}
+
+__attribute__ ((noreturn))
uid_t geteuid (void) {
die ("geteuid not implemented");
}
+
+__attribute__ ((noreturn))
gid_t getgid (void) {
die ("getgid not implemented");
}
-int getgroups (int size, gid_t list[]) {
+
+__attribute__ ((noreturn))
+int getgroups (__attribute__ ((unused)) int size,
+ __attribute__ ((unused)) gid_t list[]) {
die ("getgroups not implemented");
}
+
+__attribute__ ((noreturn))
char *getlogin (void) {
die ("*getlogin not implemented");
}
-pid_t getpgid(pid_t pid) {
+
+__attribute__ ((noreturn))
+pid_t getpgid(__attribute__ ((unused)) pid_t pid) {
die ("getpgid not implemented");
}
+
+__attribute__ ((noreturn))
pid_t getpgrp(void) {
die ("getpgrp not implemented");
}
+
+__attribute__ ((noreturn))
pid_t getppid (void) {
die ("getppid not implemented");
}
+
+__attribute__ ((noreturn))
uid_t getuid (void) {
die ("getuid not implemented");
}
@@ -354,30 +403,45 @@
return 0;
}
-int setgid (gid_t gid) {
+__attribute__ ((noreturn))
+int setgid (__attribute__ ((unused)) gid_t gid) {
die ("setgid not implemented");
}
-int setgroups (size_t size, gid_t *list) {
+__attribute__ ((noreturn))
+int setgroups (__attribute__ ((unused)) size_t size,
+ __attribute__ ((unused)) gid_t *list) {
die ("setgroups not implemented");
}
-int setpgid (pid_t pid, pid_t pgid) {
+__attribute__ ((noreturn))
+int setpgid (__attribute__ ((unused)) pid_t pid,
+ __attribute__ ((unused)) pid_t pgid) {
die ("setpgid not implemented");
}
+
+__attribute__ ((noreturn))
pid_t setsid (void) {
die ("setsid not implemented");
}
-int setuid (uid_t uid) {
+
+__attribute__ ((noreturn))
+int setuid (__attribute__ ((unused)) uid_t uid) {
die ("setuid not implemented");
}
-long sysconf (int name) {
+
+__attribute__ ((noreturn))
+long sysconf (__attribute__ ((unused)) int name) {
die ("sysconf not implemented");
}
-clock_t times (struct tms *buf) {
+
+__attribute__ ((noreturn))
+clock_t times (__attribute__ ((unused)) struct tms *buf) {
die ("times not implemented");
}
-char *ttyname (int desc) {
+
+__attribute__ ((noreturn))
+char *ttyname (__attribute__ ((unused)) int desc) {
die ("*ttyname not implemented");
}
@@ -455,9 +519,10 @@
static LARGE_INTEGER timer_start_val;
-VOID CALLBACK alarm_signalled(HWND window, UINT message,
- UINT_PTR timer_id, DWORD timestamp)
-{
+static VOID CALLBACK alarm_signalled(__attribute__ ((unused)) HWND window,
+ __attribute__ ((unused)) UINT message,
+ __attribute__ ((unused)) UINT_PTR timer_id,
+ __attribute__ ((unused)) DWORD timestamp) {
printf("Timer fired\n");
}
@@ -498,11 +563,15 @@
return remaining;
}
+__attribute__ ((noreturn))
pid_t fork (void) {
die ("fork not implemented");
}
-int kill (pid_t pid, int sig) {
+
+__attribute__ ((noreturn))
+int kill (__attribute__ ((unused)) pid_t pid,
+ __attribute__ ((unused)) int sig) {
die ("kill not implemented");
}
@@ -513,6 +582,7 @@
return 0;
}
+__attribute__ ((noreturn))
int pause (void) {
die ("pause not implemented");
}
@@ -522,11 +592,15 @@
return 0;
}
-pid_t wait (int *status) {
+__attribute__ ((noreturn))
+pid_t wait (__attribute__ ((unused)) int *status) {
die ("wait not implemented");
}
-pid_t waitpid (pid_t pid, int *status, int options) {
+__attribute__ ((noreturn))
+pid_t waitpid (__attribute__ ((unused)) pid_t pid,
+ __attribute__ ((unused)) int *status,
+ __attribute__ ((unused)) int options) {
die ("waitpid not implemented");
}
@@ -633,7 +707,8 @@
return 0;
}
-int sigsuspend (const sigset_t *mask) {
+__attribute__ ((noreturn))
+int sigsuspend (__attribute__ ((unused)) const sigset_t *mask) {
die("sigsuspend is unimplemented, but could be hacked in if needed");
}
@@ -658,15 +733,17 @@
static struct passwd passwd;
-struct group *getgrgid (gid_t gid) {
+__attribute__ ((noreturn))
+struct group *getgrgid (__attribute__ ((unused)) gid_t gid) {
die ("getgrgid not implemented");
}
-struct group *getgrnam (const char *name) {
+__attribute__ ((noreturn))
+struct group *getgrnam (__attribute__ ((unused)) const char *name) {
die ("getgrnam not implemented");
}
-struct passwd *getpwnam (const char *name) {
+struct passwd *getpwnam (__attribute__ ((unused)) const char *name) {
return NULL;
// unless (NERR_Success ==
// NetUserGetInfo (NULL, (LPCWSTR)name, INFO_LEVEL,
@@ -680,7 +757,8 @@
return &passwd;
}
-struct passwd *getpwuid (uid_t uid) {
+__attribute__ ((noreturn))
+struct passwd *getpwuid (__attribute__ ((unused)) uid_t uid) {
die ("getpwuid not implemented");
}
@@ -688,51 +766,72 @@
/* Posix.TTY */
/* ------------------------------------------------- */
-speed_t cfgetispeed (struct termios *termios_p) {
+__attribute__ ((noreturn))
+speed_t cfgetispeed (__attribute__ ((unused)) struct termios *termios_p) {
die ("cfgetispeed not implemented");
}
-speed_t cfgetospeed (struct termios *termios_p) {
+__attribute__ ((noreturn))
+speed_t cfgetospeed (__attribute__ ((unused)) struct termios *termios_p) {
die ("cfgetospeed not implemented");
}
-int cfsetispeed (struct termios *termios_p, speed_t speed) {
+__attribute__ ((noreturn))
+int cfsetispeed (__attribute__ ((unused)) struct termios *termios_p,
+ __attribute__ ((unused)) speed_t speed) {
die ("cfsetispeed not implemented");
}
-int cfsetospeed (struct termios *termios_p, speed_t speed) {
+__attribute__ ((noreturn))
+int cfsetospeed (__attribute__ ((unused)) struct termios *termios_p,
+ __attribute__ ((unused)) speed_t speed) {
die ("cfsetospeed not implemented");
}
-int tcdrain (int fd) {
+__attribute__ ((noreturn))
+int tcdrain (__attribute__ ((unused)) int fd) {
die ("tcdrain not implemented");
}
-int tcflow (int fd, int action) {
+__attribute__ ((noreturn))
+int tcflow (__attribute__ ((unused)) int fd,
+ __attribute__ ((unused)) int action) {
die ("tcflow not implemented");
}
-int tcflush (int fd, int queue_selector) {
+__attribute__ ((noreturn))
+int tcflush (__attribute__ ((unused)) int fd,
+ __attribute__ ((unused)) int queue_selector) {
die ("tcflush not implemented");
}
-int tcgetattr (int fd, struct termios *termios_p) {
+__attribute__ ((noreturn))
+int tcgetattr (__attribute__ ((unused)) int fd,
+ __attribute__ ((unused)) struct termios *termios_p) {
die ("tcgetattr not implemented");
}
-pid_t tcgetpgrp (int fd) {
+__attribute__ ((noreturn))
+pid_t tcgetpgrp (__attribute__ ((unused)) int fd) {
die ("tcgetpgrp not implemented");
}
-int tcsendbreak (int fd, int duration) {
+__attribute__ ((noreturn))
+int tcsendbreak (__attribute__ ((unused)) int fd,
+ __attribute__ ((unused)) int duration) {
die ("tcsendbreak not implemented");
}
-int tcsetattr (int fd, int optional_actions, struct termios *termios_p) {
+__attribute__ ((noreturn))
+int tcsetattr (__attribute__ ((unused)) int fd,
+ __attribute__ ((unused)) int optional_actions,
+ __attribute__ ((unused)) struct termios *termios_p) {
die ("tcsetattr not implemented");
}
-int tcsetpgrp (int fd, pid_t pgrpid) {
+__attribute__ ((noreturn))
+int tcsetpgrp (__attribute__ ((unused)) int fd,
+ __attribute__ ((unused)) pid_t pgrpid) {
die ("tcsetpgrp not implemented");
}
@@ -752,11 +851,18 @@
/* Socket */
/* ------------------------------------------------- */
-int ioctl (int d, int request, ...) {
+__attribute__ ((noreturn))
+int ioctl (__attribute__ ((unused)) int d,
+ __attribute__ ((unused)) int request,
+ ...) {
die ("ioctl not implemented");
}
-int socketpair (int d, int type, int protocol, int sv[2]) {
+__attribute__ ((noreturn))
+int socketpair (__attribute__ ((unused)) int d,
+ __attribute__ ((unused)) int type,
+ __attribute__ ((unused)) int protocol,
+ __attribute__ ((unused)) int sv[2]) {
die ("socketpair not implemented");
}
@@ -782,7 +888,7 @@
void openlog(const char* ident, int opt, int facility) {
logident = ident;
- logopt = logopt;
+ logopt = opt;
logfacility = facility;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h 2006-05-25 15:45:42 UTC (rev 4605)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h 2006-05-26 03:08:38 UTC (rev 4606)
@@ -193,8 +193,9 @@
// Synchronized writes? Safety of any kind? ... and windows?! hell no!
#define O_SYNC 0
-#define S_ISLNK(m) FALSE
-#define S_ISSOCK(m) FALSE
+// Use m to silence unused warnings
+#define S_ISLNK(m) (m?FALSE:FALSE)
+#define S_ISSOCK(m) (m?FALSE:FALSE)
int chown (const char *path, uid_t owner, gid_t group);
int fchmod (int filedes, mode_t mode);
@@ -581,5 +582,3 @@
void openlog(const char* ident, int logopt, int facility);
void closelog(void);
void syslog(int priority, const char* fmt, const char* msg);
-
-extern char **environ; /* for Posix_ProcEnv_environ */
|
|
From: Stephen W. <sw...@ml...> - 2006-05-25 08:45:45
|
Used a temporary to silence the "cast does not match function type"
warning on Cygwin and MinGW.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c 2006-05-25 15:19:00 UTC (rev 4604)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c 2006-05-25 15:45:42 UTC (rev 4605)
@@ -9,7 +9,11 @@
#include "windows.c"
HANDLE fileDesHandle (int fd) {
- return (HANDLE)(get_osfhandle (fd));
+ // The temporary prevents a "cast does not match function type" warning.
+ long t;
+
+ t = get_osfhandle (fd);
+ return (HANDLE)t;
}
void GC_decommit (void *base, size_t length) {
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c 2006-05-25 15:19:00 UTC (rev 4604)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c 2006-05-25 15:45:42 UTC (rev 4605)
@@ -25,7 +25,11 @@
}
HANDLE fileDesHandle (int fd) {
- return (HANDLE)(_get_osfhandle (fd));
+ // The temporary prevents a "cast does not match function type" warning.
+ long t;
+
+ t = _get_osfhandle (fd);
+ return (HANDLE)t;
}
int getpagesize (void) {
|
|
From: Wesley T. <we...@ml...> - 2006-05-25 08:19:03
|
For whatever reason, casting to char makes the test fail on powerpc linux. This is despite that powerpc linux is in fact signed. I've tested the CHAR_MIN variant with -funsigned-char to make sure it fails, and we already include limits.h, so this seems best. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-05-25 13:00:37 UTC (rev 4603) +++ mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2006-05-25 15:19:00 UTC (rev 4604) @@ -54,7 +54,7 @@ COMPILE_TIME_ASSERT(CHAR_BIT__is_eight, CHAR_BIT == 8); COMPILE_TIME_ASSERT(sizeof_float__is_four, sizeof(float) == 4); COMPILE_TIME_ASSERT(sizeof_double__is_eight, sizeof(double) == 8); -COMPILE_TIME_ASSERT(char__is_signed, (double)((char)(-1)) < 0); +COMPILE_TIME_ASSERT(char__is_signed, CHAR_MIN < 0); #include <fcntl.h> #include <unistd.h> |
|
From: Matthew F. <fl...@ml...> - 2006-05-25 06:00:37
|
Sync ignored ---------------------------------------------------------------------- _U mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/ _U mlton/branches/on-20050822-x86_64-branch/runtime/gen/ ---------------------------------------------------------------------- Property changes on: mlton/branches/on-20050822-x86_64-branch/runtime/bytecode ___________________________________________________________________ Name: svn:ignore - interpret print-opcodes + opcodes Property changes on: mlton/branches/on-20050822-x86_64-branch/runtime/gen ___________________________________________________________________ Name: svn:ignore - basis-ffi.sml c-types.sml + basis-ffi.h basis-ffi.sml c-types.h c-types.sml ml-types.h |
|
From: Matthew F. <fl...@ml...> - 2006-05-25 06:00:05
|
Move /bytecode to /runtime/bytecode.
One warning about "shadows global" that couldn't be easily fixed, so
interpret.c is compiled with -Wno-shadow.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/Makefile
D mlton/branches/on-20050822-x86_64-branch/bytecode/
U mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
A mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/
U mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/.ignore
U mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/Makefile
U mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/interpret.c
U mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/opcode.h
U mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/print-opcodes.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/.ignore
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/Makefile 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/Makefile 2006-05-25 13:00:03 UTC (rev 4602)
@@ -282,20 +282,17 @@
$(MAKE) -C runtime
$(CP) include/*.h "$(INC)/"
$(CP) runtime/*.a "$(LIB)/$(TARGET)/"
- cp runtime/gen/c-types.sml \
+ $(CP) runtime/gen/c-types.sml \
basis-library/config/c/$(TARGET_ARCH)-$(TARGET_OS)/c-types.sml
- cp runtime/gen/basis-ffi.sml \
+ $(CP) runtime/gen/basis-ffi.sml \
basis-library/primitive/basis-ffi.sml
+ $(CP) runtime/bytecode/opcodes "$(LIB)/"
$(CP) runtime/*.h "$(INC)/"
for d in basis basis/Real basis/Word gc platform util; do \
mkdir -p "$(INC)/$$d"; \
$(CP) runtime/$$d/*.h "$(INC)/$$d"; \
done
- $(CP) bytecode/interpret.h "$(INC)"
- $(MAKE) -C bytecode
- bytecode/print-opcodes >"$(LIB)/opcodes"
- ar r "$(LIB)/$(TARGET)/libmlton.a" bytecode/interpret.o
- ar r "$(LIB)/$(TARGET)/libmlton-gdb.a" bytecode/interpret-gdb.o
+ $(CP) runtime/bytecode/interpret.h "$(INC)"
for x in "$(LIB)"/"$(TARGET)"/*.a; do $(RANLIB) "$$x"; done
.PHONY: script
Modified: mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-25 13:00:03 UTC (rev 4602)
@@ -27,7 +27,7 @@
#define DEBUG_CCODEGEN FALSE
#endif
-extern struct cont (*nextChunks []) ();
+extern struct cont (*nextChunks []) (void);
extern int nextFun;
extern int returnToC;
extern struct GC_state gcState;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-25 13:00:03 UTC (rev 4602)
@@ -148,10 +148,16 @@
BASISHFILES = \
$(shell find basis -type f | grep '\.h$$')
+BYTECFILES = \
+ $(shell find bytecode -type f | grep '\.c$$')
+BYTEHFILES = \
+ $(shell find bytecode -type f | grep '\.h$$')
+
CFILES = \
$(UTILCFILES) \
$(shell find basis -type f | grep '\.c$$' | grep -v Real/) \
gc.c \
+ bytecode/interpret.c \
platform.c
HFILES = \
@@ -189,7 +195,9 @@
OBJS += $(foreach f, $(EXTRA_FILES), $(f).o)
DEBUG_OBJS += $(foreach f, $(EXTRA_FILES), $(f)-gdb.o)
-all: libgdtoa.a libmlton.a libmlton-gdb.a
+all: libgdtoa.a libmlton.a libmlton-gdb.a \
+ gen/c-types.sml gen/basis-ffi.sml \
+ bytecode/opcodes
libgdtoa.a: gdtoa/arith.h
cd gdtoa && \
@@ -234,27 +242,46 @@
util/%.o: util/%.c util.h $(UTILHFILES)
$(CC) $(OPTCFLAGS) $(WARNCFLAGS) -c -o $@ $<
-c-types.h ml-types.h: gen/gen-types.c util.h $(UTILOFILES)
- rm -f c-types.h ml-types.h
+gen/c-types.h gen/c-types.sml gen/ml-types.h: gen/gen-types.c util.h $(UTILOFILES)
$(CC) $(OPTCFLAGS) $(WARNCFLAGS) -o gen/gen-types gen/gen-types.c $(UTILOFILES)
+ rm -f gen/c-types.h gen/c-types.sml gen/ml-types.h
cd gen && ./gen-types
- mv gen/c-types.h c-types.h
- mv gen/ml-types.h ml-types.h
rm -f gen/gen-types
-basis-ffi.h: gen/gen-basis-ffi.sml gen/basis-ffi.def
- rm -f basis-ffi.h
- cd gen && mlton gen-basis-ffi.sml
+c-types.h ml-types.h: gen/c-types.h gen/ml-types.h
+ rm -f c-types.h ml-types.h
+ cp gen/c-types.h c-types.h
+ cp gen/ml-types.h ml-types.h
+
+gen/basis-ffi.h gen/basis-ffi.sml: gen/gen-basis-ffi.sml gen/basis-ffi.def
+ mlton -output gen/gen-basis-ffi gen/gen-basis-ffi.sml
+ rm -f gen/basis-ffi.h gen/basis-ffi.sml
cd gen && ./gen-basis-ffi
- mv gen/basis-ffi.h basis-ffi.h
rm -f gen/gen-basis-ffi
+basis-ffi.h: gen/basis-ffi.h
+ rm -f basis-ffi.h
+ cp gen/basis-ffi.h basis-ffi.h
+
+bytecode/opcodes: bytecode/print-opcodes.c bytecode/opcode.h
+ $(CC) $(OPTCFLAGS) $(WARNCFLAGS) -o bytecode/print-opcodes bytecode/print-opcodes.c
+ rm -f bytecode/opcodes
+ cd bytecode && ./print-opcodes > opcodes
+ rm -f bytecode/print-opcodes
+
+
gc-gdb.o: gc.c $(GCCFILES) $(HFILES)
$(CC) $(DEBUGCFLAGS) $(DEBUGWARNCFLAGS) -c -o $@ $<
gc.o: gc.c $(GCCFILES) $(HFILES)
$(CC) $(OPTCFLAGS) $(GCOPTCFLAGS) $(OPTWARNCFLAGS) -c -o $@ $<
+bytecode/interpret-gdb.o: bytecode/interpret.c bytecode/opcode.h $(HFILES)
+ $(CC) -I../include $(DEBUGCFLAGS) $(DEBUGWARNCFLAGS) -Wno-float-equal -Wno-shadow -c -o $@ $<
+
+bytecode/interpret.o: bytecode/interpret.c bytecode/opcode.h $(HFILES)
+ $(CC) -I../include $(OPTCFLAGS) $(GCOPTCFLAGS) $(OPTWARNCFLAGS) -Wno-float-equal -Wno-shadow -c -o $@ $<
+
# It looks like we don't follow the C spec w.r.t. aliasing. And gcc
# -O2 catches us on the code in Real/*.c where we treat a double as a
# chunk of two words. Files that have been known to cause problems
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/bytecode (from rev 4601, mlton/branches/on-20050822-x86_64-branch/bytecode)
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/.ignore
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/.ignore 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/.ignore 2006-05-25 13:00:03 UTC (rev 4602)
@@ -1,2 +1 @@
-interpret
-print-opcodes
+opcodes
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/Makefile 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/Makefile 2006-05-25 13:00:03 UTC (rev 4602)
@@ -5,47 +5,8 @@
# See the file MLton-LICENSE for details.
##
-TARGET_ARCH = $(shell ../bin/host-arch)
-TARGET_OS = $(shell ../bin/host-os)
+all:
-all: interpret.o interpret-gdb.o print-opcodes
-
-CC = gcc -std=gnu99
-CFLAGS = -fomit-frame-pointer -I../runtime -I../include -Wall
-DEBUGFLAGS = $(CFLAGS)
-ifneq ($(TARGET_ARCH), ia64)
-ifneq ($(TARGET_ARCH), powerpc)
-DEBUGFLAGS += -gstabs+
-endif
-endif
-DEBUGFLAGS += -g2
-
-ifeq ($(TARGET_ARCH), amd64)
-CFLAGS += -mtune=opteron -m32
-endif
-
-ifeq ($(TARGET_OS), freebsd)
-CFLAGS += -I/usr/local/include
-endif
-
-ifeq ($(TARGET_OS), openbsd)
-CFLAGS += -I/usr/local/include
-endif
-
-interpret.o: interpret.c interpret.h opcode.h
- $(CC) $(CFLAGS) -c -O2 interpret.c
-
-interpret-gdb.o: interpret.c interpret.h
- $(CC) $(DEBUGFLAGS) -c -o $@ -DASSERT=1 interpret.c
-
-print-opcodes: print-opcodes.c opcode.h
- $(CC) $(CFLAGS) -o print-opcodes -I../runtime -L../runtime \
- print-opcodes.c -lmlton
-
-.PHONY: clean
+.PHONY:
clean:
- ../bin/clean
-
-.PHONY: exp
-exp:
- $(CC) -E -I../runtime -I../include interpret.c >/tmp/z.exp
+ ../../bin/clean
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/interpret.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/interpret.c 2006-05-25 13:00:03 UTC (rev 4602)
@@ -116,16 +116,16 @@
case opcodeSymOfTy2 (ty, mode##ArrayOffset): \
{ \
ArrayOffset arrayOffset; \
- Pointer base; \
- Word32 index; \
- Scale scale; \
+ Pointer arrayBase; \
+ Word32 arrayIndex; \
+ Scale arrayScale; \
Fetch (ArrayOffset, arrayOffset); \
- Fetch (Scale, scale); \
+ Fetch (Scale, arrayScale); \
if (disassemble) goto mainLoop; \
- index = PopReg (Word32); \
- base = (Pointer) (PopReg (Word32)); \
+ arrayIndex = PopReg (Word32); \
+ arrayBase = (Pointer) (PopReg (Word32)); \
loadStore (mode, ty, \
- *(ty*)(base + (index * scale) + arrayOffset)); \
+ *(ty*)(arrayBase + (arrayIndex * arrayScale) + arrayOffset)); \
goto mainLoop; \
}
@@ -357,7 +357,7 @@
fprintf (stderr, "\n" #ty "Reg[%d] = 0x%08x", \
i, (unsigned int)(ty##Reg[i]));
-void displayRegs () {
+static inline void displayRegs (void) {
int i;
disp (Word8);
@@ -368,11 +368,11 @@
disp (Real64);
}
-static inline void interpret (Bytecode b, Word32 codeOffset, Bool disassemble) {
+static void interpret (Bytecode b, Word32 codeOffset, Bool disassemble) {
CallCIndex callCIndex;
Pointer code;
Pointer frontier;
- int i;
+ unsigned int i;
String name;
String *offsetToLabel = NULL;
Opcode opc;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/opcode.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/opcode.h 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/opcode.h 2006-05-25 13:00:03 UTC (rev 4602)
@@ -162,7 +162,7 @@
#define opcodeGen(z) #z,
-char *opcodeStrings [] = {
+const char *opcodeStrings [] = {
opcodes ()
};
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/print-opcodes.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/print-opcodes.c 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/bytecode/print-opcodes.c 2006-05-25 13:00:03 UTC (rev 4602)
@@ -9,9 +9,10 @@
#include <stdio.h>
#include "opcode.h"
-int main () {
+int main (__attribute__((unused)) int argc,
+ __attribute__((unused)) char* argv[]) {
Opcode opc;
- int i;
+ unsigned int i;
unless (cardof (opcodeStrings) < (1 << (8 * sizeof (opc))))
die ("too many opcodes\n");
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/.ignore
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/.ignore 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/.ignore 2006-05-25 13:00:03 UTC (rev 4602)
@@ -1,2 +1,5 @@
+basis-ffi.h
basis-ffi.sml
+c-types.h
c-types.sml
+ml-types.h
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml 2006-05-25 12:41:18 UTC (rev 4601)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-basis-ffi.sml 2006-05-25 13:00:03 UTC (rev 4602)
@@ -340,8 +340,11 @@
fun print s = TextIO.output (f, s)
fun println s = if s <> "" then (print s; print "\n") else ()
- val () = println "/* This file is automatically generated. Do not edit. */\n"
+ val () = println "/* This file is automatically generated. Do not edit. */\n\n"
+ val () = println "#ifndef _MLTON_BASIS_FFI_H_\n"
+ val () = println "#define _MLTON_BASIS_FFI_H_\n"
val () = List.app (fn entry => println (Entry.toC entry)) entries
+ val () = println "#endif /* _MLTON_BASIS_FFI_H_ */\n"
val () = TextIO.closeOut f
in
()
|
|
From: Wesley T. <we...@ml...> - 2006-05-25 05:41:18
|
PowerPC linux types ---------------------------------------------------------------------- A mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/powerpc-linux/ A mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/powerpc-linux/c-types.sml ---------------------------------------------------------------------- Added: mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/powerpc-linux/c-types.sml =================================================================== --- mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/powerpc-linux/c-types.sml 2006-05-25 12:01:55 UTC (rev 4600) +++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/powerpc-linux/c-types.sml 2006-05-25 12:41:18 UTC (rev 4601) @@ -0,0 +1,131 @@ +(* Copyright (C) 2004-2006 Henry Cejtin, Matthew Fluet, Suresh + * Jagannathan, and Stephen Weeks. + * + * MLton is released under a BSD-style license. + * See the file MLton-LICENSE for details. + *) + + +(* C *) +structure C_Char = struct open Word8 type t = word end +functor C_Char_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word8 (A) +structure C_SChar = struct open Int8 type t = int end +functor C_SChar_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int8 (A) +structure C_UChar = struct open Word8 type t = word end +functor C_UChar_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word8 (A) +structure C_Short = struct open Int16 type t = int end +functor C_Short_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int16 (A) +structure C_SShort = struct open Int16 type t = int end +functor C_SShort_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int16 (A) +structure C_UShort = struct open Word16 type t = word end +functor C_UShort_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word16 (A) +structure C_Int = struct open Int32 type t = int end +functor C_Int_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_SInt = struct open Int32 type t = int end +functor C_SInt_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_UInt = struct open Word32 type t = word end +functor C_UInt_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_Long = struct open Int32 type t = int end +functor C_Long_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_SLong = struct open Int32 type t = int end +functor C_SLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_ULong = struct open Word32 type t = word end +functor C_ULong_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_LongLong = struct open Int64 type t = int end +functor C_LongLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A) +structure C_SLongLong = struct open Int64 type t = int end +functor C_SLongLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A) +structure C_ULongLong = struct open Word64 type t = word end +functor C_ULongLong_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A) +structure C_Float = struct open Real32 type t = real end +functor C_Float_ChooseRealN (A: CHOOSE_REALN_ARG) = ChooseRealN_Real32 (A) +structure C_Double = struct open Real64 type t = real end +functor C_Double_ChooseRealN (A: CHOOSE_REALN_ARG) = ChooseRealN_Real64 (A) +structure C_Size = struct open Word32 type t = word end +functor C_Size_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +structure C_Pointer = struct open Word32 type t = word end +functor C_Pointer_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_String = struct open Word32 type t = word end +functor C_String_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_StringArray = struct open Word32 type t = word end +functor C_StringArray_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* Generic integers *) +structure C_Fd = C_Int +functor C_Fd_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A) +structure C_Signal = C_Int +functor C_Signal_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A) +structure C_Status = C_Int +functor C_Status_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A) +structure C_Sock = C_Int +functor C_Sock_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A) + +(* C99 *) +structure C_Ptrdiff = struct open Int32 type t = int end +functor C_Ptrdiff_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_Intmax = struct open Int64 type t = int end +functor C_Intmax_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A) +structure C_UIntmax = struct open Word64 type t = word end +functor C_UIntmax_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A) +structure C_Intptr = struct open Int32 type t = int end +functor C_Intptr_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_UIntptr = struct open Word32 type t = word end +functor C_UIntptr_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <dirent.h> *) +structure C_DirP = struct open Word32 type t = word end +functor C_DirP_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <poll.h> *) +structure C_NFds = struct open Word32 type t = word end +functor C_NFds_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <resource.h> *) +structure C_RLim = struct open Word64 type t = word end +functor C_RLim_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A) + +(* from <sys/types.h> *) +structure C_Clock = struct open Int32 type t = int end +functor C_Clock_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_Dev = struct open Word64 type t = word end +functor C_Dev_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A) +structure C_GId = struct open Word32 type t = word end +functor C_GId_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_Id = struct open Word32 type t = word end +functor C_Id_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_INo = struct open Word64 type t = word end +functor C_INo_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A) +structure C_Mode = struct open Word32 type t = word end +functor C_Mode_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_NLink = struct open Word32 type t = word end +functor C_NLink_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_Off = struct open Int64 type t = int end +functor C_Off_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A) +structure C_PId = struct open Int32 type t = int end +functor C_PId_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_SSize = struct open Int32 type t = int end +functor C_SSize_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_SUSeconds = struct open Int32 type t = int end +functor C_SUSeconds_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_Time = struct open Int32 type t = int end +functor C_Time_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A) +structure C_UId = struct open Word32 type t = word end +functor C_UId_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <sys/socket.h> *) +structure C_Socklen = struct open Word32 type t = word end +functor C_Socklen_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from <termios.h> *) +structure C_CC = struct open Word8 type t = word end +functor C_CC_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word8 (A) +structure C_Speed = struct open Word32 type t = word end +functor C_Speed_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) +structure C_TCFlag = struct open Word32 type t = word end +functor C_TCFlag_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + +(* from "gmp.h" *) +structure C_MPLimb = struct open Word32 type t = word end +functor C_MPLimb_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A) + |
|
From: Matthew F. <fl...@ml...> - 2006-05-25 05:01:59
|
Follow up to r4599: add "basis-ffi.h" to "c-chunk.h" and revise the
MLTON_CODEGEN_WORDSQUOTREM macro.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c
U mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.h
U mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-ops.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c 2006-05-25 10:52:45 UTC (rev 4599)
+++ mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c 2006-05-25 12:01:55 UTC (rev 4600)
@@ -9,6 +9,10 @@
#ifndef MLTON_CODEGEN_STATIC_INLINE
#define MLTON_CODEGEN_STATIC_INLINE static inline
#endif
+#include "platform.h"
+
+#include "interpret.h"
+
/* No need to declare inlined math functions, since <math.h> comes
* with "platform.h".
*/
@@ -20,11 +24,8 @@
* arguments are variables.
*/
#ifndef MLTON_CODEGEN_WORDSQUOTREM
-#define MLTON_CODEGEN_WORDSQUOTREM(decl, func) func
+#define MLTON_CODEGEN_WORDSQUOTREM(func) func
#endif
-#include "platform.h"
-
-#include "interpret.h"
#include "c-chunk.h" // c-chunk.h must come before opcode.h because it
// redefines some opcode symbols
#include "opcode.h"
Modified: mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.h 2006-05-25 10:52:45 UTC (rev 4599)
+++ mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.h 2006-05-25 12:01:55 UTC (rev 4600)
@@ -10,6 +10,7 @@
#include <stdio.h>
#include "ml-types.h"
+#include "c-types.h"
#include "assert.h"
#define regs(ty) \
Modified: mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-25 10:52:45 UTC (rev 4599)
+++ mlton/branches/on-20050822-x86_64-branch/include/c-chunk.h 2006-05-25 12:01:55 UTC (rev 4600)
@@ -204,12 +204,11 @@
/* WordS<N>_quot and WordS<N>_rem can't be inlined with the C-codegen,
* because the gcc optimizer sometimes produces incorrect results when
* one of the arguments is a constant.
- * However, we need the declarations for Word-check.h
*/
#ifndef MLTON_CODEGEN_WORDSQUOTREM
-#define MLTON_CODEGEN_WORDSQUOTREM(decl, func) decl
+#define MLTON_CODEGEN_WORDSQUOTREM(func)
#endif
-// #include "basis-ffi.h"
+#include "basis-ffi.h"
#include "basis/coerce.h"
#include "basis/Real/Real-ops.h"
#include "basis/Real/Math-fns.h"
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-ops.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-ops.h 2006-05-25 10:52:45 UTC (rev 4599)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Word/Word-ops.h 2006-05-25 12:01:55 UTC (rev 4600)
@@ -1,11 +1,8 @@
#ifndef MLTON_CODEGEN_WORDSQUOTREM
-#define MLTON_CODEGEN_WORDSQUOTREM(decl, func) func
+#define MLTON_CODEGEN_WORDSQUOTREM(func) func
#endif
-#define binaryDecl(kind, name) \
- Word##kind Word##kind##_##name (Word##kind w1, Word##kind w2);
-
#define binary(kind, name, op) \
MLTON_CODEGEN_STATIC_INLINE \
Word##kind Word##kind##_##name (Word##kind w1, Word##kind w2) { \
@@ -62,24 +59,23 @@
bothBinary (size, mul, *) \
unary (size, neg, -) \
unary (size, notb, ~) \
-/* WordS<N>_quot and WordS<N>_rem can't be inlined with the C-codegen, \
- * because the gcc optimizer sometimes produces incorrect results \
- * when one of the arguments is a constant. \
- * However, we need the declarations for Word-check.h \
- * WordS<N>_quot and WordS<N>_rem can be inlined with the \
- * bytecode-codegen, since they will be used in a context where the \
- * arguments are variables. \
- */ \
-MLTON_CODEGEN_WORDSQUOTREM(binaryDecl (S##size, quot), binary (S##size, quot, /)) \
-MLTON_CODEGEN_WORDSQUOTREM(binaryDecl (S##size, rem), binary (S##size, rem, %)) \
+/* WordS<N>_quot and WordS<N>_rem can't be inlined with the C-codegen, \
+ * because the gcc optimizer sometimes produces incorrect results \
+ * when one of the arguments is a constant. \
+ * WordS<N>_quot and WordS<N>_rem can be inlined with the \
+ * bytecode-codegen, since they will be used in a context where the \
+ * arguments are variables. \
+ */ \
+MLTON_CODEGEN_WORDSQUOTREM(binary (S##size, quot, /)) \
+MLTON_CODEGEN_WORDSQUOTREM(binary (S##size, rem, %)) \
binary (U##size, quot, /) \
binary (U##size, rem, %) \
binary (size, orb, |) \
rol(size) \
ror(size) \
-/* WordS<N>_rshift isn't ANSI C, because ANSI doesn't guarantee sign \
- * extension. We use it anyway cause it always seems to work. \
- */ \
+/* WordS<N>_rshift isn't ANSI C, because ANSI doesn't guarantee sign \
+ * extension. We use it anyway cause it always seems to work. \
+ */ \
shift (S##size, rshift, >>) \
shift (U##size, rshift, >>) \
binary (size, sub, -) \
|
|
From: Wesley T. <we...@ml...> - 2006-05-25 03:52:48
|
Carry type information from _symbol all the way to the c-codegen when importing. This prevents type conflicts with objects which already imported by MLton's own header files.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/mlton/atoms/prim.fun
U mlton/branches/on-20050822-x86_64-branch/mlton/atoms/prim.sig
U mlton/branches/on-20050822-x86_64-branch/mlton/codegen/c-codegen/c-codegen.fun
U mlton/branches/on-20050822-x86_64-branch/mlton/elaborate/elaborate-core.fun
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/atoms/prim.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/atoms/prim.fun 2006-05-25 06:50:42 UTC (rev 4598)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/atoms/prim.fun 2006-05-25 10:52:45 UTC (rev 4599)
@@ -46,7 +46,7 @@
| Exn_setExtendExtra (* implement exceptions *)
| Exn_setInitExtra (* implement exceptions *)
| FFI of 'a CFunction.t (* ssa to rssa *)
- | FFI_Symbol of {name: string} (* codegen *)
+ | FFI_Symbol of {name: string, cty: CType.t option} (* codegen *)
| GC_collect (* ssa to rssa *)
| IntInf_add (* ssa to rssa *)
| IntInf_andb (* ssa to rssa *)
@@ -486,7 +486,7 @@
| Exn_setExtendExtra => Exn_setExtendExtra
| Exn_setInitExtra => Exn_setInitExtra
| FFI func => FFI (CFunction.map (func, f))
- | FFI_Symbol {name} => FFI_Symbol {name = name}
+ | FFI_Symbol {name, cty} => FFI_Symbol {name = name, cty = cty}
| GC_collect => GC_collect
| IntInf_add => IntInf_add
| IntInf_andb => IntInf_andb
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/atoms/prim.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/atoms/prim.sig 2006-05-25 06:50:42 UTC (rev 4598)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/atoms/prim.sig 2006-05-25 10:52:45 UTC (rev 4599)
@@ -36,7 +36,7 @@
| Exn_setExtendExtra (* implement exceptions *)
| Exn_setInitExtra (* implement exceptions *)
| FFI of 'a CFunction.t (* ssa to rssa *)
- | FFI_Symbol of {name: string} (* codegen *)
+ | FFI_Symbol of {name: string, cty: CType.t option} (* codegen *)
| GC_collect (* ssa to rssa *)
| IntInf_add (* ssa to rssa *)
| IntInf_andb (* ssa to rssa *)
@@ -216,7 +216,7 @@
deWeak: 'b -> 'b,
result: 'b} -> 'b vector
val ffi: 'a CFunction.t -> 'a t
- val ffiSymbol: {name: string} -> 'a t
+ val ffiSymbol: {name: string, cty: CType.t option} -> 'a t
val fromString: string -> 'a t option
val gcCollect: 'a t
val intInfEqual: 'a t
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/codegen/c-codegen/c-codegen.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/codegen/c-codegen/c-codegen.fun 2006-05-25 06:50:42 UTC (rev 4598)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/codegen/c-codegen/c-codegen.fun 2006-05-25 10:52:45 UTC (rev 4599)
@@ -476,10 +476,16 @@
case s of
Statement.PrimApp {prim, ...} =>
(case Prim.name prim of
- Prim.Name.FFI_Symbol {name} =>
+ Prim.Name.FFI_Symbol {name, cty} =>
doit
(name, fn () =>
- concat ["extern ", name, ";\n"])
+ concat ["extern ",
+ case cty of
+ SOME x => CType.toString x
+ | NONE => "",
+ " ",
+ name,
+ ";\n"])
| _ => ())
| _ => ())
val _ =
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/elaborate/elaborate-core.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/elaborate/elaborate-core.fun 2006-05-25 06:50:42 UTC (rev 4598)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/elaborate/elaborate-core.fun 2006-05-25 10:52:45 UTC (rev 4599)
@@ -940,9 +940,10 @@
Type.defaultWord)
fun mkAddress {expandedPtrTy: Type.t,
- name: string}: Cexp.t =
+ name: string,
+ cty: CType.t option }: Cexp.t =
primApp {args = Vector.new0 (),
- prim = Prim.ffiSymbol {name = name},
+ prim = Prim.ffiSymbol {name = name, cty = cty},
result = expandedPtrTy}
fun mkFetch {ctypeCbTy, isBool,
@@ -1038,7 +1039,8 @@
| _ => (error (); ())
val addrExp =
mkAddress {expandedPtrTy = expandedPtrTy,
- name = name}
+ name = name,
+ cty = NONE}
fun wrap (e, t) = Cexp.make (Cexp.node e, t)
in
wrap (addrExp, elabedTy)
@@ -1099,7 +1101,8 @@
| NONE => (error (); CType.word (WordSize.default, {signed = false}))
val addrExp =
mkAddress {expandedPtrTy = Type.word (WordSize.pointer ()),
- name = name}
+ name = name,
+ cty = SOME ctypeCbTy}
val () =
if List.exists (attributes, fn attr =>
attr = SymbolAttribute.Alloc)
@@ -1220,7 +1223,8 @@
val isBool = Type.isBool expandedCbTy
val addrExp =
mkAddress {expandedPtrTy = Type.word (WordSize.pointer ()),
- name = name}
+ name = name,
+ cty = SOME ctypeCbTy}
fun wrap (e, t) = Cexp.make (Cexp.node e, t)
in
wrap (mkFetch {ctypeCbTy = ctypeCbTy,
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 23:50:45
|
Brought Cygwin_toFullWindowsPath back to life, via an addition to
basis-ffi.def.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/basis-library/build/sources.mlb
U mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library/platform/cygwin.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/build/sources.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/build/sources.mlb 2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/build/sources.mlb 2006-05-25 06:50:42 UTC (rev 4598)
@@ -245,7 +245,7 @@
../posix/posix.sig
../posix/posix.sml
- (* ../platform/cygwin.sml *)
+ ../platform/cygwin.sml
../io/stream-io.sig
../io/stream-io.fun
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml 2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml 2006-05-25 06:50:42 UTC (rev 4598)
@@ -257,7 +257,6 @@
SysCall.simpleResult'
({errVal = C_PId.castFromFixedInt ~1}, fn () =>
let
-(*
val cmd =
let
open MLton.Platform.OS
@@ -267,7 +266,6 @@
| MinGW => cmd
| _ => raise Fail "create"
end
-*)
in
PrimitiveFFI.Windows.Process.create
(NullString.nullTerm cmd, args, env, stdin, stdout, stderr)
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/platform/cygwin.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/platform/cygwin.sml 2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/platform/cygwin.sml 2006-05-25 06:50:42 UTC (rev 4598)
@@ -7,10 +7,9 @@
structure Cygwin =
struct
- structure Prim = Primitive.Cygwin
-
fun toFullWindowsPath p =
- COld.CS.toString (Prim.toFullWindowsPath (NullString.nullTerm p))
+ CUtil.C_String.toString
+ (PrimitiveFFI.Cygwin.toFullWindowsPath (NullString.nullTerm p))
fun toExe cmd =
let
@@ -20,8 +19,8 @@
let
val i = i - 1
in
- if i < 0
- then addExe ()
+ if i < 0 then
+ addExe ()
else
let
val c = String.sub (cmd, i)
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml 2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml 2006-05-25 06:50:42 UTC (rev 4598)
@@ -9,6 +9,10 @@
val (argvGet, argvSet) = _symbol "CommandLine_argv": (unit -> (C_StringArray.t)) * ((C_StringArray.t) -> unit);
val (commandNameGet, commandNameSet) = _symbol "CommandLine_commandName": (unit -> (C_String.t)) * ((C_String.t) -> unit);
end
+structure Cygwin =
+struct
+val toFullWindowsPath = _import "Cygwin_toFullWindowsPath" : NullString8.t -> C_String.t;
+end
structure Date =
struct
val gmTime = _import "Date_gmTime" : (C_Time.t) ref -> (C_Int.t) C_Errno.t;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def 2006-05-25 06:50:42 UTC (rev 4598)
@@ -1,6 +1,7 @@
CommandLine.argc = _symbol : C_Int.t
CommandLine.argv = _symbol : C_StringArray.t
CommandLine.commandName = _symbol : C_String.t
+Cygwin.toFullWindowsPath = _import : NullString8.t -> C_String.t
Date.Tm.getHour = _import : unit -> C_Int.t
Date.Tm.getIsDst = _import : unit -> C_Int.t
Date.Tm.getMDay = _import : unit -> C_Int.t
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c 2006-05-25 05:45:31 UTC (rev 4597)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c 2006-05-25 06:50:42 UTC (rev 4598)
@@ -37,11 +37,11 @@
/* Cygwin */
/* ------------------------------------------------- */
-char *Cygwin_toFullWindowsPath (char *path) {
+C_String_t Cygwin_toFullWindowsPath (NullString8_t path) {
static char res[MAX_PATH];
cygwin_conv_to_full_win32_path ((char*)path, &res[0]);
- return &res[0];
+ return (C_String_t)&res[0];
}
/* ------------------------------------------------- */
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 22:45:37
|
Implemented diskBack functions for Windows. They type check, but are
untested.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c 2006-05-25 05:44:30 UTC (rev 4596)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c 2006-05-25 05:45:31 UTC (rev 4597)
@@ -2,7 +2,7 @@
#define BUFSIZE 65536
-int tempFileDes (void) {
+static HANDLE tempFileDes (void) {
/* Based on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/creating_and_using_a_temporary_file.asp
*/
HANDLE hTempFile;
@@ -14,18 +14,57 @@
dwRetVal = GetTempPath(dwBufSize, lpPathBuffer);
if (dwRetVal > dwBufSize)
- diee ("GetTempPath failed with error %ld.\n", GetLastError());
+ die ("GetTempPath failed with error %ld\n", GetLastError());
uRetVal = GetTempFileName(lpPathBuffer, "TempFile", 0, szTempName);
if (0 == uRetVal)
- diee ("GetTempFileName failed with error %ld.\n", GetLastError());
+ die ("GetTempFileName failed with error %ld\n", GetLastError());
hTempFile = CreateFile((LPTSTR) szTempName, GENERIC_READ | GENERIC_WRITE,
0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE,
NULL);
if (hTempFile == INVALID_HANDLE_VALUE)
- diee ("CreateFile failed with error %ld.\n", GetLastError());
+ die ("CreateFile failed with error %ld\n", GetLastError());
return hTempFile;
}
+typedef struct {
+ HANDLE handle;
+} *WriteToDiskData;
+
+void diskBack_read (void *data, pointer buf, size_t size) {
+ HANDLE h;
+ DWORD d;
+ DWORD dwBytesRead;
+
+ h = ((WriteToDiskData)data)->handle;
+ d = SetFilePointer (h, 0, NULL, FILE_BEGIN);
+ if (d == INVALID_SET_FILE_POINTER)
+ die ("SetFilePointer failed with error %ld\n", GetLastError());
+ unless (ReadFile(h, buf, size, &dwBytesRead, NULL))
+ die ("ReadFile failed with error %ld\n", GetLastError());
+}
+
+void diskBack_close (void *data) {
+ HANDLE h;
+
+ h = ((WriteToDiskData)data)->handle;
+ unless (CloseHandle (h))
+ die ("CloseHandle failed with error %ld.", GetLastError());
+ free (data);
+}
+
+void *diskBack_write (pointer buf, size_t size) {
+ HANDLE h;
+ WriteToDiskData d;
+ DWORD dwBytesWritten;
+
+ h = tempFileDes ();
+ unless (WriteFile (h, buf, size, &dwBytesWritten, NULL))
+ die ("WriteFile failed with error %ld\n", GetLastError());
+ d = (WriteToDiskData)(malloc_safe (sizeof(*d)));
+ d->handle = h;
+ return d;
+}
+
static void displayMaps (void) {
MEMORY_BASIC_INFORMATION buf;
LPVOID lpAddress;
@@ -133,7 +172,7 @@
die ("VirtualFree decommit failed");
}
-static inline void *Windows_mmapAnon (__atribute__ ((unused)) void *start,
+static inline void *Windows_mmapAnon (__attribute__ ((unused)) void *start,
size_t length) {
void *res;
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 22:44:31
|
Added casts from C_Int_t to int for call to gdtoa.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c 2006-05-25 05:42:35 UTC (rev 4595)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c 2006-05-25 05:44:30 UTC (rev 4596)
@@ -32,7 +32,7 @@
ex = 1;
ex -= 0x7f + 23;
i = STRTOG_Normal;
- result = gdtoa (&fpi, ex, bits, &i, mode, ndig, (int*)decpt, NULL);
+ result = gdtoa (&fpi, ex, bits, &i, (int)mode, (int)ndig, (int*)decpt, NULL);
if (DEBUG)
fprintf (stderr, "%s = gdtoa (%g, %d, %d) decpt = %d\n",
result, (double)f, (int)mode, (int)ndig, *((int*)decpt));
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 22:42:36
|
Eliminated printf warnings about "int format, C_Int_t arg" using cast
as suggested by Matthew.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c 2006-05-25 04:58:16 UTC (rev 4594)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/gdtoa.c 2006-05-25 05:42:35 UTC (rev 4595)
@@ -35,7 +35,7 @@
result = gdtoa (&fpi, ex, bits, &i, mode, ndig, (int*)decpt, NULL);
if (DEBUG)
fprintf (stderr, "%s = gdtoa (%g, %d, %d) decpt = %d\n",
- result, (double)f, mode, ndig, *((int*)decpt));
+ result, (double)f, (int)mode, (int)ndig, *((int*)decpt));
return (C_String_t)result;
}
@@ -69,6 +69,6 @@
result = gdtoa (&fpi, ex, bits, &i, mode, ndig, (int*)decpt, NULL);
if (DEBUG)
fprintf (stderr, "%s = gdtoa (%g, %d, %d) decpt = %d\n",
- result, d, mode, ndig, *((int*)decpt));
+ result, d, (int)mode, (int)ndig, *((int*)decpt));
return (C_String_t)result;
}
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 21:58:21
|
Refactored disk-backing code. The platform-specific code now provides
three functions, diskBack_{read,write,close}. Hopefully this will
allow the code to be ported to Cygwin/Windows.
Fixed declaration of environ in linux.h. It has to be conditioned on
_GNU_SOURCE to avoid redeclaration warnings.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
A mlton/branches/on-20050822-x86_64-branch/runtime/platform/diskBack.unix.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c
D mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -308,17 +308,15 @@
*curHeapp = newHeap;
} else {
/* Write the heap to disk and try again. */
- int fd;
+ void *data;
- fd = tempFileDes ();
- write_safe (fd, orig, size);
+ data = diskBack_write (orig, size);
releaseHeap (s, curHeapp);
if (createHeap (s, curHeapp, desiredSize, minSize)) {
- lseek (fd, 0, SEEK_SET);
- read_safe (fd, curHeapp->start, size);
- close_safe (fd);
+ diskBack_read (data, curHeapp->start, size);
+ diskBack_close (data);
} else {
- close_safe (fd);
+ diskBack_close (data);
if (s->controls.messages)
GC_displayMem ();
die ("Out of memory. Unable to allocate %s bytes.\n",
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -10,11 +10,11 @@
#include <sys/procfs.h>
#include <sys/vminfo.h>
+#include "diskBack.unix.c"
#include "getrusage.c"
#include "mkdir2.c"
#include "recv.nonblock.c"
#include "ssmmap.c"
-#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
int fegetround(void)
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -4,9 +4,9 @@
#include "platform.h"
+#include "diskBack.unix.c"
#include "mkdir2.c"
#include "mmap-protect.c"
-#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
code_pointer GC_getTextEnd (void) {
Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/diskBack.unix.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/diskBack.unix.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/diskBack.unix.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -0,0 +1,54 @@
+static int tempFileDes (void) {
+ int fd;
+ char *template;
+ const char *tmpDir;
+ const char *tag = "/TempFileXXXXXXXXXX";
+ mode_t m;
+
+ tmpDir = getenv ("TMP");
+ if (NULL == tmpDir) {
+ tmpDir = getenv ("TMPDIR");
+ if (NULL == tmpDir)
+ tmpDir = "/var/tmp";
+ }
+ template = malloc_safe (strlen(tmpDir) + strlen(tag) + 1);
+ strcpy (template, tmpDir);
+ strcat (template, tag);
+ m = umask(077);
+ fd = mkstemp_safe (template);
+ (void)umask(m);
+ unlink_safe (template);
+ free (template);
+ return fd;
+}
+
+typedef struct {
+ int fd;
+} *WriteToDiskData;
+
+void diskBack_read (void *data, pointer buf, size_t size) {
+ int fd;
+
+ fd = ((WriteToDiskData)data)->fd;
+ lseek (fd, 0, SEEK_SET);
+ read_safe (fd, buf, size);
+}
+
+void diskBack_close (void *data) {
+ int fd;
+
+ fd = ((WriteToDiskData)data)->fd;
+ close_safe (fd);
+ free (data);
+}
+
+void *diskBack_write (pointer buf, size_t size) {
+ int fd;
+ WriteToDiskData d;
+
+ fd = tempFileDes ();
+ write_safe (fd, buf, size);
+ d = (WriteToDiskData)(malloc_safe (sizeof(*d)));
+ d->fd = fd;
+ return d;
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -1,9 +1,9 @@
#include "platform.h"
+#include "diskBack.unix.c"
#include "getText.c"
#include "mkdir2.c"
#include "mmap-protect.c"
-#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
void GC_displayMem () {
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -8,11 +8,11 @@
#define MAP_ANON MAP_ANONYMOUS
+#include "diskBack.unix.c"
#include "mkdir2.c"
#include "recv.nonblock.c"
#include "setenv.putenv.c"
#include "mmap-protect.c"
-#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
extern unsigned char __text_start;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -2,12 +2,12 @@
#include "platform.h"
+#include "diskBack.unix.c"
#include "getText.c"
#include "mkdir2.c"
#include "displayMem.linux.c"
#include "mmap-protect.c"
#include "sysconf.c"
-#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
#ifndef EIP
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h 2006-05-25 04:58:16 UTC (rev 4594)
@@ -36,4 +36,7 @@
#define MLton_Platform_OS_host "linux"
+// environ is already defined if _GNU_SOURCE is.
+#ifndef _GNU_SOURCE
extern char **environ; /* for Posix_ProcEnv_environ */
+#endif
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -1,11 +1,11 @@
#include "platform.h"
+#include "diskBack.unix.c"
#include "getText.c"
#include "mkdir2.c"
#include "displayMem.linux.c"
#include "mmap-protect.c"
#include "sysctl.c"
-#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
static void catcher (__attribute__ ((unused)) int sig,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -1,11 +1,11 @@
#include "platform.h"
+#include "diskBack.unix.c"
#include "getText.c"
#include "mkdir2.c"
#include "displayMem.linux.c"
#include "mmap-protect.c"
#include "sysctl.c"
-#include "tempFileDes.mkstemp.c"
#include "use-mmap.c"
static void catcher (__attribute__ ((unused)) int sig,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -2,6 +2,7 @@
#include <ieeefp.h>
+#include "diskBack.unix.c"
#include "float-math.c"
#include "getText.c"
#include "mkdir2.c"
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/tempFileDes.mkstemp.c 2006-05-25 04:58:16 UTC (rev 4594)
@@ -1,23 +0,0 @@
-int tempFileDes (void) {
- int fd;
- char *template;
- const char *tmpDir;
- const char *tag = "/TempFileXXXXXXXXXX";
- mode_t m;
-
- tmpDir = getenv ("TMP");
- if (NULL == tmpDir) {
- tmpDir = getenv ("TMPDIR");
- if (NULL == tmpDir)
- tmpDir = "/var/tmp";
- }
- template = malloc_safe (strlen(tmpDir) + strlen(tag) + 1);
- strcpy (template, tmpDir);
- strcat (template, tag);
- m = umask(077);
- fd = mkstemp_safe (template);
- (void)umask(m);
- unlink_safe (template);
- free (template);
- return fd;
-}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-25 03:16:41 UTC (rev 4593)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-25 04:58:16 UTC (rev 4594)
@@ -129,7 +129,6 @@
/* ---------------------------------------------------------------- */
int mkdir2 (const char *pathname, mode_t mode);
-int tempFileDes (void);
/* ---------------------------------------------------------------- */
/* Garbage Collector */
@@ -157,6 +156,10 @@
void GC_setCygwinUseMmap (bool b);
+void diskBack_close (void *data);
+void diskBack_read (void *data, pointer buf, size_t size);
+void *diskBack_write (pointer buf, size_t size);
+
/* ------------------------------------------------- */
/* Text Segment */
/* ------------------------------------------------- */
|
|
From: Matthew F. <fl...@ml...> - 2006-05-24 20:16:41
|
Finegrained inlining by gcc version ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-25 03:03:55 UTC (rev 4592) +++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-05-25 03:16:41 UTC (rev 4593) @@ -35,9 +35,12 @@ endif ifeq ($(findstring $(GCC_VERSION), 3.3 3.4 4.0),$(GCC_VERSION)) GCOPTFLAGS += --param max-inline-insns-single=1000 +ifeq ($(findstring $(GCC_VERSION), 3.4 4.0),$(GCC_VERSION)) +GCOPTFLAGS += --param inline-unit-growth=125 +OPTWARNFLAGS += -Winline endif +endif DEBUGFLAGS += -gstabs+ -OPTWARNFLAGS += -Winline endif ifeq ($(TARGET_ARCH), amd64) |
|
From: Stephen W. <sw...@ml...> - 2006-05-24 20:03:57
|
Moved the declaration of "environ" into platform/<os>.h, because it is
already defined on Cygwin, and causes a redclaration warning. AFAIK
all other platforms require the declaration.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.h 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/aix.h 2006-05-25 03:03:55 UTC (rev 4592)
@@ -50,3 +50,5 @@
/* This should not conflict with existing flags. */
#define MSG_DONTWAIT 0x1000000
+
+extern char **environ; /* for Posix_ProcEnv_environ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.h 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.h 2006-05-25 03:03:55 UTC (rev 4592)
@@ -40,3 +40,5 @@
#ifndef SIGPOLL
#define SIGPOLL 7
#endif
+
+extern char **environ; /* for Posix_ProcEnv_environ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.h 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.h 2006-05-25 03:03:55 UTC (rev 4592)
@@ -36,3 +36,5 @@
#define HAS_TIME_PROFILING TRUE
#define MLton_Platform_OS_host "freebsd"
+
+extern char **environ; /* for Posix_ProcEnv_environ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.h 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.h 2006-05-25 03:03:55 UTC (rev 4592)
@@ -46,3 +46,5 @@
struct sockaddr_in6 {};
#define PF_INET6 0
#endif
+
+extern char **environ; /* for Posix_ProcEnv_environ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.h 2006-05-25 03:03:55 UTC (rev 4592)
@@ -36,4 +36,4 @@
#define MLton_Platform_OS_host "linux"
-
+extern char **environ; /* for Posix_ProcEnv_environ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.h 2006-05-25 03:03:55 UTC (rev 4592)
@@ -581,3 +581,5 @@
void openlog(const char* ident, int logopt, int facility);
void closelog(void);
void syslog(int priority, const char* fmt, const char* msg);
+
+extern char **environ; /* for Posix_ProcEnv_environ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.h 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.h 2006-05-25 03:03:55 UTC (rev 4592)
@@ -33,3 +33,5 @@
#define HAS_TIME_PROFILING TRUE
#define MLton_Platform_OS_host "netbsd"
+
+extern char **environ; /* for Posix_ProcEnv_environ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h 2006-05-25 03:03:55 UTC (rev 4592)
@@ -71,3 +71,5 @@
#ifndef PRIxPTR
#define PRIxPTR "lx"
#endif
+
+extern char **environ; /* for Posix_ProcEnv_environ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.h 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.h 2006-05-25 03:03:55 UTC (rev 4592)
@@ -55,3 +55,5 @@
#ifndef PRIxPTR
#define PRIxPTR "x"
#endif
+
+extern char **environ; /* for Posix_ProcEnv_environ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.c 2006-05-25 02:51:47 UTC (rev 4591)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.c 2006-05-25 03:03:55 UTC (rev 4592)
@@ -13,8 +13,6 @@
MLton_Platform_CygwinUseMmap = b;
}
-extern char **environ; /* for Posix_ProcEnv_environ */
-
void MLton_init (int argc, char **argv, GC_state s) {
int start;
|
|
From: Stephen W. <sw...@ml...> - 2006-05-24 19:51:50
|
First cut at compiling the runtime on Cygwin. Some problems remain.
----------------------------------------------------------------------
A mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-cygwin/c-types.sml
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c
----------------------------------------------------------------------
Added: mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-cygwin/c-types.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-cygwin/c-types.sml 2006-05-25 02:38:26 UTC (rev 4590)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-cygwin/c-types.sml 2006-05-25 02:51:47 UTC (rev 4591)
@@ -0,0 +1,131 @@
+(* Copyright (C) 2004-2006 Henry Cejtin, Matthew Fluet, Suresh
+ * Jagannathan, and Stephen Weeks.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+
+(* C *)
+structure C_Char = struct open Int8 type t = int end
+functor C_Char_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int8 (A)
+structure C_SChar = struct open Int8 type t = int end
+functor C_SChar_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int8 (A)
+structure C_UChar = struct open Word8 type t = word end
+functor C_UChar_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word8 (A)
+structure C_Short = struct open Int16 type t = int end
+functor C_Short_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int16 (A)
+structure C_SShort = struct open Int16 type t = int end
+functor C_SShort_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int16 (A)
+structure C_UShort = struct open Word16 type t = word end
+functor C_UShort_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word16 (A)
+structure C_Int = struct open Int32 type t = int end
+functor C_Int_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_SInt = struct open Int32 type t = int end
+functor C_SInt_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_UInt = struct open Word32 type t = word end
+functor C_UInt_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_Long = struct open Int32 type t = int end
+functor C_Long_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_SLong = struct open Int32 type t = int end
+functor C_SLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_ULong = struct open Word32 type t = word end
+functor C_ULong_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_LongLong = struct open Int64 type t = int end
+functor C_LongLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A)
+structure C_SLongLong = struct open Int64 type t = int end
+functor C_SLongLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A)
+structure C_ULongLong = struct open Word64 type t = word end
+functor C_ULongLong_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A)
+structure C_Float = struct open Real32 type t = real end
+functor C_Float_ChooseRealN (A: CHOOSE_REALN_ARG) = ChooseRealN_Real32 (A)
+structure C_Double = struct open Real64 type t = real end
+functor C_Double_ChooseRealN (A: CHOOSE_REALN_ARG) = ChooseRealN_Real64 (A)
+structure C_Size = struct open Word32 type t = word end
+functor C_Size_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+structure C_Pointer = struct open Word32 type t = word end
+functor C_Pointer_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_String = struct open Word32 type t = word end
+functor C_String_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_StringArray = struct open Word32 type t = word end
+functor C_StringArray_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* Generic integers *)
+structure C_Fd = C_Int
+functor C_Fd_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A)
+structure C_Signal = C_Int
+functor C_Signal_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A)
+structure C_Status = C_Int
+functor C_Status_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A)
+structure C_Sock = C_Int
+functor C_Sock_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A)
+
+(* C99 *)
+structure C_Ptrdiff = struct open Int32 type t = int end
+functor C_Ptrdiff_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_Intmax = struct open Int64 type t = int end
+functor C_Intmax_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A)
+structure C_UIntmax = struct open Word64 type t = word end
+functor C_UIntmax_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A)
+structure C_Intptr = struct open Int32 type t = int end
+functor C_Intptr_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_UIntptr = struct open Word32 type t = word end
+functor C_UIntptr_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <dirent.h> *)
+structure C_DirP = struct open Word32 type t = word end
+functor C_DirP_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <poll.h> *)
+structure C_NFds = struct open Word32 type t = word end
+functor C_NFds_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <resource.h> *)
+structure C_RLim = struct open Word32 type t = word end
+functor C_RLim_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <sys/types.h> *)
+structure C_Clock = struct open Word32 type t = word end
+functor C_Clock_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_Dev = struct open Word32 type t = word end
+functor C_Dev_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_GId = struct open Word32 type t = word end
+functor C_GId_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_Id = struct open Word32 type t = word end
+functor C_Id_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_INo = struct open Word64 type t = word end
+functor C_INo_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A)
+structure C_Mode = struct open Word32 type t = word end
+functor C_Mode_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_NLink = struct open Word16 type t = word end
+functor C_NLink_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word16 (A)
+structure C_Off = struct open Int64 type t = int end
+functor C_Off_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A)
+structure C_PId = struct open Int32 type t = int end
+functor C_PId_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_SSize = struct open Int32 type t = int end
+functor C_SSize_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_SUSeconds = struct open Int32 type t = int end
+functor C_SUSeconds_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_Time = struct open Int32 type t = int end
+functor C_Time_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_UId = struct open Word32 type t = word end
+functor C_UId_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <sys/socket.h> *)
+structure C_Socklen = struct open Int32 type t = int end
+functor C_Socklen_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+
+(* from <termios.h> *)
+structure C_CC = struct open Word8 type t = word end
+functor C_CC_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word8 (A)
+structure C_Speed = struct open Word32 type t = word end
+functor C_Speed_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_TCFlag = struct open Word32 type t = word end
+functor C_TCFlag_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from "gmp.h" *)
+structure C_MPLimb = struct open Word32 type t = word end
+functor C_MPLimb_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c 2006-05-25 02:38:26 UTC (rev 4590)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.c 2006-05-25 02:51:47 UTC (rev 4591)
@@ -48,12 +48,12 @@
/* Posix */
/* ------------------------------------------------- */
-void Posix_IO_setbin (Fd fd) {
+void Posix_IO_setbin (C_Fd_t fd) {
/* cygwin has a different method for working with its fds */
setmode (fd, O_BINARY);
}
-void Posix_IO_settext (Fd fd) {
+void Posix_IO_settext (C_Fd_t fd) {
/* cygwin has a different method for working with its fds */
setmode (fd, O_TEXT);
}
@@ -67,7 +67,7 @@
* is a secret magical pipe for sending signals and exit statuses over.
* Screw that. We implement our own cwait using pure win32.
*/
-Pid MLton_Process_cwait (Pid pid, Pointer status) {
+C_Errno_t(C_PId_t) MLton_Process_cwait(C_PId_t pid, Ref(C_Status_t) status) {
HANDLE h;
h = (HANDLE)pid;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.h 2006-05-25 02:38:26 UTC (rev 4590)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/cygwin.h 2006-05-25 02:51:47 UTC (rev 4591)
@@ -36,4 +36,20 @@
#define MSG_DONTWAIT 0x1000000
#define PF_INET6 0
-struct sockaddr_in6 {};
+struct sockaddr_in6 {
+ int dummy; // quell gcc warnings about "struct has no members"
+};
+
+typedef unsigned int nfds_t;
+typedef long suseconds_t; // type of timeval.tv_usec in sys/time.h
+
+// /usr/include/cygwin/socket.h has this ifdef'd out for now.
+#define AF_INET6 23
+
+// Unimplemented on Cygwin
+#define MSG_WAITALL 0
+#define MSG_EOR 0
+
+
+
+
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c 2006-05-25 02:38:26 UTC (rev 4590)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/windows.c 2006-05-25 02:51:47 UTC (rev 4591)
@@ -1,6 +1,31 @@
HANDLE fileDesHandle (int fd);
+#define BUFSIZE 65536
+int tempFileDes (void) {
+ /* Based on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/creating_and_using_a_temporary_file.asp
+ */
+ HANDLE hTempFile;
+ DWORD dwRetVal;
+ DWORD dwBufSize=BUFSIZE;
+ UINT uRetVal;
+ char szTempName[BUFSIZE];
+ char lpPathBuffer[BUFSIZE];
+
+ dwRetVal = GetTempPath(dwBufSize, lpPathBuffer);
+ if (dwRetVal > dwBufSize)
+ diee ("GetTempPath failed with error %ld.\n", GetLastError());
+ uRetVal = GetTempFileName(lpPathBuffer, "TempFile", 0, szTempName);
+ if (0 == uRetVal)
+ diee ("GetTempFileName failed with error %ld.\n", GetLastError());
+ hTempFile = CreateFile((LPTSTR) szTempName, GENERIC_READ | GENERIC_WRITE,
+ 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE,
+ NULL);
+ if (hTempFile == INVALID_HANDLE_VALUE)
+ diee ("CreateFile failed with error %ld.\n", GetLastError());
+ return hTempFile;
+}
+
static void displayMaps (void) {
MEMORY_BASIC_INFORMATION buf;
LPVOID lpAddress;
@@ -108,7 +133,8 @@
die ("VirtualFree decommit failed");
}
-static inline void *Windows_mmapAnon (void *start, size_t length) {
+static inline void *Windows_mmapAnon (__atribute__ ((unused)) void *start,
+ size_t length) {
void *res;
/* Use "0" instead of "start" as the first argument to VirtualAlloc
|
|
From: Matthew F. <fl...@ml...> - 2006-05-24 19:38:28
|
Include path for gmp.h on OpenBSD (and FreeBSD, as TARGET_OS wasn't being set properly). ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/bytecode/Makefile ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/bytecode/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/bytecode/Makefile 2006-05-25 00:32:01 UTC (rev 4589) +++ mlton/branches/on-20050822-x86_64-branch/bytecode/Makefile 2006-05-25 02:38:26 UTC (rev 4590) @@ -6,6 +6,7 @@ ## TARGET_ARCH = $(shell ../bin/host-arch) +TARGET_OS = $(shell ../bin/host-os) all: interpret.o interpret-gdb.o print-opcodes @@ -27,6 +28,10 @@ CFLAGS += -I/usr/local/include endif +ifeq ($(TARGET_OS), openbsd) +CFLAGS += -I/usr/local/include +endif + interpret.o: interpret.c interpret.h opcode.h $(CC) $(CFLAGS) -c -O2 interpret.c |
|
From: Stephen W. <sw...@ml...> - 2006-05-24 17:32:07
|
Renamed dtoa as gdtoa_dtoa, since dtoa is defined on Cygwin.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gdtoa-patch
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gdtoa-patch
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gdtoa-patch 2006-05-25 00:31:28 UTC (rev 4588)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gdtoa-patch 2006-05-25 00:32:01 UTC (rev 4589)
@@ -1,6 +1,6 @@
diff -P -C 2 -r gdtoa/arithchk.c gdtoa-new/arithchk.c
*** gdtoa/arithchk.c 1998-06-19 13:46:11.000000000 -0700
---- gdtoa-new/arithchk.c 2006-05-10 14:12:02.477056503 -0700
+--- gdtoa-new/arithchk.c 2006-05-24 17:02:44.303399187 -0700
***************
*** 137,141 ****
}
@@ -14,18 +14,45 @@
! int main()
{
Akind *a = 0;
+Binary files gdtoa/arithchk.out and gdtoa-new/arithchk.out differ
+diff -P -C 2 -r gdtoa/dtoa.c gdtoa-new/dtoa.c
+*** gdtoa/dtoa.c 2000-11-02 07:09:01.000000000 -0800
+--- gdtoa-new/dtoa.c 2006-05-24 17:04:27.987435180 -0700
+***************
+*** 81,85 ****
+
+ char *
+! dtoa
+ #ifdef KR_headers
+ (d, mode, ndigits, decpt, sign, rve)
+--- 81,85 ----
+
+ char *
+! gdtoa_dtoa
+ #ifdef KR_headers
+ (d, mode, ndigits, decpt, sign, rve)
diff -P -C 2 -r gdtoa/gdtoa.h gdtoa-new/gdtoa.h
*** gdtoa/gdtoa.h 2000-11-01 07:01:39.000000000 -0800
---- gdtoa-new/gdtoa.h 2006-05-10 14:06:30.680495461 -0700
+--- gdtoa-new/gdtoa.h 2006-05-24 17:04:17.015912822 -0700
***************
-*** 114,119 ****
+*** 109,119 ****
+ #endif
+
+! extern char* dtoa ANSI((double d, int mode, int ndigits, int *decpt,
+ int *sign, char **rve));
+ extern char* gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp,
int mode, int ndigits, int *decpt, char **rve));
extern void freedtoa ANSI((char*));
! extern float strtof ANSI((CONST char *, char **));
! extern double strtod ANSI((CONST char *, char **));
extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*));
---- 114,119 ----
+--- 109,119 ----
+ #endif
+
+! extern char* gdtoa_dtoa ANSI((double d, int mode, int ndigits, int *decpt,
+ int *sign, char **rve));
+ extern char* gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp,
int mode, int ndigits, int *decpt, char **rve));
extern void freedtoa ANSI((char*));
! extern float gdtoa_strtof ANSI((CONST char *, char **));
@@ -34,7 +61,7 @@
diff -P -C 2 -r gdtoa/strtod.c gdtoa-new/strtod.c
*** gdtoa/strtod.c 2003-03-21 13:24:01.000000000 -0800
---- gdtoa-new/strtod.c 2006-05-10 14:05:47.597263849 -0700
+--- gdtoa-new/strtod.c 2006-05-24 17:02:44.309398379 -0700
***************
*** 59,63 ****
@@ -50,7 +77,7 @@
(s00, se) CONST char *s00; char **se;
diff -P -C 2 -r gdtoa/strtof.c gdtoa-new/strtof.c
*** gdtoa/strtof.c 2000-11-01 20:31:40.000000000 -0800
---- gdtoa-new/strtof.c 2006-05-10 14:06:15.872478149 -0700
+--- gdtoa-new/strtof.c 2006-05-24 17:02:44.309398379 -0700
***************
*** 38,46 ****
#include "gdtoaimp.h"
|