Menu

#3 fix build with LTO enabled

Unstable (example)
accepted
None
5
2020-02-23
2020-02-21
Dan Horak
No

When building x3270 with LTO (by adding "-flto -ffat-lto-objects -flto-partition=one" to the compiler flags), it fails with

gcc -o x3270 Cme.o CmeBSB.o CmeLine.o CmplxMenu.o Husk.o about.o dialog.o display8.o display_charsets.o display_charsets_dbcs.o ft_gui.o host_gui.o idle_gui.o keymap.o keypad.o keysym2ucs.o menubar.o nvt_gui.o popups.o print_gui.o print_window.o printer_gui.o resources.o save.o screen.o select.o ssl_passwd_gui.o status.o stmenu.o trace_gui.o x3270.o xaa.o xactions.o xkybd.o xtables.o xutil.o fallbacks.o version.o -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L../../../obj/powerpc64le-redhat-linux-gnu/lib3270 -l3270 -L../../../obj/powerpc64le-redhat-linux-gnu/lib3270i -l3270i -L../../../obj/powerpc64le-redhat-linux-gnu/lib32xx -l32xx -lssl -lcrypto  -L../../../obj/powerpc64le-redhat-linux-gnu/lib3270stubs -l3270stubs -lXaw -lXmu -lXt -lX11 -lutil 
../../../Common/glue.c:1418:6: error: function 'error_popup_visible' redeclared as variable
 1418 | bool error_popup_visible = false;
      |      ^
../../../x3270/popups.c:1188:1: note: previously declared here
 1188 | error_popup_visible(void)
      | ^
lto1: fatal error: errors during merging of translation units
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed

The attached patch fixes it.

See https://fedoraproject.org/wiki/LTOByDefault for more details.

1 Attachments

Discussion

  • Paul Mattes

    Paul Mattes - 2020-02-23

    This has been corrected on master and 3.6.

     
  • Paul Mattes

    Paul Mattes - 2020-02-23
    • status: open --> accepted
     
  • Paul Mattes

    Paul Mattes - 2020-02-23
    • assigned_to: Paul Mattes
     

Log in to post a comment.