CYGWIN: No debug info generated when building Palisade in debug mode -DCMAKE_BUILD_TYPE=Debug
It has been noticed that in CYGWIN no debug info is generated with the object files when building Palisade in debug mode. This makes debugging Palisade using debugging tools such as gdb
unfeasible.
The problem is caused by the compiler option -O3
that is used in both compilation modes (Debug and Release). Despite the explicit usage of option -g
, it seems that -O3
suppresses -g
and omits all symbol information from the object files.
Disabling -O3
allows the generation of debug info, but this is only feasible in Linux environments. Disabling -O3
is Windows+Cygwin build environment causes build errors related to
Portable Executable (PE) and Common Object File Format (COFF) %B: too many sections in file(%d)
.
A quick search showed that the problem can be solved either by using -O3
or using Microsoft C++ (MSVC) compiler.