E-ACSL-GCC.SH(1)
π E-ACSL-GCC.SH(1) π
okay bestie, pull up a chair πͺ because this one is a whole vibe. this is a page from the General Commands Manual, and it's about a little tool called e-acsl-gcc that will absolutely change your C-programming life. no cap.
β¨ NAME β¨
e-acsl-gcc β instrument and compile C files with E-ACSL π§
πΈ SYNOPSIS πΈ
e-acsl-gcc [ options ] files
like. that's it. that's the whole thing. you give it options, you give it files, it does the rest π
π¦ DESCRIPTION π¦
so e-acsl-gcc is a convenience wrapper β yes, a wrapper, we love a wrapper β for instrumenting C programs using the E-ACSL Frama-C plugin, and then compiling the results with the GNU compiler collection (GCC).
translation: it instruments your C code, then hands it to GCC to actually build. two jobs, one icon π
π OPTIONS π
okay this is the long part, stay with me, i promise it's giving useful.
-h,--helpβ show a help page. the classic. the "wait what was that flag again" button π-c,--compileβ compile the generated and the original (supplied) sources. this one is enabled by default bestie, so if you want it off, use-nor--no-compile.-n,--no-compileβ disable compilation of the generated and the original (supplied) sources. just. no compiling today π-D,--rt-debugβ enable runtime debug features, i.e., compile an unoptimized executable with assertions and extra checks. messy but honest β¨--no-traceβ disable stack trace reporting in debug mode.-V,--rt-verboseβ output extra messages when executing generated code. it talks. a lot. we love a chatty king π£οΈ-X,--instrumented-onlyβ do not compile original code. heads up: this only has an effect in the presence of the-cflag.-C,--compile-onlyβ compile the input files as if they were generated by E-ACSL.-d,--debug=<N>β pass a value to the Frama-C-debugoption. by default the-debugflag is unused. (unused! sitting there! untouched! we respect that π)-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 π§π»-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, but make it plain π«Ά-E,--extra-cpp-args=<FLAGS>β pass additional arguments to the Frama-C preprocessor.-L,--frama-c-stdlibβ use the Frama-C standard library instead of a system-wide one.-M,--full-mtrackingβ maximize memory-related instrumentation. maximize. everything. memory.--concurrencyβ enable concurrency support.--temporalβ enable checking for temporal memory errors in\validand\valid_readpredicates.--weak-validityβ enable notion of weak validity. 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.--validate-format-stringsβ enable built-in detection of format-string vulnerabilities. security girlies rise π‘οΈ--libc-replacementsβ replace some of the unsafe LIBC functions (e.g.,strcpy,memcpy) with RTL alternatives that include internal runtime error checking.-g,--gmpβ always use GMP integers instead of C integral types. by default the GMP integers are used on an as-needed basis.--mbits=<BITS>β architecture to compile to. valid arguments are16,32or64. defaults 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 preprocessor at compile-time. for instrumentation-time preprocessor flags see the--extra-cpp-argsoption. only takes effect in case compilation has not been disabled (--no-compile).-q,--quietβ suppress any output except for errors and warnings. the strong silent type π€«-s,--logfile=<FILE>β redirect all output to a given file.--no-constfoldβ do not supply the-constfoldflag to Frama-C.-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. (yes, all of them. the whole buffet π)
-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. resilience era π--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.--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.--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.--then-lastβ separate with a-then-lastthe 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-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 π slay, it worked.1β invalid user input π that one's on you bestie.- Frama-C or GCC error code β instrumentation- or compile-time error π not your fault, the tools are just going through it.
π₯ EXAMPLES π₯
because reading is one thing and doing is another, here's the whole thing in action:
e-acsl-gcc foo.c
instrument foo.c and output the instrumented code to a.out.frama.c. β¨
e-acsl-gcc -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. two for the price of one, iconic π
e-acsl-gcc --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 bittree memory model.
π SEE ALSO π
gcc(1), cpp(1), ld(1), frama-c(1)
(the whole friend group π)
and that's the page!! this one's from 2016-02-02 β yeah, it's been around a minute, but it still ate β and it lives in the E-ACSL-GCC.SH(1) section of the manual. go forth and instrument, bestie π«Άπ β¨
π¦ where this page comes from
- fedora 43: frama-c 33.0-1.fc43 Β· LGPL-2.1-only AND LGPL-2.1-or-later AND LGPL-2.0-only WITH OCaml-LGPL-linking-exception AND GPL-2.0-or-later AND CC0-1.0 AND CC-BY-SA-4.0 AND BSD-3-Clause AND QPL-1.0-INRIA-2004 WITH QPL-1.0-INRIA-2004-exception
- fedora 44: frama-c 33.0-1.fc44 Β· LGPL-2.1-only AND LGPL-2.1-or-later AND LGPL-2.0-only WITH OCaml-LGPL-linking-exception AND GPL-2.0-or-later AND CC0-1.0 AND CC-BY-SA-4.0 AND BSD-3-Clause AND QPL-1.0-INRIA-2004 WITH QPL-1.0-INRIA-2004-exception
- nixpkgs unstable: frama-c 33.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms