Commit 960b2eb0 authored by John van Groningen's avatar John van Groningen

add 64 bit processor check box in environment dialog, add writing of

options file for amd 64
parent 6a1520eb
......@@ -173,6 +173,7 @@ getCurrentLink :: !*(PSt *General) -> (!String,!*PSt *General)
getCurrentDynl :: !*(PSt *General) -> (!String,!*PSt *General)
getCurrentVers :: !*(PSt *General) -> (!Int,!*PSt *General)
getCurrentRedc :: !*(PSt *General) -> (!Bool,!*PSt *General)
getCurrent64BitProcessor :: !*(PSt *General) -> (!Bool,!*PSt *General)
getCurrentProc :: !*(PSt *General) -> (!Processor,!*PSt *General)
getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General)
......
......@@ -451,6 +451,11 @@ getCurrentVers ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps
= (ct.target_vers,ps)
getCurrent64BitProcessor :: !*(PSt *General) -> (!Bool,!*PSt *General)
getCurrent64BitProcessor ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps
= (ct.env_64_bit_processor,ps)
getCurrentRedc :: !*(PSt *General) -> (!Bool,!*PSt *General)
getCurrentRedc ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps
......
......@@ -626,6 +626,7 @@ toolpane tg compId cgenId linkId dynlId versId methId
[ ControlId versId
, ControlActivate (noLS (appPIO (setEditControlSelection versId 1 0)))
]
:+: CheckControl [("64 bit processor",Nothing,toMark tg.env_64_bit_processor,env_64_bit_processor_check_box_handler)] (Columns 1) [ControlPos (Left,zero)]
:+: PlatformDependant
( CheckControl [("Console in IDE",Nothing,toMark tg.target_redc,redcfun)] (Columns 1) [ControlPos (Left,zero)])
( TextControl "Processor: " [ControlPos (Left,zero), ControlWidth textWidth]
......@@ -662,6 +663,10 @@ where
redcfun (ls,ps)
# ls = {ls & tg.target_redc = not ls.tg.target_redc}
= (ls,ps)
env_64_bit_processor_check_box_handler (ls,ps)
# ls = {ls & tg.env_64_bit_processor = not ls.tg.env_64_bit_processor}
= (ls,ps)
procfun proc (ls,ps)
# ls = {ls & tg.target_proc = proc}
......
......@@ -6,4 +6,4 @@ import
ApplicationOptionsToFlags :: !ApplicationOptions -> Int
FlagsToApplicationOptions :: !Int !ApplicationOptions -> ApplicationOptions
write_options_file :: !{#.Char} !.Int !.Int !.Int !.Int !.Int !.Int !*a -> *(!Bool,!*a) | FileSystem a
write_options_file :: !{#.Char} !.Int !.Int !.Int !.Int !.Int !.Int !Bool !*a -> *(!Bool,!*a) | FileSystem a
......@@ -59,9 +59,16 @@ where
// otherwise
= ShowConstructors;
write_options_file :: !{#.Char} !.Int !.Int !.Int !.Int !.Int !.Int !*a -> *(!Bool,!*a) | FileSystem a;
write_options_file :: !{#.Char} !.Int !.Int !.Int !.Int !.Int !.Int !Bool !*a -> *(!Bool,!*a) | FileSystem a;
write_options_file options_file_name flags heap_size stack_size initial_heap_size heap_size_multiple min_write_heap_size files
write_options_file options_file_name flags heap_size stack_size initial_heap_size heap_size_multiple min_write_heap_size use_64_bit_processor files
| use_64_bit_processor
= write_options_file_64 options_file_name flags heap_size stack_size initial_heap_size heap_size_multiple min_write_heap_size files
= write_options_file_32 options_file_name flags heap_size stack_size initial_heap_size heap_size_multiple min_write_heap_size files
write_options_file_32 :: !{#.Char} !.Int !.Int !.Int !.Int !.Int !.Int !*a -> *(!Bool,!*a) | FileSystem a;
write_options_file_32 options_file_name flags heap_size stack_size initial_heap_size heap_size_multiple min_write_heap_size files
# (opened,file,files)
= fopen options_file_name FWriteData files
| not opened
......@@ -362,7 +369,317 @@ where
heap_size_multiple_offset = 49;
min_write_heap_size_offset = 69;
write_options_file_64 :: !{#.Char} !.Int !.Int !.Int !.Int !.Int !.Int !*a -> *(!Bool,!*a) | FileSystem a;
write_options_file_64 options_file_name flags heap_size stack_size initial_heap_size heap_size_multiple min_write_heap_size files
# (opened,file,files)
= fopen options_file_name FWriteData files
| not opened
= (False,files)
#! file = file
// header offset 0
FWW machine_type_64
FWW n_sections
FWI time_date_stamp
FWI symbol_table_pointer
FWI n_symbols
FWW optional_header_size
FWW characteristics
// text section header offset 20
FWS ".text\0\0\0"
FWI text_virtual_size
FWI text_rva_offset
FWI text_raw_data_size
FWI text_raw_data_pointer
FWI text_relocs_pointer
FWI text_linenumbers_pointer
FWW text_n_relocs
FWW text_n_linenumbers
FWI text_section_flags
// data section header offset 60
FWS ".data\0\0\0"
FWI data_virtual_size
FWI data_rva_offset
FWI data_raw_data_size
FWI data_raw_data_pointer
FWI data_relocs_pointer
FWI data_linenumbers_pointer
FWW data_n_relocs
FWW data_n_linenumbers
FWI data_section_flags
// bss section header offset 100
FWS ".bss\0\0\0\0"
FWI bss_virtual_size
FWI bss_rva_offset
FWI bss_raw_data_size
FWI bss_raw_data_pointer
FWI bss_relocs_pointer
FWI bss_linenumbers_pointer
FWW bss_n_relocs
FWW bss_n_linenumbers
FWI bss_section_flags
// data section offset 140
FWI heap_size
FWI 0
FWI stack_size
FWI 0
FWI flags
FWI 0
FWI initial_heap_size
FWI 0
FWI heap_size_multiple
FWI 0
FWI min_write_heap_size
FWI 0
// symbol table offset
// .file at 188
FWS file_name
FWI file_value
FWW file_section_n
FWW file_type
FWB file_storage_class
FWB file_n_aux_sections
// fake (aux to .file) at 206
FWS file_aux_name
FWI file_aux_value
FWW file_aux_section_n
FWW file_aux_type
FWB file_aux_storage_class
FWB file_aux_n_aux_sections
// .text at 224
FWS text_name
FWI text_value
FWW text_section_n
FWW text_type
FWB text_storage_class
FWB text_n_aux_sections
// null to .text at 238
FWI text_raw_data_size FWS null_aux_entry
// .data at 260
FWS data_name
FWI data_value
FWW data_section_n
FWW data_type
FWB data_storage_class
FWB data_n_aux_sections
// null to .data at 278
FWI data_raw_data_size FWS null_aux_entry
// .bss at 296
FWS bss_name
FWI bss_value
FWW bss_section_n
FWW bss_type
FWB bss_storage_class
FWB bss_n_aux_sections
// null to .bss at 3140
FWI bss_raw_data_size FWS null_aux_entry
// _heap_size at 330
FWI 0 FWI heap_size_offset
FWI heap_size_value
FWW heap_size_section_n
FWW heap_size_type
FWB heap_size_class
FWB heap_size_n_aux_sections
// _ab_stack_size at 360
FWI 0 FWI ab_stack_size_offset
FWI ab_stack_size_value
FWW ab_stack_size_section_n
FWW ab_stack_size_type
FWB ab_stack_size_class
FWB ab_stack_size_n_aux_sections
// _flags at 368
FWS flags_name
FWI flags_value
FWW flags_section_n
FWW flags_type
FWB flags_class
FWB flags_n_aux_sections
// _initial_heap_size at 386
FWI 0 FWI initial_heap_size_offset
FWI initial_heap_size_value
FWW initial_heap_size_section_n
FWW initial_heap_size_type
FWB initial_heap_size_class
FWB initial_heap_size_n_aux_sections
// _heap_size_multiple at 302
FWI 0 FWI heap_size_multiple_offset
FWI heap_size_multiple_value
FWW heap_size_multiple_section_n
FWW heap_size_multiple_type
FWB heap_size_multiple_class
FWB heap_size_multiple_n_aux_sections
// _min_write_heap_size at 420
FWI 0 FWI min_write_heap_size_offset
FWI min_write_heap_size_value
FWW min_write_heap_size_section_n
FWW min_write_heap_size_type
FWB min_write_heap_size_class
FWB min_write_heap_size_n_aux_sections
// string table at 438
FWI (size string_table + 4)
FWS string_table
# (close_ok,files)
= fclose file files
= (close_ok,files)
where
// coff header
n_sections = 3
machine_type_64 = 0x8664
time_date_stamp = 817729185
symbol_table_pointer = 188
n_symbols = 14
optional_header_size = 0
characteristics = 0x0104
// .text section
text_virtual_size = 0
text_rva_offset = 0
text_raw_data_size = 0
text_raw_data_pointer = 0
text_relocs_pointer = 0
text_linenumbers_pointer = 0
text_n_relocs = 0
text_n_linenumbers = 0
text_section_flags = 0x60000020
// .data section
data_virtual_size = 0
data_rva_offset = 0
data_raw_data_size = 48
data_raw_data_pointer = 140
data_relocs_pointer = 0
data_linenumbers_pointer = 0
data_n_relocs = 0
data_n_linenumbers = 0
data_section_flags = 0xc0000040
// .bss section
bss_virtual_size = 0
bss_rva_offset = 20
bss_raw_data_size = 0
bss_raw_data_pointer = 0
bss_relocs_pointer = 0
bss_linenumbers_pointer = 0
bss_n_relocs = 0
bss_n_linenumbers = 0
bss_section_flags = 0xc0000080
// symbol table
// entry #1
file_name = ".file\0\0\0"
file_value = 0
file_section_n = IMAGE_SYM_DEBUG
file_type = 0
file_storage_class = IMAGE_SYM_CLASS_FILE
file_n_aux_sections = 1
// entry #2
file_aux_name = "fake\0\0\0\0"
file_aux_value = 0
file_aux_section_n = IMAGE_SYM_UNDEFINED
file_aux_type = 0
file_aux_storage_class = IMAGE_SYM_CLASS_NULL
file_aux_n_aux_sections = 0
// entry #3: .text
text_name = ".text\0\0\0"
text_value = 0
text_section_n = 1
text_type = 0
text_storage_class = IMAGE_SYM_CLASS_STATIC
text_n_aux_sections = 1
// entry #5: .data
data_name = ".data\0\0\0"
data_value = 0
data_section_n = 2
data_type = 0
data_storage_class = IMAGE_SYM_CLASS_STATIC
data_n_aux_sections = 1
// entry #7: .bss
bss_name = ".bss\0\0\0\0"
bss_value = 20
bss_section_n = 3
bss_type = 0
bss_storage_class = IMAGE_SYM_CLASS_STATIC
bss_n_aux_sections = 1
// entry #9: _heap_size
heap_size_value = 0
heap_size_section_n = 2
heap_size_type = 0
heap_size_class = IMAGE_SYM_CLASS_EXTERNAL
heap_size_n_aux_sections = 0
// entry #10: _ab_stack_size
ab_stack_size_value = 8
ab_stack_size_section_n = 2
ab_stack_size_type = 0
ab_stack_size_class = IMAGE_SYM_CLASS_EXTERNAL
ab_stack_size_n_aux_sections = 0
// entry #11: _flags
flags_name = "flags\0\0\0"
flags_value = 16
flags_section_n = 2
flags_type = 0
flags_class = IMAGE_SYM_CLASS_EXTERNAL
flags_n_aux_sections = 0
// entry #12: _initial_heap_size
initial_heap_size_value = 24
initial_heap_size_section_n = 2
initial_heap_size_type = 0
initial_heap_size_class = IMAGE_SYM_CLASS_EXTERNAL
initial_heap_size_n_aux_sections = 0
// entry #13: _heap_size_multiple
heap_size_multiple_value = 32
heap_size_multiple_section_n = 2
heap_size_multiple_type = 0
heap_size_multiple_class = IMAGE_SYM_CLASS_EXTERNAL
heap_size_multiple_n_aux_sections = 0
// entry #14: _min_write_heap_size
min_write_heap_size_value = 40
min_write_heap_size_section_n = 2
min_write_heap_size_type = 0
min_write_heap_size_class = IMAGE_SYM_CLASS_EXTERNAL
min_write_heap_size_n_aux_sections = 0
null_aux_entry = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
string_table
// 10 20 30 40 50 60 70 80
// 45678901234 567890123456789 0123456789012345678 90123456789012345678 901234567890123456789
= "heap_size\0\0ab_stack_size\0\0initial_heap_size\0\0heap_size_multiple\0\0min_write_heap_size\0\0"
heap_size_offset = 4;
ab_stack_size_offset = 15;
initial_heap_size_offset = 30;
heap_size_multiple_offset = 49;
min_write_heap_size_offset = 69;
IMAGE_SYM_DEBUG :== 65534
IMAGE_SYM_UNDEFINED :== 0
......
......@@ -931,6 +931,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
# optionspath = MakeOptionsName prj_path tp
# (dynlstr,ps) = getCurrentDynl ps
# (use_64_bit_processor,ps) = getCurrent64BitProcessor ps
# (ps, ok) = Link linkstr updateErrorWindow execpath ao
optionspath lfiles ofiles sfiles
(lo.method == LM_Static)
......@@ -940,7 +941,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
(fulPath app_path prj_path` lo.resource_source)
lo.generate_dll
(fulPath app_path prj_path` lo.dll_export_list_name)
startupdir dynlstr tp/*lo.add_carb_resource*/ ps
startupdir dynlstr use_64_bit_processor tp/*lo.add_carb_resource*/ ps
# project = if ok (PR_SetLinked project) project
= continue ok False ok fileinfo libsinfo modpaths project intr (abccache, ps)
where
......
......@@ -17,6 +17,7 @@ EnvsFileName :== "IDEEnvs"
, target_link :: !String // static/eager linker
, target_dynl :: !String // dynamic linker
, target_vers :: !Int // abc version
, env_64_bit_processor :: !Bool
, target_redc :: !Bool // redirect console?
, target_meth :: !CompileMethod // compile strategy
, target_proc :: !Processor // object type
......
......@@ -12,13 +12,11 @@ import PmTypes
EnvsFileName :== "IDEEnvs"
emptyTargets
// = [t_StdEnv13,t_StdIO13] // 1.3
= [t_StdEnv20,t_StdIO20] // 2.0
= [t_StdEnv20,t_StdIO20]
t_StdEnv :: Target
t_StdEnv
// = t_StdEnv13 // 1.3
= t_StdEnv20 // 2.0
= t_StdEnv20
:: Target =
{ target_name :: !String // environment identifier
......@@ -31,6 +29,7 @@ t_StdEnv
, target_link :: !String // static/eager linker
, target_dynl :: !String // dynamic linker
, target_vers :: !Int // abc version
, env_64_bit_processor :: !Bool
, target_redc :: !Bool // redirect console?
, target_meth :: !CompileMethod // compile strategy
, target_proc :: !Processor // object type
......@@ -130,6 +129,7 @@ emptyTarget =
, target_link = ""
, target_dynl = ""
, target_vers = 42
, env_64_bit_processor = False
, target_redc = False
, target_meth = CompileSync
, target_proc = DefaultProcessor
......@@ -159,15 +159,17 @@ TargetTable =
, SimpleOption "EnvironmentLinker" (\a->a.target_link) (\v a->{a & target_link=v})
, SimpleOption "EnvironmentDynLink" (\a->a.target_dynl) (\v a->{a & target_dynl=v})
, SimpleOption "EnvironmentVersion" (\a->toString a.target_vers) (\v a->{a & target_vers=toInt v})
, SimpleOption "EnvironmentRedirect" (\a->b2s a.target_redc) (\v a->{a & target_redc=s2b v})
, SimpleOption "EnvironmentRedirect" (\a->b2s a.target_redc) (\v a->{a & target_redc=string_to_bool v})
, SimpleOption "EnvironmentCompileMethod" (\a->m2s a.target_meth) (\v a->{a & target_meth=s2m v})
, SimpleOption "EnvironmentProcessor" (\a->toString a.target_proc) (\v a->{a & target_proc=fromString v})
, SimpleOption "Environment64BitProcessor" (\a->toString a.env_64_bit_processor) (\v a->{a & env_64_bit_processor=string_to_bool v})
}
where
b2s True = "True"
b2s _ = "False"
s2b "True" = True
s2b _ = False
string_to_bool "True" = True
string_to_bool _ = False
m2s CompileSync = "Sync"
m2s CompilePers = "Pers"
......@@ -179,63 +181,6 @@ where
PathOption = SimpleOption "Path" id const
//---
t_StdEnv13 :: Target
t_StdEnv13 =
{ target_name = "StdEnv"
, target_path =
( "{Application}\\Libraries\\StdEnv"
:! Nil
)
, target_libs = PlatformDependant
// ( "{Application}\\StdEnv\\Clean System Files\\user_library"
// :! "{Application}\\StdEnv\\Clean System Files\\gdi_library"
// :! "{Application}\\StdEnv\\Clean System Files\\comdlg_library"
// :! Nil
( Nil
) // Win
( Nil ) // Mac
, target_objs = Nil
, target_stat = Nil
, target_comp = "cocl.exe"
, target_cgen = "cg.exe"
, target_link = "StaticLinker.exe"
, target_dynl = "DynamicLinker.exe"
, target_vers = 918
, target_redc = False
, target_meth = CompileSync
, target_proc = DefaultProcessor
}
t_StdIO13 =
{ target_name = "IO 0.8.2"
, target_path =
( "{Application}\\StdEnv"
:! "{Application}\\IOInterface 0.8.2"
:! Nil
)
, target_libs = PlatformDependant
// ( "{Application}\\StdEnv\\Clean System Files\\user_library"
// :! "{Application}\\StdEnv\\Clean System Files\\gdi_library"
// :! "{Application}\\StdEnv\\Clean System Files\\comdlg_library"
// :! Nil
( Nil
) // Win
( Nil ) // Mac
, target_objs = Nil
, target_stat = Nil
, target_comp = "cocl.exe"
, target_cgen = "cg.exe"
, target_link = "StaticLinker.exe"
, target_dynl = "DynamicLinker.exe"
, target_vers = 918
, target_redc = False
, target_meth = CompileSync
, target_proc = DefaultProcessor
}
t_StdEnv20 :: Target
t_StdEnv20 =
{ target_name = "StdEnv"
......@@ -253,6 +198,7 @@ t_StdEnv20 =
, target_link = "Tools\\Clean System\\StaticLinker.exe"
, target_dynl = "Tools\\Dynamics\\DynamicLinker.exe"
, target_vers = 919
, env_64_bit_processor = False
, target_redc = False
, target_meth = CompilePers
, target_proc = DefaultProcessor
......
......@@ -111,6 +111,7 @@ Link :: // Links the given file:
!String // name of file containing symbols to be exported from dll
!Pathname // startup directory
!String // path to dynamic linker
!Bool // 64 bit target processor
!Processor // target processor
!*(PSt .l) // state
->
......
......@@ -606,12 +606,12 @@ where
Link :: !String !(WindowFun *(PSt .l)) !Pathname !ApplicationOptions
!Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool !Bool !Bool !Bool !String
!Bool !String !Pathname !String !Processor !*(PSt .l)
!Bool !String !Pathname !String !Bool !Processor !*(PSt .l)
-> (!*(PSt .l),!Bool)
Link linker` winfun path
applicationOptions=:{ss,hs,initial_heap_size,profiling,heap_size_multiple,o,memoryProfilingMinimumHeapSize=minheap}
optionspathname library_file_names object_file_names static_libraries static gen_relocs gen_linkmap
link_resources resource_path gen_dll dll_syms startupdir dynlstr _ ps
link_resources resource_path gen_dll dll_syms startupdir dynlstr use_64_bit_processor _ ps
# (ok,linker,linkerdir) = mangleLinker linker` startupdir
| not ok
# ps = winfun [linker] ps
......@@ -627,7 +627,7 @@ Link linker` winfun path
err -> (err,ps)
| err <> NoDirError
= (winfun ["Linker error: Unable to access or create: "+++optdirpath] ps,False)
# (options_file_ok,ps) = accFiles (write_options_file optionspathname flags hs ss initial_heap_size heap_size_multiple minheap) ps
# (options_file_ok,ps) = accFiles (write_options_file optionspathname flags hs ss initial_heap_size heap_size_multiple minheap use_64_bit_processor) ps
| not options_file_ok
= (winfun ["Linker error: Could not write the options object file: "+++optionspathname] ps,False)
# linkopts =
......
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