[Users] [Bug 4616] New: LTO build issue (failing compilation with -Werror=lto-type-mismatch)

noreply at thewildbeast.co.uk noreply at thewildbeast.co.uk
Fri Jul 22 19:13:39 UTC 2022


https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4616

            Bug ID: 4616
           Summary: LTO build issue (failing compilation with
                    -Werror=lto-type-mismatch)
           Product: Claws Mail
           Version: GIT
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Other
          Assignee: users at lists.claws-mail.org
          Reporter: bernard.cafarelli at gmail.com

How to reproduce (4.1 and current master):
CFLAGS="-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
./configure

% grep HAVE_VA_OPT config.h
#define HAVE_VA_OPT 1


/bin/sh ../libtool  --tag=CC   --mode=link gcc -Wall -Wno-pointer-sign -flto
-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing 
-Wl,--export-dynamic -o claws-mail account.o action.o addrcache.o addr_compl.o
addressadd.o addrgather.o addrharvest.o addritem.o advsearch.o alertpanel.o
autofaces.o avatars.o compose.o crash.o customheader.o displayheader.o
edittags.o enriched.o entity.o export.o file_checker.o filtering.o folder.o
folder_item_prefs.o foldersel.o folderutils.o folderview.o grouplistdialog.o
headerview.o html.o image_viewer.o imap.o imap_gtk.o import.o inc.o
localfolder.o main.o mainwindow.o manual.o matcher.o matcher_parser_lex.o
matcher_parser_parse.o mbox.o message_search.o messageview.o mh.o mh_gtk.o
mimeview.o msgcache.o news.o news_gtk.o noticeview.o oauth2.o
partial_download.o password.o password_gtk.o passwordstore.o pop.o
prefs_account.o prefs_actions.o prefs_common.o prefs_compose_writing.o
prefs_customheader.o prefs_display_header.o prefs_ext_prog.o
prefs_filtering_action.o prefs_filtering.o prefs_folder_item.o prefs_fonts.o
prefs_gtk.o prefs_image_viewer.o prefs_logging.o prefs_matcher.o
prefs_message.o prefs_migration.o prefs_msg_colors.o prefs_other.o
prefs_proxy.o prefs_quote.o prefs_receive.o prefs_send.o prefs_spelling.o
prefs_summaries.o prefs_summary_column.o prefs_summary_open.o
prefs_folder_column.o prefs_template.o prefs_themes.o prefs_toolbar.o
prefs_wrapping.o printing.o privacy.o procheader.o procmime.o procmsg.o
quote_fmt.o quote_fmt_lex.o quote_fmt_parse.o recv.o remotefolder.o
send_message.o setup.o sourcewindow.o ssl_manager.o statusbar.o stock_pixmap.o
summary_search.o summaryview.o textview.o toolbar.o undo.o uri_opener.o
wizard.o addrbook.o addrclip.o addrcustomattr.o addressbook.o
addressbook_foldersel.o addrindex.o addrquery.o addrselect.o addrduplicates.o
addrmerge.o browseldap.o editaddress.o editaddress_other_attributes_ldap.o
editbook.o editgroup.o editjpilot.o editldap_basedn.o editldap.o editvcard.o
exphtmldlg.o expldifdlg.o exporthtml.o exportldif.o importldif.o importmutt.o
importpine.o jpilot.o ldapctrl.o ldaplocate.o ldapquery.o ldapserver.o
ldapupdate.o ldaputil.o ldif.o mutt.o pine.o vcard.o etpan/libclawsetpan.la
gtk/libclawsgtk.la -lenchant-2   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0
-lharfbuzz -latk-1.0 -lcairo-gobject -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0
-lglib-2.0 -lcairo  -lresolv -lnsl -llber -lldap -lgnutls  -lnettle  -lcompface
 -lpthread -lSM -lICE  -lstartup-notification-1  -letpan -lssl -lcrypto -lz
