lnav icon indicating copy to clipboard operation
lnav copied to clipboard

Build failure in gcc with link time optimization

Open bowlofeggs opened this issue 3 years ago • 0 comments

lnav version 0.10.1

Describe the bug Gentoo's QA system found that lnav does not build with lto enabled.

To Reproduce The following CFLAGS were used:

CFLAGS="-O2 -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"

The build phase resulted in these error messages:

lnav_config.cc:376:8: error: type �-Werror=odr][]]
  376 | struct userdata {
      |        ^
log_format_loader.cc:70:8: note: a different type is defined in another translation unit
   70 | struct userdata {
      |        ^
lnav_config.cc:379:21: note: the first difference of corresponding definitions is field ‘ud_errors’
  379 |     vector<string> &ud_errors;
      |                     ^
log_format_loader.cc:71:27: note: a field with different name is defined in another translation unit
   71 |     ghc::filesystem::path ud_format_path;
      |                           ^
environ_vtab.cc:57:8: error: type �-Werror=odr][]]
   57 | struct vtab_cursor {
      |        ^
log_vtab_impl.cc:177:8: note: a different type is defined in another translation unit
  177 | struct vtab_cursor {
      |        ^
environ_vtab.cc:59:12: note: the first difference of corresponding definitions is field ‘env_cursor’
   59 |     char **env_cursor;
      |            ^
log_vtab_impl.cc:179:32: note: a field with different name is defined in another translation unit
  179 |     struct log_cursor          log_cursor;
      |                                ^
environ_vtab.cc:52:8: error: type �-Werror=odr][]]
   52 | struct vtab {
      |        ^
log_vtab_impl.cc:169:8: note: a different type is defined in another translation unit
  169 | struct vtab {
      |        ^
log_vtab_impl.cc:172:22: note: the first difference of corresponding definitions is field ‘tc’
  172 |     textview_curses *tc{nullptr};
      |                      ^
log_vtab_impl.cc:169:8: note: a type with different number of fields is defined in another translation unit
  169 | struct vtab {
      |        ^
lnav_config.cc:376:8: error: type �-Werror=odr][]]
  376 | struct userdata {
      |        ^
log_format_loader.cc:70:8: note: a different type is defined in another translation unit
   70 | struct userdata {
      |        ^
lnav_config.cc:379:21: note: the first difference of corresponding definitions is field ‘ud_errors’
  379 |     vector<string> &ud_errors;
      |                     ^
log_format_loader.cc:71:27: note: a field with different name is defined in another translation unit
   71 |     ghc::filesystem::path ud_format_path;
      |                           ^
environ_vtab.cc:57:8: error: type �-Werror=odr][]]
   57 | struct vtab_cursor {
      |        ^
log_vtab_impl.cc:177:8: note: a different type is defined in another translation unit
  177 | struct vtab_cursor {
      |        ^
environ_vtab.cc:59:12: note: the first difference of corresponding definitions is field ‘env_cursor’
   59 |     char **env_cursor;
      |            ^
log_vtab_impl.cc:179:32: note: a field with different name is defined in another translation unit
  179 |     struct log_cursor          log_cursor;
      |                                ^
environ_vtab.cc:52:8: error: type �-Werror=odr][]]
   52 | struct vtab {
      |        ^
log_vtab_impl.cc:169:8: note: a different type is defined in another translation unit
  169 | struct vtab {
      |        ^
log_vtab_impl.cc:172:22: note: the first difference of corresponding definitions is field ‘tc’
  172 |     textview_curses *tc{nullptr};
      |                      ^
log_vtab_impl.cc:169:8: note: a type with different number of fields is defined in another translation unit
  169 | struct vtab {
      |        ^
lto1: some warnings being treated as errors

Original gentoo bug report: https://bugs.gentoo.org/854123 Full build log: https://854123.bugs.gentoo.org/attachment.cgi?id=787406

bowlofeggs avatar Jun 28 '22 00:06 bowlofeggs