Commit 94a3d69a authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

Use Processor info;

parent 26ce41dd
...@@ -11,7 +11,7 @@ import PmCompilerOptions ...@@ -11,7 +11,7 @@ import PmCompilerOptions
import PmTypes import PmTypes
//ifWindows w o :== o //ifWindows w o :== o
standardStaticLibraries :: !LinkMethod -> List String standardStaticLibraries :: !Processor !LinkMethod -> List String
standardObjectFiles :: !Bool !Bool !Processor -> List String standardObjectFiles :: !Bool !Bool !Processor -> List String
getLibs :: ![String] !*Files -> (!(![String],![String]),!*Files) getLibs :: ![String] !*Files -> (!(![String],![String]),!*Files)
...@@ -121,7 +121,8 @@ Link :: // Links the given file: ...@@ -121,7 +121,8 @@ Link :: // Links the given file:
!String // name of file containing symbols to be exported from dll !String // name of file containing symbols to be exported from dll
!Pathname // startup directory !Pathname // startup directory
!String // dynamic linker name !String // dynamic linker name
!Bool // add 'carb' 0 resource? // !Bool // add 'carb' 0 resource?
!Processor // target processor
!*(PSt .l) // state !*(PSt .l) // state
-> ->
( !*(PSt .l) // state ( !*(PSt .l) // state
......
...@@ -25,7 +25,8 @@ import Platform ...@@ -25,7 +25,8 @@ import Platform
KAEQueueReply :== 2 KAEQueueReply :== 2
//import StdDebug,dodebug //import StdDebug,dodebug
import dodebug //import nodebug
import nodebug
trace_n _ f :== f trace_n _ f :== f
fopena :== fopen fopena :== fopen
...@@ -51,8 +52,12 @@ send_command_to_clean_compiler_ca a b c ...@@ -51,8 +52,12 @@ send_command_to_clean_compiler_ca a b c
:== send_command_to_clean_compiler a b c :== send_command_to_clean_compiler a b c
// = (0,0,"") // = (0,0,"")
standardStaticLibraries :: !LinkMethod -> List String standardStaticLibraries :: !Processor !LinkMethod -> List String
standardStaticLibraries method standardStaticLibraries processor method
| ProcessorSuffix processor == ".cxo" // PowerPC Classic
= case method of
LM_Static -> ("cxo_library0" :! "cxo_library1" :! "cxo_library2" :! Nil)
LM_Dynamic -> ("cxo_library0" :! "cxo_library1" :! "cxo_library2" :! Nil)
= case method of = case method of
LM_Static -> ("library0" :! "library1" :! "library2" :! Nil) LM_Static -> ("library0" :! "library1" :! "library2" :! Nil)
// LM_Eager -> ("library0" :! "library1" :! "library2" :! Nil) // LM_Eager -> ("library0" :! "library1" :! "library2" :! Nil)
...@@ -483,13 +488,13 @@ where ...@@ -483,13 +488,13 @@ where
Link :: !String !(WindowFun *(PSt .l)) !Pathname !ApplicationOptions Link :: !String !(WindowFun *(PSt .l)) !Pathname !ApplicationOptions
!Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool !Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool
!Bool !Bool !Bool !String !Bool !String !Pathname !String !Bool !*(PSt .l) !Bool !Bool !Bool !String !Bool !String !Pathname !String !Processor/*!Bool*/ !*(PSt .l)
-> (!*(PSt .l),!Bool) -> (!*(PSt .l),!Bool)
Link linker` winfun path Link linker` winfun path
applicationOptions=:{fs,fn,em,ss,hs,initial_heap_size,profiling,heap_size_multiple,o,memoryProfilingMinimumHeapSize=minheap} applicationOptions=:{fs,fn,em,ss,hs,initial_heap_size,profiling,heap_size_multiple,o,memoryProfilingMinimumHeapSize=minheap}
optionspathname library_file_names object_file_names optionspathname library_file_names object_file_names
static_libraries static gen_relocs gen_linkmap static_libraries static gen_relocs gen_linkmap
link_resources resource_path gen_dll dll_names startupdir dynlinker add_carb_resource ps link_resources resource_path gen_dll dll_names startupdir dynlinker processor/*add_carb_resource*/ ps
# (ok,linker) = mangleLinker linker` startupdir # (ok,linker) = mangleLinker linker` startupdir
| not ok | not ok
# ps = winfun [linker] ps # ps = winfun [linker] ps
...@@ -536,7 +541,8 @@ Link linker` winfun path ...@@ -536,7 +541,8 @@ Link linker` winfun path
| isEmpty objectFileNames | isEmpty objectFileNames
= (winfun ["Linker error: No objects to link."] ps,False) = (winfun ["Linker error: No objects to link."] ps,False)
| isMachOObject (hd objectFileNames) // | isMachOObject (hd objectFileNames)
| ProcessorSuffix processor == ".o"
# (r1,r2) = send_command_to_application False "EXEC" # (r1,r2) = send_command_to_application False "EXEC"
( "/usr/bin/cc " ( "/usr/bin/cc "
+++ concat_object_file_names objectFileNames +++ concat_object_file_names objectFileNames
...@@ -556,7 +562,7 @@ Link linker` winfun path ...@@ -556,7 +562,7 @@ Link linker` winfun path
= (winfun ["Linker error: "+++toString r1] ps,False) = (winfun ["Linker error: "+++toString r1] ps,False)
# ((link_ok,link_errors),ps) # ((link_ok,link_errors),ps)
= accFiles (link_xcoff_files objectFileNames libraryFileNames path = accFiles (link_xcoff_files objectFileNames libraryFileNames path
(fs,fn) hs heap_size_multiple ss flags em initial_heap_size minheap False add_carb_resource) ps (fs,fn) hs heap_size_multiple ss flags em initial_heap_size minheap False (if (ProcessorSuffix processor == ".xo") True False)/*add_carb_resource*/) ps
# (errtext,errlines) = (link_errors, length link_errors); # (errtext,errlines) = (link_errors, length link_errors);
| errlines<>0 | errlines<>0
...@@ -607,7 +613,8 @@ concat_object_file_names [] ...@@ -607,7 +613,8 @@ concat_object_file_names []
import linker_resources; import linker_resources;
import code from import code from
// "call_system_framework.o"; // "call_system_framework.o";
"call_system_framework.","pointer_glue." // "call_system_framework.","pointer_glue."
"cUtilSystem."
to_unix_path p to_unix_path p
# inpath = p +++ "\0" # inpath = p +++ "\0"
...@@ -616,7 +623,7 @@ to_unix_path p ...@@ -616,7 +623,7 @@ to_unix_path p
# (res,_) = hfs2posix inpath buffer bsize OSNewToolbox # (res,_) = hfs2posix inpath buffer bsize OSNewToolbox
| res <> 0 | res <> 0
# posix = toString (takeWhile ((<>) '\0') [c \\ c <-: buffer]) # posix = toString (takeWhile ((<>) '\0') [c \\ c <-: buffer])
= trace_n` ("Path",posix) posix = trace_n ("Path",posix) posix
/* /*
to_unix_path p = "/Volumes/"+++ to_unix_path 0 p; to_unix_path p = "/Volumes/"+++ to_unix_path 0 p;
where where
...@@ -862,7 +869,7 @@ send_command_to_clean_compiler0 signature command wait tb ...@@ -862,7 +869,7 @@ send_command_to_clean_compiler0 signature command wait tb
= if (error_code6<>0) 0 v1 = if (error_code6<>0) 0 v1
# output_string # output_string
= if (error_code7<>0) "" (result_string % (0,s2-1)) = if (error_code7<>0) "" (result_string % (0,s2-1))
# tb = trace_n` ("CALL",error_code6,v1,error_code7,s2) tb # tb = trace_n ("CALL",error_code6,v1,error_code7,s2) tb
= (os_error_code,error_n,output_string,tb) = (os_error_code,error_n,output_string,tb)
where where
loop tb loop tb
...@@ -1186,7 +1193,7 @@ where ...@@ -1186,7 +1193,7 @@ where
= FindChar c line linelen (inc pos); = FindChar c line linelen (inc pos);
////// //////
import code from "cpathutil.xo" //import code from "cpathutil.xo"
import code from library "winmod_library" import code from library "winmod_library"
/* /*
Start Start
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment