Skip to content
Snippets Groups Projects
Commit 233f1943 authored by Julien Signoles's avatar Julien Signoles
Browse files

Merge branch 'feature/kostyantyn/e-acsl-gcc' into 'master'

An e-acsl-gcc.sh option to skip compilation of original source files and generate an instrumented executable only



See merge request !40
parents 4dc79fea 81dba115
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
Plugin E-ACSL 0.6 Magnesium Plugin E-ACSL 0.6 Magnesium
########################### ###########################
-* E-ACSL [2016/01/22] Added an e-acsl-gcc.sh option allowing to skip
compilation of original sources.
-* E-ACSL [2016/01/15] Fix installation with custom --prefix. -* E-ACSL [2016/01/15] Fix installation with custom --prefix.
-* E-ACSL [2016/01/05] Fix bug in the memory model that caused the -* E-ACSL [2016/01/05] Fix bug in the memory model that caused the
tracked size of heap memory be computed incorrectly. tracked size of heap memory be computed incorrectly.
......
...@@ -45,6 +45,10 @@ show a help page. ...@@ -45,6 +45,10 @@ show a help page.
compile the generated and the original (supplied) sources. compile the generated and the original (supplied) sources.
By default no compilation is performed. By default no compilation is performed.
.TP .TP
.B -X, --instrumented-only
Do not compile original code. Has effect only in the presence of the \fI-c\fP
flag.
.TP
.B -C, --compile-only .B -C, --compile-only
compile the input files as if they were generated by \fBE-ACSL\fP. compile the input files as if they were generated by \fBE-ACSL\fP.
.TP .TP
......
...@@ -48,8 +48,8 @@ check_tool() { ...@@ -48,8 +48,8 @@ check_tool() {
LONGOPTIONS="help,compile,compile-only,print,debug:,ocode:,oexec:,verbose:, \ LONGOPTIONS="help,compile,compile-only,print,debug:,ocode:,oexec:,verbose:, \
frama-c-only,extra-cpp-args:,frama-c-stdlib,full-mmodel,gmp,quiet,logfile:, frama-c-only,extra-cpp-args:,frama-c-stdlib,full-mmodel,gmp,quiet,logfile:,
ld-flags:,cpp-flags:,frama-c-extra:,memory-model:,production,no-stdlib, ld-flags:,cpp-flags:,frama-c-extra:,memory-model:,production,no-stdlib,
debug-log:,frama-c:,gcc:,e-acsl-share:" debug-log:,frama-c:,gcc:,e-acsl-share:,instrumented-only"
SHORTOPTIONS="h,c,C,p,d:,o:,O:,v:,f,E:,L,M,l:,e:,g,q,s:,F:,m:,P,N,D:I:G:" SHORTOPTIONS="h,c,C,p,d:,o:,O:,v:,f,E:,L,M,l:,e:,g,q,s:,F:,m:,P,N,D:,I:,G:,X"
# Prefix for an error message due to wrong arguments # Prefix for an error message due to wrong arguments
ERROR="ERROR parsing arguments:" ERROR="ERROR parsing arguments:"
...@@ -76,6 +76,7 @@ OPTION_DEBUG_LOG_MACRO="" # Specification of debug log file ...@@ -76,6 +76,7 @@ OPTION_DEBUG_LOG_MACRO="" # Specification of debug log file
OPTION_FRAMAC_CPP_EXTRA="" # Extra CPP flags for Frama-C OPTION_FRAMAC_CPP_EXTRA="" # Extra CPP flags for Frama-C
OPTION_EACSL_MMODELS="bittree" # Memory model used OPTION_EACSL_MMODELS="bittree" # Memory model used
OPTION_EACSL_SHARE= # Custom E-ACSL share directory OPTION_EACSL_SHARE= # Custom E-ACSL share directory
OPTION_INSTRUMENTED_ONLY= # Do not compile original code
# The following option controls whether to use gcc builtins # The following option controls whether to use gcc builtins
# (e.g., __builtin_strlen) in RTL or fall back to custom implementations # (e.g., __builtin_strlen) in RTL or fall back to custom implementations
# of standard functions. # of standard functions.
...@@ -234,6 +235,11 @@ do ...@@ -234,6 +235,11 @@ do
shift; shift;
OPTION_EACSL= OPTION_EACSL=
;; ;;
# Do not compile original source file
--instrumented-only|-X)
shift;
OPTION_INSTRUMENTED_ONLY=1
;;
# Do use Frama-C stdlib, which is the default behaviour of Frama-C # Do use Frama-C stdlib, which is the default behaviour of Frama-C
--frama-c-stdlib|-L) --frama-c-stdlib|-L)
shift; shift;
...@@ -449,7 +455,7 @@ fi ...@@ -449,7 +455,7 @@ fi
if [ -n "$OPTION_COMPILE" ]; then if [ -n "$OPTION_COMPILE" ]; then
# Compile the original files only if the instrumentation option is given, # Compile the original files only if the instrumentation option is given,
# otherwise the provided sources are assumed to be E-ACSL instrumented files # otherwise the provided sources are assumed to be E-ACSL instrumented files
if [ -n "$OPTION_INSTRUMENT" ]; then if [ -n "$OPTION_INSTRUMENT" ] && [ -z "$OPTION_INSTRUMENTED_ONLY" ]; then
($OPTION_ECHO; $CC $CPPFLAGS $CFLAGS "$@" -o "$OUTPUT_EXEC" $LDFLAGS); ($OPTION_ECHO; $CC $CPPFLAGS $CFLAGS "$@" -o "$OUTPUT_EXEC" $LDFLAGS);
error "fail to compile/link un-instrumented code: $@" $?; error "fail to compile/link un-instrumented code: $@" $?;
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment