Commit 7d3f6bb4 authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur 🏘
Browse files

johnvg: write clean linker output object file to Temp/linker_out.o,

pass stack size with -Xlinker
parent dd91e253
...@@ -476,7 +476,7 @@ where ...@@ -476,7 +476,7 @@ where
genasm = case genAsmOrCode of genasm = case genAsmOrCode of
AsmGeneration -> " -a" AsmGeneration -> " -a"
_ -> "" _ -> ""
/* Links the given file: /* Links the given file:
*/ */
...@@ -526,6 +526,7 @@ Link linker` winfun path ...@@ -526,6 +526,7 @@ Link linker` winfun path
# linkerpath = RemoveFilename linker # linkerpath = RemoveFilename linker
# linkoptspath = MakeFullPathname TempDir "linkopts" # linkoptspath = MakeFullPathname TempDir "linkopts"
# linkerrspath = MakeFullPathname TempDir "linkerrs" # linkerrspath = MakeFullPathname TempDir "linkerrs"
# linker_out_o_path = MakeFullPathname TempDir "linker_out.o"
# (err,ps) = accFiles (WriteLinkOpts linkoptspath linkopts) ps # (err,ps) = accFiles (WriteLinkOpts linkoptspath linkopts) ps
| isJust err | isJust err
= (winfun (fromJust err) ps,False) = (winfun (fromJust err) ps,False)
...@@ -538,20 +539,21 @@ Link linker` winfun path ...@@ -538,20 +539,21 @@ Link linker` winfun path
= (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" | ProcessorSuffix processor == ".o"
# ((ok,errs),ps) = accFiles (link_mach_o_files` (objectFileNames ++ staticFileNames) path) ps # ((ok,errs),ps) = accFiles (link_mach_o_files` (objectFileNames ++ staticFileNames) linker_out_o_path) ps
# command = # command =
( "/usr/bin/cc " ( "/usr/bin/cc "
/* /*
+++ concat_object_file_names objectFileNames +++ concat_object_file_names objectFileNames
+++ concat_object_file_names staticFileNames +++ concat_object_file_names staticFileNames
*/ */
+++ "'" +++ to_unix_path path +++ "'" +++ "'" +++ to_unix_path linker_out_o_path +++ "'"
+++ " -framework Carbon" +++ " -framework Carbon"
+++ " -o '" +++ " -o '"
+++ to_unix_path path +++ to_unix_path path
+++ "'" +++ "'"
// +++ " -g" // for debugging syms // +++ " -g" // for debugging syms
+++ if (ss > standard_mosx_stack) (" -stack-size " +++ stack_size) "" +++ "-Xlinker -stack_addr -Xlinker 0xc0000000 -Xlinker -stack_size -Xlinker 0x"+++stack_size_aligned_4k_hex_string
// +++ if (ss > standard_mosx_stack) (" -stack-size " +++ stack_size_aligned_4k_hex_string) ""
+++ linker` +++ linker`
// +++ " -L/sw/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0" // // +++ " -L/sw/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0" //
// +++ " -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv " // +++ " -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv "
...@@ -584,7 +586,7 @@ Link linker` winfun path ...@@ -584,7 +586,7 @@ Link linker` winfun path
= (winfun errtext ps,link_ok) = (winfun errtext ps,link_ok)
= (ps,link_ok) = (ps,link_ok)
where where
stack_size = hex_int (roundup_to_multiple ss 4096) stack_size_aligned_4k_hex_string = hex_int (roundup_to_multiple ss 4096)
standard_mosx_stack = 0x080000 // 512K standard_mosx_stack = 0x080000 // 512K
link_mach_o_files` o_files app_path files link_mach_o_files` o_files app_path files
...@@ -1246,15 +1248,7 @@ where ...@@ -1246,15 +1248,7 @@ where
////// //////
//import code from "cpathutil.xo" //import code from "cpathutil.xo"
import code from library "winmod_library" import code from library "winmod_library"
/*
Start
# p1 = to_unix_path "Macintosh HD:Users:diederik:Desktop:MacCleanTools:Mac:PmCleanSystem.icl"
p2 = to_unix_path "Macintosh HD:Users:diederik:Desktop:CleanImage.1:Libraries:StdEnv 2.0.2:Clean System Files:_startup2.o"
p3 = to_unix_path "Macintosh HD:Users:diederik:Desktop:MacCleanTools:Mac:PmCleanSystem.icl"
p4 = to_unix_path "Macintosh HD:Users:diederik:Desktop:CleanImage.1:Libraries:StdEnv 2.0.2:Clean System Files:_startup2.o"
p5 = to_unix_path "Macintosh HD:Users:diederik:Desktop:MacCleanTools:Mac:PmCleanSystem.icl"
= (p1,p2,p3,p4,p5)
*/
hfs2posix :: !String !String !Int !*OSToolbox -> (!Int,!*OSToolbox) hfs2posix :: !String !String !Int !*OSToolbox -> (!Int,!*OSToolbox)
hfs2posix _ _ _ _ = code { hfs2posix _ _ _ _ = code {
ccall hfs2posix "ssI:I:I" ccall hfs2posix "ssI:I:I"
......
Supports Markdown
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