Commit cb4ec5c2 authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur

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

pass stack size with -Xlinker
parent 85d85d1d
......@@ -476,7 +476,7 @@ where
genasm = case genAsmOrCode of
AsmGeneration -> " -a"
_ -> ""
/* Links the given file:
*/
......@@ -526,6 +526,7 @@ Link linker` winfun path
# linkerpath = RemoveFilename linker
# linkoptspath = MakeFullPathname TempDir "linkopts"
# linkerrspath = MakeFullPathname TempDir "linkerrs"
# linker_out_o_path = MakeFullPathname TempDir "linker_out.o"
# (err,ps) = accFiles (WriteLinkOpts linkoptspath linkopts) ps
| isJust err
= (winfun (fromJust err) ps,False)
......@@ -538,20 +539,21 @@ Link linker` winfun path
= (winfun ["Linker error: No objects to link."] ps,False)
// | isMachOObject (hd objectFileNames)
| 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 =
( "/usr/bin/cc "
/*
+++ concat_object_file_names objectFileNames
+++ concat_object_file_names staticFileNames
*/
+++ "'" +++ to_unix_path path +++ "'"
+++ "'" +++ to_unix_path linker_out_o_path +++ "'"
+++ " -framework Carbon"
+++ " -o '"
+++ to_unix_path path
+++ "'"
// +++ " -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`
// +++ " -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 "
......@@ -584,7 +586,7 @@ Link linker` winfun path
= (winfun errtext ps,link_ok)
= (ps,link_ok)
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
link_mach_o_files` o_files app_path files
......@@ -1246,15 +1248,7 @@ where
//////
//import code from "cpathutil.xo"
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 _ _ _ _ = code {
ccall hfs2posix "ssI:I:I"
......
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