-pthread  -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0  -lrsvg-2 -lm
-lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo   -lm -lresolv
-letpan -lssl -lcrypto -lz -pthread 
libtool: link: gcc -Wall -Wno-pointer-sign -flto -Werror=odr
-Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--export-dynamic -o
claws-mail account.o action.o addrcache.o addr_compl.o addressadd.o
addrgather.o addrharvest.o addritem.o advsearch.o alertpanel.o autofaces.o
avatars.o compose.o crash.o customheader.o displayheader.o edittags.o
enriched.o entity.o export.o file_checker.o filtering.o folder.o
folder_item_prefs.o foldersel.o folderutils.o folderview.o grouplistdialog.o
headerview.o html.o image_viewer.o imap.o imap_gtk.o import.o inc.o
localfolder.o main.o mainwindow.o manual.o matcher.o matcher_parser_lex.o
matcher_parser_parse.o mbox.o message_search.o messageview.o mh.o mh_gtk.o
mimeview.o msgcache.o news.o news_gtk.o noticeview.o oauth2.o
partial_download.o password.o password_gtk.o passwordstore.o pop.o
prefs_account.o prefs_actions.o prefs_common.o prefs_compose_writing.o
prefs_customheader.o prefs_display_header.o prefs_ext_prog.o
prefs_filtering_action.o prefs_filtering.o prefs_folder_item.o prefs_fonts.o
prefs_gtk.o prefs_image_viewer.o prefs_logging.o prefs_matcher.o
prefs_message.o prefs_migration.o prefs_msg_colors.o prefs_other.o
prefs_proxy.o prefs_quote.o prefs_receive.o prefs_send.o prefs_spelling.o
prefs_summaries.o prefs_summary_column.o prefs_summary_open.o
prefs_folder_column.o prefs_template.o prefs_themes.o prefs_toolbar.o
prefs_wrapping.o printing.o privacy.o procheader.o procmime.o procmsg.o
quote_fmt.o quote_fmt_lex.o quote_fmt_parse.o recv.o remotefolder.o
send_message.o setup.o sourcewindow.o ssl_manager.o statusbar.o stock_pixmap.o
summary_search.o summaryview.o textview.o toolbar.o undo.o uri_opener.o
wizard.o addrbook.o addrclip.o addrcustomattr.o addressbook.o
addressbook_foldersel.o addrindex.o addrquery.o addrselect.o addrduplicates.o
addrmerge.o browseldap.o editaddress.o editaddress_other_attributes_ldap.o
editbook.o editgroup.o editjpilot.o editldap_basedn.o editldap.o editvcard.o
exphtmldlg.o expldifdlg.o exporthtml.o exportldif.o importldif.o importmutt.o
importpine.o jpilot.o ldapctrl.o ldaplocate.o ldapquery.o ldapserver.o
ldapupdate.o ldaputil.o ldif.o mutt.o pine.o vcard.o 
etpan/.libs/libclawsetpan.a gtk/.libs/libclawsgtk.a -lgmodule-2.0 -lgthread-2.0
-lenchant-2 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0
-lcairo-gobject -lnsl -llber -lldap -lgnutls -lnettle -lcompface -lpthread -lSM
-lICE -lstartup-notification-1 -ldbus-glib-1 -ldbus-1 -lrsvg-2 -lgio-2.0
-lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo -lm -lresolv -letpan -lssl
-lcrypto -lz -pthread
common/utils.h:484:6: error: type of 'debug_print_real' does not match original
declaration [-Werror=lto-type-mismatch]
  484 | void debug_print_real (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
      |      ^
common/utils.c:2973:6: note: types have different parameter counts
 2973 | void debug_print_real(const char *file, int line, const gchar *format,
...)
      |      ^
common/utils.c:2973:6: note: 'debug_print_real' was previously declared here
lto1: some warnings being treated as errors
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:1435: claws-mail] Error 1



Adding "#include "config.h" in the header "#ifdef HAVE_CONFIG_H" fixes the
warning:
https://git.claws-mail.org/?p=claws.git;a=blob;f=src/common/utils.h;h=43f68a2ac63819a8db0b0ac2471ac2b4284f81c5;hb=HEAD#l26


Downstream bug: https://bugs.gentoo.org/859490

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Users mailing list