CVS: sml-dist/src/compiler/TopLevel/backend backend-fn.sml,1.7,1.8 backend.sig,1.2,1.3 x86-ccall.sml,1.3,1.4 x86-stdcall.sml,1.3,1.4

Matthias Blume <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj.commits
Message-ID <[email protected]>
Update of /cvsroot/smlnj/sml-dist/src/compiler/TopLevel/backend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9167/src/compiler/TopLevel/backend

Modified Files:
	backend-fn.sml backend.sig x86-ccall.sml x86-stdcall.sml 
Log Message:
hooked intel mac abi code into main system

Index: backend-fn.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/compiler/TopLevel/backend/backend-fn.sml,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** backend-fn.sml	12 Mar 2002 22:28:54 -0000	1.7
--- backend-fn.sml	14 Feb 2006 23:31:16 -0000	1.8
***************
*** 86,88 ****
--- 86,89 ----
      structure Machine = M.Machine
      val architecture = M.architecture
+     val abi_variant = M.abi_variant
  end

Index: backend.sig
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/compiler/TopLevel/backend/backend.sig,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** backend.sig	19 Jul 2001 18:59:35 -0000	1.2
--- backend.sig	14 Feb 2006 23:31:16 -0000	1.3
***************
*** 9,11 ****
--- 9,12 ----
      structure Machine : MACHINE
      val architecture: string
+     val abi_variant: string option
  end

Index: x86-ccall.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/compiler/TopLevel/backend/x86-ccall.sml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** x86-ccall.sml	7 Mar 2002 21:16:27 -0000	1.3
--- x86-ccall.sml	14 Feb 2006 23:31:16 -0000	1.4
***************
*** 6,11 ****
      (* turn on "fast-fp"... *)
      val _ = MLRiscControl.flag "x86-fast-fp" := true
  in
! structure X86CCallBackend = BackendFn (structure M = X86MC
! 				       val cproto_conv = "ccall")
  end
--- 6,34 ----
      (* turn on "fast-fp"... *)
      val _ = MLRiscControl.flag "x86-fast-fp" := true
+     (* The following is a GROSS HACK!
+      *
+      * Eventually we need to generate separate binaries for the
+      * IntelMac platform.  This code figures out dynamically
+      * whether it is running Darwin (i.e., Mac OS X on an Intel),
+      * but this does not work correctly when cross-compiling.
+      * In particular, once the compiler or any of the libraries
+      * that get compiled by the cross-compiler starts using NLFFI,
+      * then things will start to break.
+      *
+      * Also, the cross-compiler will not set the ABI_Darwin symbol
+      * correctly for CM's conditional compilation mechanism, so the
+      * compiler sources cannot rely on it!
+      *)
+     val (fa, rssir, av) =
+ 	case SMLofNJ.SysInfo.getOSName () of
+ 	    "Darwin" => (16, true, SOME "Darwin")
+ 	  | _ => (4, false, NONE)
  in
! structure X86CCallBackend =
!           BackendFn (structure M = X86MC (structure CCallParams = struct
! 					    val frameAlign = fa
! 					    val returnSmallStructsInRegs = rssir
! 					  end
! 					  val abi_variant = av)
! 		     val cproto_conv = "ccall")
  end

Index: x86-stdcall.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/compiler/TopLevel/backend/x86-stdcall.sml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** x86-stdcall.sml	7 Mar 2002 21:16:27 -0000	1.3
--- x86-stdcall.sml	14 Feb 2006 23:31:16 -0000	1.4
***************
*** 7,11 ****
      val _ = MLRiscControl.flag "x86-fast-fp" := true
  in
! structure X86StdCallBackend = BackendFn (structure M = X86MC
! 					 val cproto_conv = "stdcall")
  end
--- 7,16 ----
      val _ = MLRiscControl.flag "x86-fast-fp" := true
  in
! structure X86StdCallBackend =
!           BackendFn (structure M = X86MC (structure CCallParams = struct
! 					    val frameAlign = 4
! 					    val returnSmallStructsInRegs = false
! 					  end
! 					  val abi_variant = NONE)
!                      val cproto_conv = "stdcall")
  end



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.