Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-ide
Commits
2b4a9711
Verified
Commit
2b4a9711
authored
Nov 25, 2018
by
Camil Staps
Browse files
Add StripByteCode to link options (see cstaps/abc-interpreter!87)
parent
0e0c2e94
Changes
10
Hide whitespace changes
Inline
Side-by-side
BatchBuild/IdeState.dcl
View file @
2b4a9711
...
...
@@ -68,6 +68,7 @@ getCurrentCgen :: !*GeneralSt -> (!String,!*GeneralSt)
getCurrentAbcOpt
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBCgen
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBClink
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBCstrip
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentLink
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentDynl
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentVers
::
!*
GeneralSt
->
(!
Int
,!*
GeneralSt
)
...
...
BatchBuild/IdeState.icl
View file @
2b4a9711
...
...
@@ -193,6 +193,11 @@ getCurrentBClink ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bclink
,
ps
)
getCurrentBCstrip
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBCstrip
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bcstrip
,
ps
)
getCurrentLink
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentLink
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
...
...
Ide/IdeState.dcl
View file @
2b4a9711
...
...
@@ -190,6 +190,7 @@ getCurrentCgen :: !*(PSt *General) -> (!String,!*PSt *General)
getCurrentAbcOpt
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBCgen
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBClink
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBCstrip
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentLink
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentDynl
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentVers
::
!*(
PSt
*
General
)
->
(!
Int
,!*
PSt
*
General
)
...
...
Ide/IdeState.icl
View file @
2b4a9711
...
...
@@ -455,6 +455,11 @@ getCurrentBClink ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bclink
,
ps
)
getCurrentBCstrip
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBCstrip
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bcstrip
,
ps
)
getCurrentLink
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentLink
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
...
...
Pm/PmDriver.icl
View file @
2b4a9711
...
...
@@ -820,6 +820,9 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
=
continue
False
newpaths
False
fileinfo
libsinfo
modpaths
project
intr
(
abccache
,
ps
)
#
(
ok
,
ps
)
=
if
(
PR_GetByteCodePath
project
<>
""
)
(
ByteCodeLink
fileinfo
project
ps
)
(
True
,
ps
)
|
not
ok
=
continue
False
newpaths
False
fileinfo
libsinfo
modpaths
project
intr
(
abccache
,
ps
)
#
(
ok
,
ps
)
=
if
(
lo
.
strip_bytecode
&&
PR_GetByteCodePath
project
<>
""
)
(
ByteCodeStrip
fileinfo
project
ps
)
(
True
,
ps
)
|
not
ok
=
continue
False
newpaths
False
fileinfo
libsinfo
modpaths
project
intr
(
abccache
,
ps
)
...
...
@@ -1727,6 +1730,23 @@ ByteCodeLink fileinfo project ps
|
fromOk
r
<>
0
=
(
False
,
updateErrorWindow
[
"bytecode linker failed with non-zero exit code "
+++
toString
(
fromOk
r
)]
ps
)
=
(
True
,
ps
)
ByteCodeStrip
::
!
FileInfoCache
!
Project
!*
GeneralSt
->
*(!
Bool
,
!*
GeneralSt
)
ByteCodeStrip
fileinfo
project
ps
#
(
startupdir
,
ps
)
=
getStup
ps
(
bcstrip
,
ps
)
=
getCurrentBCstrip
ps
bcstrip
=
startupdir
+++
DirSeparatorString
+++
bcstrip
#
bcpath
=
fulPath
startupdir
(
PR_GetRootDir
project
)
(
PR_GetByteCodePath
project
)
#
ps
=
showInfo
(
Level2
(
"Stripping bytecode for '"
+++
RemovePath
bcpath
+++
"'"
))
ps
#
(
h
,
ps
)
=
acc_world_instead_of_ps
(
runProcessIO
bcstrip
[
bcpath
,
"-o"
,
bcpath
]
Nothing
)
ps
|
isError
h
=
(
False
,
updateErrorWindow
[
"failed to execute the bytecode stripper: "
+++
snd
(
fromError
h
)]
ps
)
#
(
h
,
io
)
=
fromOk
h
#
(
r
,
ps
)
=
acc_world_instead_of_ps
(
waitForProcess
h
)
ps
|
isError
r
=
(
False
,
updateErrorWindow
[
"failed to wait for the bytecode stripper: "
+++
snd
(
fromError
r
)]
ps
)
#
ps
=
processIOToErrorWindow
io
ps
|
fromOk
r
<>
0
=
(
False
,
updateErrorWindow
[
"bytecode stripper failed with non-zero exit code "
+++
toString
(
fromOk
r
)]
ps
)
=
(
True
,
ps
)
processIOToErrorWindow
::
!
ProcessIO
!*
GeneralSt
->
*
GeneralSt
processIOToErrorWindow
io
ps
|
IF_WINDOWS64
True
False
=
ps
// FIXME: System.Process is broken on 64-bit windows (see Platform#65)
...
...
Pm/PmEnvironment.dcl
View file @
2b4a9711
...
...
@@ -17,6 +17,7 @@ EnvsFileName :== "IDEEnvs"
,
target_abcopt
::
!
String
// abc optimiser
,
target_bcgen
::
!
String
// bytecode generator
,
target_bclink
::
!
String
// bytecode linker
,
target_bcstrip
::
!
String
// bytecode stripper
,
target_link
::
!
String
// static/eager linker
,
target_dynl
::
!
String
// dynamic linker
,
target_vers
::
!
Int
// abc version
...
...
Pm/PmEnvironment.icl
View file @
2b4a9711
...
...
@@ -30,6 +30,7 @@ t_StdEnv
,
target_abcopt
::
!
String
// abc optimiser
,
target_bcgen
::
!
String
// bytecode generator
,
target_bclink
::
!
String
// bytecode linker
,
target_bcstrip
::
!
String
// bytecode stripper
,
target_link
::
!
String
// static/eager linker
,
target_dynl
::
!
String
// dynamic linker
,
target_vers
::
!
Int
// abc version
...
...
@@ -135,6 +136,7 @@ emptyTarget =
,
target_abcopt
=
""
,
target_bcgen
=
""
,
target_bclink
=
""
,
target_bcstrip
=
""
,
target_link
=
""
,
target_dynl
=
""
,
target_vers
=
42
...
...
@@ -168,6 +170,7 @@ TargetTable =
,
SimpleOption
"EnvironmentABCOptimise"
(\
a
->
a
.
target_abcopt
)
(\
v
a
->{
a
&
target_abcopt
=
v
})
,
SimpleOption
"EnvironmentByteCodeGen"
(\
a
->
a
.
target_bcgen
)
(\
v
a
->{
a
&
target_bcgen
=
v
})
,
SimpleOption
"EnvironmentByteCodeLink"
(\
a
->
a
.
target_bclink
)
(\
v
a
->{
a
&
target_bclink
=
v
})
,
SimpleOption
"EnvironmentByteCodeStrip"
(\
a
->
a
.
target_bcstrip
)
(\
v
a
->{
a
&
target_bcstrip
=
v
})
,
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
})
...
...
@@ -208,6 +211,7 @@ t_StdEnv20
,
target_abcopt
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"ABCOptimiser.exe"
"abcopt"
,
target_bcgen
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"ByteCodeGenerator.exe"
"bcgen"
,
target_bclink
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"ByteCodeLinker.exe"
"bclink"
,
target_bcstrip
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"ByteCodeStripper.exe"
"bcstrip"
,
target_link
=
IF_MACOSX
"/usr/bin/gcc"
(
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"StaticLinker.exe"
"linker"
)
,
target_dynl
=
"Tools"
+++
DirSeparatorString
+++
"Dynamics"
+++
DirSeparatorString
+++
"DynamicLinker.exe"
,
target_vers
=
920
...
...
Pm/PmFiles.icl
View file @
2b4a9711
...
...
@@ -386,6 +386,7 @@ LinkOptionsTable =
,
SimpleOption
"GenerateDLL"
(\
a
->
a
.
generate_dll
)
(\
v
a
->{
a
&
generate_dll
=
v
})
,
SimpleOption
"ExportedNames"
(\
a
->
a
.
dll_export_list_name
)
(\
v
a
->{
a
&
dll_export_list_name
=
v
})
// , SimpleOption "AddCarbResource" (\a->a.add_carb_resource) (\v a->{a & add_carb_resource = v})
,
SimpleOption
"StripByteCode"
(\
a
->
a
.
strip_bytecode
)
(\
v
a
->{
a
&
strip_bytecode
=
v
})
}
EditWdOptionsTable
::
OptionsTable
EditWdOptions
...
...
Pm/PmTypes.dcl
View file @
2b4a9711
...
...
@@ -38,6 +38,8 @@ instance fromString Processor
,
dll_export_list_name
::
!
String
// , add_carb_resource :: !Bool // Mac-only!
,
strip_bytecode
::
!
Bool
// strip ABC bytecode
}
DefaultLinkOptions
::
LinkOptions
...
...
Pm/PmTypes.icl
View file @
2b4a9711
...
...
@@ -139,6 +139,8 @@ where
,
dll_export_list_name
::
!
String
// , add_carb_resource :: !Bool // Mac-only!
,
strip_bytecode
::
!
Bool
// strip ABC bytecode
}
/*
instance == LinkOptions // do we need to check resource linking flags???
...
...
@@ -169,6 +171,7 @@ DefaultLinkOptions =
,
generate_dll
=
False
,
dll_export_list_name
=
""
// , add_carb_resource = False // Clean2 ide targets Carbon?!
,
strip_bytecode
=
False
}
::
LinkMethod
...
...
@@ -299,8 +302,8 @@ DefCodeGenOptions :: CodeGenOptions;
DefCodeGenOptions
=
{
cs
=
False
,
ci
=
True
,
generate_bytecode
=
False
,
optimise_abc
=
False
,
generate_bytecode
=
False
}
// The Application Options: default settings for the application.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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