E-ACSL-GCC.SH(1)
E-ACSL-GCC.SH π the group-chat guide to instrumenting + compiling C with E-ACSL
ok bestie, welcome to the General Commands Manual page for e-acsl-gcc.sh β yes it's a real manual, from the General Commands Manual section, and yes I'm about to make it make sense for you. sit down, grab a snack π, we're doing this.
β¨ NAME β¨
e-acsl-gcc.sh β instrument and compile C files with E-ACSL π¦
β¨ SYNOPSIS β¨
e-acsl-gcc.sh [ options ] files
β¨ DESCRIPTION β¨
so like, e-acsl-gcc.sh is a convenience wrapper β it's giving "I'll handle the boring parts for you, queen". It does two things for your C programs:
- it instruments them using the E-ACSL Frama-C plugin π
- and then it compiles the result using the GNU compiler collection (GCC) π
basically it's the middlewoman between Frama-C and GCC and she is booked and thriving. no cap.
β¨ OPTIONS β¨
okay this is the long part but every single one matters, do not skip, I will know π
-h,--helpβ show a help page. literally just help. slay.-c,--compileβ compile the generated sources and the original (supplied) sources. By default no compilation is performed β so if you don't pass this, nothing gets compiled, periodt.-D,--rt-debugβ enable runtime debug features, i.e. compile an unoptimized executable with assertions and extra checks. it's giving "I want to see everything" energy π--no-traceβ disable stack trace reporting in debug mode. bye traces π-V,--rt-verboseβ output extra messages when executing generated code. yapper mode: on π£οΈ-X,--instrumented-onlyβ do not compile original code. β οΈ Has effect only in the presence of the-cflag. so like, it does nothing on its own, bestie, it needs-cto have a purpose.-C,--compile-onlyβ compile the input files as if they were generated by E-ACSL. no instrumentation, just vibes and compiling.-d,--debug=<N>β pass a value to the Frama-C-debugoption. By default the-debugflag is unused.-v,--verbose=<N>β pass a value to the Frama-C-verboseoption. By default the-verboseflag is unused.--checkβ check integrity of the generated AST (mostly useful for developers). devs only, iykyk π§βπ»-o,--ocode=<FILE>β output the E-ACSL instrumented code to<FILE>. Defaults toa.out.frama.c.-O,--oexec=<FILE>β output the code compiled from the uninstrumented sources to<FILE>. The executable compiled from the files generated by E-ACSL is appended the.e.acslsuffix. Unless specified, the names of the executables generated from the original and the modified programs area.outanda.out.e-acslrespectively.--oexec-e-acsl=<FILE>β name of the executable file generated from the E-ACSL-instrumented file. Unless specified, the executable is named as indicated by the--oexecoption.-f,--frama-c-onlyβ run input source files through Frama-C without E-ACSL instrumentations. Frama-C only, no E-ACSL, no notes β-E,--extra-cpp-args=<FLAGS>β pass additional arguments to the Frama-C pre-processor.-L,--frama-c-stdlibβ use the Frama-C standard library instead of a system-wide one.-M,--full-mtrackingβ maximize memory-related instrumentation. maximum memory tracking, no crumbs left π§Ή--concurrencyβ enable concurrency support. threads said hi π--temporalβ enable checking for temporal memory errors in\validand\valid_readpredicates.--weak-validityβ enable notion of weak validity. so here's the tea: By default expression(p+i), wherepis a pointer andiis an integer offset, is deemed valid if both addressespand(p+i)belong to the same allocated block. With weak validity(p+i)is valid if the memory location which address is given by expression(p+i)is allocated. different rules, different game π--validate-format-stringsβ enable built-in detection of format-string vulnerabilities. safety first bestie π‘οΈ--libc-replacementsβ replace some of the unsafe LIBC functions (e.g.,strcpy,memcpy) with RTL alternatives that include internal runtime error checking. out with the unsafe, in with the checked β¨-g,--gmpβ always use GMP integers instead of C integral types. By default the GMP integers are used on as-needed basis.--mbits=<BITS>β architecture to compile to. Valid arguments are16,32or64. Default to the architecture of the current environment. This option is used to select the machdep when calling Frama-C, and to pass the corresponding-m16,-m32or-m64flag to the compiler.-l,--ld-flags=<FLAGS>β pass the specified flags to the linker. π-e,--cpp-flags=<FLAGS>β pass the specified flags to the pre-processor at compile-time. For instrumentation-time pre-processor flags see the--extra-cpp-argsoption. (yes those are two different things, don't mix them up π)-q,--quietβ suppress any output except for errors and warnings. shhh π€«-s,--logfile=<FILE>β redirect all output to a given file. everything goes in the file, journaling era π-F,--frama-c-extra=<FLAGS>β pass an extra option to a Frama-C invocation.-a,--rte=<OPTSTRING>β annotate a source program with assertions using a run of an RTE plugin prior to E-ACSL.OPTSTRINGis a comma-separated string that specifies the types of generated assertions. Valid arguments are:signed-overflowβ signed integer overflows.unsigned-overflowβ unsigned integer overflows.signed-downcastβ signed downcast exceeding destination range.unsigned-downcastβ unsigned downcast exceeding destination range.memβ pointer or array accesses.float-to-intβ casts from floating-point to integer.divβ division by zero.shiftβ left and right shifts by a value out of bounds.pointer-callβ annotate functions calls through pointers.allβ all of the above. (the "give me everything" option, iconic π)
-A,--rte-select=<OPTSTRING>β restrict annotations to a given list of functions.OPTSTRINGis a comma-separated string comprising function names.--zone-sizes=<NAME1:SIZE1,...,NAMEN:SIZEN>β set the size (in MB) of the given zones. Valid zone names are:stackβ stack shadow spaceheapβ heap shadow spacetlsβ TLS shadow spacethread-stackβ thread stack shadow space
-k,--keep-goingβ continue execution after an assertion failure. we do not stop, we keep going πͺ--free-valid-addressβ trigger failure if aNULL-pointer is used as an input tofreefunction.--fail-with-code=<NUMBER>β on assertion failure exit with the given integer code instead of raising an abort signal.--assert-print-dataβ print data contributing to the failed assertion along with the runtime error message. receipts, printed π--no-assert-print-dataβ do not print data contributing to the failed assertion along with the runtime error message.--external-assert=<FILE>β the filename that contains your own implementation of__e_acsl_assert. DIY era π¨--external-print-value=<FILE>β the filename that contains your own implementation of__e_acsl_print_value.-m,--memory-model=<model>β memory model (i.e., a runtime library for checking memory related annotations) to be linked against the instrumented file. Valid arguments are:bittreeβ memory modelling using a Patricia trie.segmentβ shadow based segment model.
By default the Patricia trie memory model is used.
--print-mmodelsβ print the names of the supported memory models.-I,--frama-c=<FILE>β the name of the Frama-C executable. By default the firstframa-cexecutable found in the system path is used.--e-acsl-share=<DIR>β the name of the E-ACSL share directory. If not provided, it is computed from your setting.-G,--gcc=<FILE>β the name of the GCC executable. By default the firstgccexecutable found in the system path is used.--thenβ separate with a-thenthe first Frama-C options from the actual launch of the E-ACSL plugin.--e-acsl-extra=<OPTS>β add<OPTS>to the list of options that will be given to the E-ACSL analysis. Only useful when--thenis in use, in which case<OPTS>will be placed after the-thenon Frama-C's command-line. Otherwise, equivalent to--frama-c-extra.--ar=<FILE>β the name of the AR executable. Only relevant with--dlmalloc-from-sources. By default the firstarexecutable found in the system path is used.--ranlib=<FILE>β the name of the RANLIB executable. Only relevant with--dlmalloc-from-sources. By default the firstranlibexecutable found in the system path is used.--with-dlmalloc=<FILE>β use<FILE>instead of distributed dlmalloc library.--dlmalloc-from-sourcesβ compile and use dlmalloc library from sources instead of using the distributed library. β οΈ Incompatible with--with-dlmalloc.--dlmalloc-compile-onlyβ do not instrument or compile code, only compile dlmalloc library from sources. Implies--dlmalloc-from-sourcesand incompatible with--with-dlmalloc. dlmalloc only, nothing else, focus mode π―--dlmalloc-compile-flags=<FLAGS>β compile dlmalloc library with<FLAGS>compile flags. Default to-O2 -g3. Unused if--dlmalloc-from-sourcesor--dlmalloc-compile-onlyisn't used.--odlmalloc=<FILE>β output compiled dlmalloc library to<FILE>. Unused if--dlmalloc-from-sourcesor--dlmalloc-compile-onlyisn't used.
β¨ EXIT STATUS β¨
0β successful execution. we ate and left no crumbs π1β invalid user input. bestie... the input was not it π- Frama-C or GCC error code β instrumentation- or compile-time error. not us, that's them, fr fr π
β¨ EXAMPLES β¨
1. the simplest one π¦
e-acsl-gcc.sh foo.c
instrument foo.c and output the instrumented code to a.out.frama.c.
2. the "I want custom names" one β¨
e-acsl-gcc.sh -c -ogen_foo.c -Ofoo foo.c
instrument foo.c, output the instrumented code to gen_foo.c and compile foo.c into foo and gen_foo.c into foo.e-acsl. look at all those beautiful names π
3. the "already instrumented, just compile it" one π
e-acsl-gcc.sh --memory-model=bittree -C gen_foo.c
assume gen_foo.c has been instrumented by E-ACSL and compile it into a.out.e-acsl using the bittree memory model.
β¨ SEE ALSO β¨
gcc(1), cpp(1), ld(1), frama-c(1) β go read their manual pages too, they're the supporting cast and honestly they deserve their flowers πΈ
and that's the whole page, bestie!! π this was E-ACSL-GCC.SH(1) from the General Commands Manual, dated 2016-02-02 β so like, it's been around, it's vintage, it's classic. mwah. now go instrument something and slay πππ«Ά
π¦ where this page comes from
- debian bookworm: frama-c-base 20220511-manganese-3+b4 Β· LGPL-2.1-only
- ubuntu noble: frama-c-base 20220511-manganese-5build7 Β· LGPL-2.1-only
- Copyright (C) 2012-2021 CEA (Commissariat Γ l'Γ©nergie atomique et aux Γ©nergies
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms