Open garyt2 opened 1 week ago
Interesting...will do some testing and get back.
Can give it a try as following:
-fprofile-arcs -ftest-coverage
to .so
target in Makefile.input in jitlib
directory.
.o
target already has-fprofile-arcs -ftest-coverage
flagsmake -f RUN_cpp_input/jitlib/Makefile.input
for instancetrick.jit_compile_and_run("RUN_cpp_input/input.cpp")
That is looking like it has potential. Here's the build process that seems to work from a pristine state:
RUN_xxx/jitlib/Makefile.input_config
file to replace:
/usr/bin/g++ -shared -o $@ $<
with/usr/bin/g++ -shared -fprofile-arcs -ftest-coverage -o $@ $<
RUN_xxx/jitlib/libinput_config.so
)make -f RUN_xxx/jitlib/Makefile.input_config
So that's a bit cumbersome, but it seems that, if the modified Makefile could be copied in instead (in place of the default Makefile) for sims that are compiled with coverage flags, then the necessity to run with expected failure, edit the default Makefile, remove the original .so, and re-make might be avoided.
Is there a way to identify a build-with-coverage, and conditionally identify which Makefile to populate jitlib with?
Yeah, the workaround takes some manual work. Current JIT input code doesn't generate .so target with trick or trick system CXXFLAGS like for .o target and it doesn't check if build-with-coverage. We'll look into this to make needed update such as to update trick code to have coverage flags for .so in jitlib Makefile if jit input is built with coverage.
Noticed that a sim built with code-coverage flags
-fprofile-arcs -ftest-coverage
will not run a JIT-input file, it cannot load the generated .so file.Is there a workaround?