Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-ide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
clean-ide
Commits
e1a45f07
Commit
e1a45f07
authored
Jan 14, 2019
by
John van Groningen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'support-only-using-gcc' into 'master'
Enables only using GCC on linux See merge request
!6
parents
376ad7a8
0bac683c
Pipeline
#17706
passed with stage
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
74 deletions
+80
-74
Unix/PmCleanSystem.icl
Unix/PmCleanSystem.icl
+80
-74
No files found.
Unix/PmCleanSystem.icl
View file @
e1a45f07
...
...
@@ -150,7 +150,7 @@ CompilePersistent cocl write_module_times errwin typewin compileOrCheckSyntax md
=
abort
(
"read failed "
+++
toString
r
+++
"
\n
"
)
#
exitcode
=
parse_result_number
0
result_string
#
dummy_slot
=
0
#
(
path
,
mess
,
env
)
=
CompileHandleExitCode
exitcode
cocl
startupdir
dummy_slot
errwin
typewin
mdn
listTypes
env
=
(
compiling_info
,(
env
,
path
,
mess
))
...
...
@@ -162,7 +162,7 @@ parse_result_number i result_string
|
c
==
'-'
=
0
-
parse_result_number
(
i
+1
)
result_string
=
abort
"parse_result_number failed
\n
"
where
where
parse_result_number2
i
n
result_string
|
i
<
size
result_string
#
c
=
result_string
.[
i
]
...
...
@@ -240,7 +240,7 @@ QuitCleanCompiler async compiler_process_ids world
|
async
=
exit_compilers
compiler_process_ids
world
=
world
where
where
exit_compilers
[
compiler
:
compilers
]
world
=
exit_compilers
compilers
(
exit_clean_compiler
compiler
world
)
exit_compilers
[]
world
...
...
@@ -291,7 +291,7 @@ CodeGen cgen used_compiler_process_ids wf genAsmOrCode abc_path obj_path timepro
#
((_,
errors_not_empty
,
error_text
),
ps
)
=
accFiles
(
readErrorsAndWarnings
errors_file_name
)
ps
ps
=
if
errors_not_empty
(
wf
(
StrictListToList
error_text
)
ps
)
(
wf
(
StrictListToList
error_text
)
ps
)
(
if
(
exit_code
<>
0
)
(
wf
[
"Error: Code generator failed for '"
+++
abc_path
+++
"' with exit code: "
+++
toString
exit_code
,(
quoted_string
path_without_suffix
)]
ps
)
ps
...
...
@@ -347,7 +347,7 @@ wait_for_finished_code_generator process_ids ps
|
wtermsig
<>
0
=
abort
"code generator exited abnormally
\n
"
=
(
process_n
,
result
,
ps
)
where
where
find_process_id_index
i
w_pid
pids
|
i
<
size
pids
|
pids
.[
i
]==
w_pid
...
...
@@ -361,7 +361,7 @@ finish_code_generator process_handle {scg_abc_path,scg_path_without_suffix,scg_s
=
abort
"close failed
\n
"
#
((_,
errors_not_empty
,
error_text
),
ps
)
=
accFiles
(
readErrorsAndWarnings
scg_errors_file_name
)
ps
ps
=
if
errors_not_empty
(
wf
(
StrictListToList
error_text
)
ps
)
(
wf
(
StrictListToList
error_text
)
ps
)
(
if
(
exit_code
<>
0
)
(
wf
[
"Error: Code generator failed for '"
+++
scg_abc_path
+++
"' with exit code: "
+++
toString
exit_code
,(
quoted_string
scg_path_without_suffix
)]
ps
)
ps
)
...
...
@@ -390,11 +390,16 @@ Link linker winfun path
#
(
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
)
#
use_optimizing_linker_and_gcc
=
is_optimizing_linker
linker
|
use_optimizing_linker_and_gcc
//First call the optimizing linker to generate an intermediate optimized object file which is then passed to gcc
#
object_paths
=
[
optionspathname
:
StrictListToList
(
RemoveDup
object_file_names
)]
#
object_paths
=
[
optionspathname
:
StrictListToList
(
RemoveDup
object_file_names
)]
#
len
=
size
linker
|
len
>=
14
&&
linker
%
(
len
-
14
,
len
)
==
"lib/exe/linker"
=
linkOptimizingGCC
linker
object_paths
options1
options2
ps
|
len
>=
12
&&
linker
%
(
len
-
12
,
len
)
==
"/usr/bin/gcc"
=
linkGCC
object_paths
options2
ps
=
linkOther
linker
object_paths
ps
where
//First call the optimizing linker to generate an intermediate optimized object file which is then passed to gcc
linkOptimizingGCC
linker
object_paths
options1
options2
ps
#
temp_file_name
=
"/tmp/linkerXXXXXX"
+++
"
\0
"
// +++ because modified by mkstemp
#
fd
=
mkstemp
temp_file_name
|
fd
==
-1
...
...
@@ -429,12 +434,19 @@ Link linker winfun path
=
(
ps
,
link_ok
)
=
(
ps
,
link_ok
)
//Call gcc
#
ld_args
=
[
"-o"
,
path
,
temp_file_name
:
add_options_string_to_args
0
options2
(
StrictListToList
(
Append
library_file_names
"-lm"
))]
#!
(
ps
,
link_ok
)
=
linkGCC
[
temp_file_name
]
options2
ps
|
unlink
(
temp_file_name
+++
"
\0
"
)<>
0
=
(
ps
,
link_ok
)
=
(
ps
,
link_ok
)
//Just link with gcc
linkGCC
object_paths
gccOptions
ps
#
ld_args
=
add_options_string_to_args
0
gccOptions
(
StrictListToList
(
Append
library_file_names
"-lm"
))
#
ld_args
=
[
"-o"
,
path
:
object_paths
]
++
ld_args
ld_args
=
IF_MACOSX
ld_args
(
IF_INT_64_OR_32
[
"-no-pie"
:
ld_args
]
ld_args
)
ld_args
=
if
gen_symbol_table
ld_args
[
"-s"
:
ld_args
]
#
ld
=
"/usr/bin/gcc"
#
(
argv
,
args_memory
)
=
make_argv
[
ld
:
ld_args
]
#
ld_pid
=
fork
|
ld_pid
<
0
=
abort
"fork failed
\n
"
...
...
@@ -446,40 +458,39 @@ Link linker winfun path
=
abort
"free failed
\n
"
#
(
w_pid
,
status
)
=
wait_pid
ld_pid
0
|
w_pid
<>
-1
&&
w_pid
<>
ld_pid
=
abort
"waitpid failed
\n
"
=
abort
"waitpid failed
\n
"
#
wtermsig
=
status
bitand
0x7f
#
exit_code
=
(
status
>>
8
)
bitand
0xff
;
|
wtermsig
<>
0
=
abort
"ld exited abnormally
\n
"
#
link_ok
=
exit_code
==
0
|
unlink
(
temp_file_name
+++
"
\0
"
)<>
0
=
(
ps
,
link_ok
)
=
(
ps
,
link_ok
)
|
otherwise
//Call other/additional linker
#
linkopts
=
{
exe_path
=
path
,
res_path
=
resource_path
,
open_console
=
o
<>
NoConsole
,
static_link
=
static
,
gen_relocs
=
gen_relocs
=
(
ps
,
link_ok
)
//Call other/additional linker
linkOther
linker
object_paths
ps
#
linkopts
=
{
exe_path
=
path
,
res_path
=
resource_path
,
open_console
=
o
<>
NoConsole
,
static_link
=
static
,
gen_relocs
=
gen_relocs
,
gen_symbol_table
=
gen_symbol_table
,
gen_linkmap
=
gen_linkmap
,
link_resources
=
link_resources
,
object_paths
=
optionspathname
:!
(
RemoveDup
object_file_names
)
,
dynamic_libs
=
RemoveDup
library_file_names
,
static_libs
=
RemoveDup
static_libraries
,
stack_size
=
ss
,
gen_dll
=
gen_dll
,
dll_names
=
dll_syms
,
gen_linkmap
=
gen_linkmap
,
link_resources
=
link_resources
,
object_paths
=
ListToStrictList
object_paths
,
dynamic_libs
=
RemoveDup
library_file_names
,
static_libs
=
RemoveDup
static_libraries
,
stack_size
=
ss
,
gen_dll
=
gen_dll
,
dll_names
=
dll_syms
,
dynamics_path
=
startupdir
+++.
DirSeparatorString
+++.
dynlstr
,
lib_name_obj_path
=
MakeFullPathname
tooltempdir
"lib_name.o"
}
,
lib_name_obj_path
=
MakeFullPathname
tooltempdir
"lib_name.o"
}
#
linkoptspath
=
MakeFullPathname
tooltempdir
"linkopts"
#
linkerrspath
=
MakeFullPathname
tooltempdir
"linkerrs"
#
(
err
,
ps
)
=
accFiles
(
WriteLinkOpts
linkoptspath
linkopts
)
ps
|
isJust
err
=
(
winfun
(
fromJust
err
)
ps
,
False
)
|
isJust
err
=
(
winfun
(
fromJust
err
)
ps
,
False
)
#
linker_args
=
[
"-I"
,
linkoptspath
,
"-O"
,
linkerrspath
]
#
(
argv
,
args_memory
)
=
make_argv
[
linker
:
linker_args
]
#
linker_pid
=
fork
...
...
@@ -499,12 +510,7 @@ Link linker winfun path
|
free
args_memory
<
0
=
abort
"free failed
\n
"
#
link_ok
=
exit_code
==
0
=
(
ps
,
link_ok
)
is_optimizing_linker
::
!{#
Char
}
->
Bool
is_optimizing_linker
name
#
len
=
size
name
=
len
>=
14
&&
(
name
%
(
len
-
14
,
len
)
==
"lib/exe/linker"
)
=
(
ps
,
link_ok
)
DelayEventLoop
::
!.
ps
->
.
ps
DelayEventLoop
ps
...
...
@@ -524,13 +530,13 @@ CompilePollCompleted compiler_process_ids ps
=
(
NoFinishedCompiler
,
ps
)
#
compiler_id
=
find_fd_index
0
fda
#
results_fd
=
(
compiler_process_ids
!!
compiler_id
).
results_fd
#
result_string
=
createArray
6
'\0'
#
r
=
read
results_fd
result_string
6
;
|
r
<=
1
=
abort
(
"read failed "
+++
toString
r
+++
"
\n
"
)
#
exit_code
=
parse_result_number
0
result_string
=
(
FinishedCompiler
compiler_id
exit_code
,
ps
)
where
fill_fda
::
!
CompilerProcessIds
!
Int
!*{#
Int
}
->
*{#
Int
}
...
...
@@ -753,7 +759,7 @@ add_options_string_to_args i s args
=
args
#
end_i
=
skip_to_space_or_tab
(
i
+1
)
s
=
[
s
%
(
first_i
,
end_i
-1
)
:
add_options_string_to_args
end_i
s
args
]
where
where
skip_spaces_and_tabs
i
s
|
i
<
size
s
#
c
=
s
.[
i
]
...
...
@@ -853,7 +859,7 @@ where
sSize
Nil
=
0
sSize
(
string
:!
Nil
)
=
size
string
sSize
(
string
:!
rest
)
=
size
string
+
1
+
sSize
rest
sUpdate
i
s
Nil
=
s
sUpdate
i
s
(
string
:!
Nil
)
#
(_,
s
)
=
sU
(
size
string
)
i
0
s
string
...
...
@@ -862,7 +868,7 @@ where
#
(
i
,
s
)
=
sU
(
size
string
)
i
0
s
string
#
i
=
inc
i
=
sUpdate
i
s
rest
sU
l
i
j
s
h
|
j
>=
l
=
(
i
,
s
)
#
s
=
update
s
i
h
.[
j
]
...
...
@@ -886,26 +892,26 @@ where
create_args_string
args_size
argv_list
#
s
=
createArray
args_size
'\0'
=
copy_args
argv_list
0
s
where
copy_args
[
a
:
as
]
i
s
#
s
=
copy_chars
0
a
i
s
=
copy_args
as
(
i
+((
size
a
+4
)
bitand
-4
))
s
where
copy_args
[
a
:
as
]
i
s
#
s
=
copy_chars
0
a
i
s
=
copy_args
as
(
i
+((
size
a
+4
)
bitand
-4
))
s
copy_args
[]
i
s
=
s
copy_chars
::
!
Int
!{#
Char
}
!
Int
!*{#
Char
}
->
*{#
Char
}
copy_chars
ai
a
si
s
|
ai
<
size
a
#
s
=
{
s
&
[
si
]=
a
.[
ai
]}
=
copy_chars
(
ai
+1
)
a
(
si
+1
)
s
=
s
create_argv
argv_list
args_memory
#
n_args
=
length
argv_list
#
argv
=
createArray
(
n_args
+1
)
0
;
=
fill_argv
0
argv_list
argv
args_memory
where
fill_argv
::
!
Int
![{#
Char
}]
!*{#
Int
}
!
Int
->
*{#
Int
}
=
fill_argv
0
argv_list
argv
args_memory
where
fill_argv
::
!
Int
![{#
Char
}]
!*{#
Int
}
!
Int
->
*{#
Int
}
fill_argv
arg_n
[
a
:
as
]
argv
args_memory
#
argv
=
{
argv
&
[
arg_n
]=
args_memory
}
args_memory
=
args_memory
+
((
size
a
+4
)
bitand
-4
)
...
...
@@ -917,23 +923,23 @@ ApplicationOptionsToFlags :: !ApplicationOptions -> Int
ApplicationOptionsToFlags
{
sgc
,
pss
,
marking_collection
,
set
,
o
,
memoryProfiling
,
write_stderr_to_file
,
disable_rts_flags
}
=
showgc
+
printstacksize
+
showexectime
+
cons
+
marking_collection_mask
+
memory_profiling_mask
+
write_stderr_to_file_mask
+
disable_rts_flags_mask
where
showgc
showgc
|
sgc
=
2
=
0
printstacksize
printstacksize
|
pss
=
4
=
0
showexectime
|
set
=
8
showexectime
|
set
=
8
=
0
write_stderr_to_file_mask
|
write_stderr_to_file
=
128
|
write_stderr_to_file
=
128
=
0
marking_collection_mask
|
marking_collection
=
64
=
0
marking_collection_mask
|
marking_collection
=
64
=
0
memory_profiling_mask
|
memoryProfiling
=
32
|
memoryProfiling
=
32
=
0
cons
=
case
o
of
...
...
@@ -951,7 +957,7 @@ where
write_options_file
::
!{#.
Char
}
!.
Int
!.
Int
!.
Int
!.
Int
!.
Int
!.
Int
!
Bool
!*
Files
->
*(!
Bool
,!*
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
#
(
opened
,
file
,
files
)
#
(
opened
,
file
,
files
)
=
fopen
options_file_name
FWriteData
files
|
not
opened
=
(
False
,
files
)
...
...
@@ -988,7 +994,7 @@ write_options_file options_file_name flags heap_size stack_size initial_heap_siz
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000068
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000004
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000011
FWI
0x00000003
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000068
FWI
0x00000000
FWI
0x0000002c
FWI
0x00000000
FWI
0x00000000
FWI
...
...
@@ -1003,25 +1009,25 @@ write_options_file options_file_name flags heap_size stack_size initial_heap_siz
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x0000032c
FWI
0x00000000
FWI
0x00000044
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000001
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00010003
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00020003
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00030003
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000001
FWI
0x00020011
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x0000000b
FWI
0x00020011
FWI
0x00000008
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000019
FWI
0x00020011
FWI
0x00000010
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x0000001f
FWI
0x0000001f
FWI
0x00020011
FWI
0x00000018
FWI
0x00000000
FWI
0x00000000
FWI
0x00000000
FWI
0x00000032
FWI
0x00020011
FWI
0x00000020
FWI
...
...
@@ -1071,7 +1077,7 @@ write_options_file options_file_name flags heap_size stack_size initial_heap_siz
0x657a6973
FWI
0x616c6600
FWI
0x68007367
FWI
0x5f706165
FWI
0x657a6973
FWI
0x6c756d5f
FWI
0x6c706974
FWI
0x6e690065
FWI
0x61697469
FWI
0x65685f6c
FWI
0x735f7061
FWI
0x00657a69
)
#
(
close_ok
,
files
)
#
(
close_ok
,
files
)
=
fclose
file
files
=
(
close_ok
,
files
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment