bugDDD - Bugs: bug #65456, Build fails with LTO

 
 

bug #65456: Build fails with LTO

Submitter:  Eli Schwartz <eschwartz>
Submitted:  Mon 11 Mar 2024 10:04:24 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  eager
Open/Closed:  Closed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 17 Mar 2024 07:55:44 PM UTC, comment #5: 

I rechecked the timeline -- The commit 7356 was one day after the release 3.4.0.

Sorry for the confusion.

Stefan Eickeler <eickeler>
Group administrator
Sun 17 Mar 2024 04:02:45 PM UTC, comment #4: 

Thank you for clarifying.

This is a bit puzzling to me, because...


$ wget https://ftp.gnu.org/gnu/ddd/ddd-3.4.0.tar.gz && bsdtar -xOf ddd-3.4.0.tar.gz ddd-3.4.0/ddd/DataDisp.C | grep 'struct GraphEdit'
--2024-03-17 12:00:31--  https://ftp.gnu.org/gnu/ddd/ddd-3.4.0.tar.gz
Resolving ftp.gnu.org... 209.51.188.20, 2001:470:142:3::b
Connecting to ftp.gnu.org|209.51.188.20|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5742233 (5.5M) [application/x-gzip]
Saving to: ‘ddd-3.4.0.tar.gz’

ddd-3.4.0.tar.gz                                     100%[=====================================================================================================================>]   5.48M  17.0MB/s    in 0.3s   

2024-03-17 12:00:31 (17.0 MB/s) - ‘ddd-3.4.0.tar.gz’ saved [5742233/5742233]

struct GraphEditState {


The official release tarball of ddd 3.4.0 does NOT contain this change. I checked for updates to that file in between 3.4.0 and trunk and didn't see anything relevant -- I didn't think to check for updates to that file before the tarball was released since I had assumed that ddd 3.4.0 would contain the code for 3.4.0.

Apologies for the confusion.

Eli Schwartz <eschwartz>
Sun 17 Mar 2024 01:50:10 PM UTC, comment #3: 

The bug is fixed in svn revision 7356.

Please use the svn/trunk for your tests to help us to improve the upcoming 3.4.1.


Stefan Eickeler <eickeler>
Group administrator
Sun 17 Mar 2024 05:49:38 AM UTC, comment #2: 

Did you read my log file attachment or follow the link? I did use 3.4.0 and the bug was present.

Please elaborate on the fix.

Eli Schwartz <eschwartz>
Fri 15 Mar 2024 06:21:34 PM UTC, comment #1: 

This bug was fixed in version 3.4.0

Please switch to 3.4.0 or the upcoming release 3.4.1

Stefan Eickeler <eickeler>
Group administrator
Mon 11 Mar 2024 10:04:24 PM UTC, original submission:  

I tried to build with the following *FLAGS to optimize the build: `-flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing`

Note the -Werror=* flags are used to help detect cases where the compiler tries to optimize by assuming UB cannot exist in the source code -- if it does exist, ordinarily the code would be miscompiled, and this says to make the miscompilation a fatal error.


I got this error:
```
/bin/sh ../libtool  --tag=CXX   --mode=link x86_64-pc-linux-gnu-g++  -O2  -Wall -W -Wwrite-strings -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -march=native -fstack-protector-all -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -trigraphs   -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -o ddd ddd.o base/assert.o base/basename.o base/compare.o base/cook.o base/cwd.o base/glob.o base/hash.o base/home.o base/isid.o base/rxclass.o base/sigName.o base/strclass.o base/tabs.o base/uniquify.o base/Logger.o base/MemCheck.o base/PrintGC.o base/SignalB.o base/TypeInfo.o base/UniqueId.o  agent/Agent.o agent/AgentM.o agent/AsyncAgent.o agent/ChunkQueue.o agent/DataLength.o agent/HandlerL.o agent/LiterateA.o agent/ReadLineA.o agent/TimeOut.o agent/TTYAgent.o x11/charsets.o x11/converters.o x11/events.o x11/findParent.o x11/findWindow.o x11/fileSBF.o x11/frame.o x11/longName.o x11/selection.o x11/verify.o x11/AutoRaise.o x11/Delay.o x11/DeleteWCB.o x11/DestroyCB.o x11/ExitCB.o x11/InitImage.o x11/Swallower.o x11/XErrorB.o motif/freeXmST.o motif/LabelH.o motif/MakeMenu.o motif/MString.o motif/ComboBox.o motif/SpinBox.o motif/TextSetS.o box/printBox.o box/AlignBox.o box/ArcBox.o box/BinBox.o box/Box.o box/BoxD.o box/BoxExtend.o box/BoxPoint.o box/BoxRegion.o box/BoxSize.o box/ColorBox.o box/CompositeB.o box/DiagBox.o box/DummyBox.o box/FixBox.o box/FontFixBox.o box/FontTable.o box/HatBox.o box/LineBox.o box/ListBox.o box/MarkBox.o box/MatchBox.o box/PrimitiveB.o box/SlopeBox.o box/StringBox.o box/THatBox.o box/TagBox.o box/TrueBox.o vslsrc/ArgNode.o vslsrc/BuiltinCN.o vslsrc/CallNode.o vslsrc/ConstNode.o vslsrc/DefCallN.o vslsrc/DummyNode.o vslsrc/LetNode.o vslsrc/NameNode.o vslsrc/ListNode.o vslsrc/TestNode.o vslsrc/ThemeVSLL.o vslsrc/TrueNode.o vslsrc/VSEFlags.o vslsrc/VSLArgList.o vslsrc/VSLBuiltin.o vslsrc/VSLDef.o vslsrc/VSLDefList.o vslsrc/VSLErr.o vslsrc/VSLLib.o vslsrc/VSLNode.o vslsrc/VSLRead.o graph/ArcGraphE.o graph/BoxEdgeA.o graph/BoxGraphN.o graph/EdgeA.o graph/Graph.o graph/GraphEdge.o graph/GraphEdit.o graph/GraphGC.o graph/GraphNode.o graph/HintGraphN.o graph/LineGraphE.o graph/LineGESI.o graph/PannedGE.o graph/PosGraphN.o graph/RegionGN.o graph/ScrolledGE.o graph/layout.o annotation.o args.o buttons.o cmdtty.o comm-manag.o complete.o ctrl.o data.o dbx-lookup.o decoration.o deref.o disp-read.o editing.o environ.o examine.o exectty.o exit.o expired.o file.o filetype.o fonts.o fortranize.o gdbinit.o history.o hostname.o index.o java.o logo.o logplayer.o mainloop.o mydialogs.o options.o plotter.o post.o print.o question.o regexps.o resolveP.o resources.o sashes.o select.o session.o settings.o shell.o shorten.o show.o simpleMenu.o source.o status.o string-fun.o tempfile.o tictactoe.o tips.o toolbar.o ungrab.o value-read.o vsldoc.o windows.o wm.o xconfig.o AliasGE.o ArgField.o BreakPoint.o CodeCache.o Command.o DataDisp.o DispBox.o DispBuffer.o DispGraph.o DispNode.o DispValue.o DispValueT.o GDBAgent.o HelpCB.o HistoryD.o PlotAgent.o PlotArea.o PosBuffer.o ProgressM.o RefreshDI.o SmartC.o SourceView.o ThemeM.o ThemeP.o Tool.o UndoBuffer.o UndoBE.o WhatNextCB.o athena_ddd/PannerM.o    -lXm -lXaw  -lXmu -lXt -lXpm  -lXext -lSM -lICE -lX11    -lreadline    -ltinfo  -lm -lelf -lm
libtool: link: x86_64-pc-linux-gnu-g++ -O2 -Wall -W -Wwrite-strings -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -march=native -fstack-protector-all -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -trigraphs -Wl,-O1 -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -o ddd ddd.o base/assert.o base/basename.o base/compare.o base/cook.o base/cwd.o base/glob.o base/hash.o base/home.o base/isid.o base/rxclass.o base/sigName.o base/strclass.o base/tabs.o base/uniquify.o base/Logger.o base/MemCheck.o base/PrintGC.o base/SignalB.o base/TypeInfo.o base/UniqueId.o agent/Agent.o agent/AgentM.o agent/AsyncAgent.o agent/ChunkQueue.o agent/DataLength.o agent/HandlerL.o agent/LiterateA.o agent/ReadLineA.o agent/TimeOut.o agent/TTYAgent.o x11/charsets.o x11/converters.o x11/events.o x11/findParent.o x11/findWindow.o x11/fileSBF.o x11/frame.o x11/longName.o x11/selection.o x11/verify.o x11/AutoRaise.o x11/Delay.o x11/DeleteWCB.o x11/DestroyCB.o x11/ExitCB.o x11/InitImage.o x11/Swallower.o x11/XErrorB.o motif/freeXmST.o motif/LabelH.o motif/MakeMenu.o motif/MString.o motif/ComboBox.o motif/SpinBox.o motif/TextSetS.o box/printBox.o box/AlignBox.o box/ArcBox.o box/BinBox.o box/Box.o box/BoxD.o box/BoxExtend.o box/BoxPoint.o box/BoxRegion.o box/BoxSize.o box/ColorBox.o box/CompositeB.o box/DiagBox.o box/DummyBox.o box/FixBox.o box/FontFixBox.o box/FontTable.o box/HatBox.o box/LineBox.o box/ListBox.o box/MarkBox.o box/MatchBox.o box/PrimitiveB.o box/SlopeBox.o box/StringBox.o box/THatBox.o box/TagBox.o box/TrueBox.o vslsrc/ArgNode.o vslsrc/BuiltinCN.o vslsrc/CallNode.o vslsrc/ConstNode.o vslsrc/DefCallN.o vslsrc/DummyNode.o vslsrc/LetNode.o vslsrc/NameNode.o vslsrc/ListNode.o vslsrc/TestNode.o vslsrc/ThemeVSLL.o vslsrc/TrueNode.o vslsrc/VSEFlags.o vslsrc/VSLArgList.o vslsrc/VSLBuiltin.o vslsrc/VSLDef.o vslsrc/VSLDefList.o vslsrc/VSLErr.o vslsrc/VSLLib.o vslsrc/VSLNode.o vslsrc/VSLRead.o graph/ArcGraphE.o graph/BoxEdgeA.o graph/BoxGraphN.o graph/EdgeA.o graph/Graph.o graph/GraphEdge.o graph/GraphEdit.o graph/GraphGC.o graph/GraphNode.o graph/HintGraphN.o graph/LineGraphE.o graph/LineGESI.o graph/PannedGE.o graph/PosGraphN.o graph/RegionGN.o graph/ScrolledGE.o graph/layout.o annotation.o args.o buttons.o cmdtty.o comm-manag.o complete.o ctrl.o data.o dbx-lookup.o decoration.o deref.o disp-read.o editing.o environ.o examine.o exectty.o exit.o expired.o file.o filetype.o fonts.o fortranize.o gdbinit.o history.o hostname.o index.o java.o logo.o logplayer.o mainloop.o mydialogs.o options.o plotter.o post.o print.o question.o regexps.o resolveP.o resources.o sashes.o select.o session.o settings.o shell.o shorten.o show.o simpleMenu.o source.o status.o string-fun.o tempfile.o tictactoe.o tips.o toolbar.o ungrab.o value-read.o vsldoc.o windows.o wm.o xconfig.o AliasGE.o ArgField.o BreakPoint.o CodeCache.o Command.o DataDisp.o DispBox.o DispBuffer.o DispGraph.o DispNode.o DispValue.o DispValueT.o GDBAgent.o HelpCB.o HistoryD.o PlotAgent.o PlotArea.o PosBuffer.o ProgressM.o RefreshDI.o SmartC.o SourceView.o ThemeM.o ThemeP.o Tool.o UndoBuffer.o UndoBE.o WhatNextCB.o athena_ddd/PannerM.o  -Wl,--as-needed -lXm -lXaw -lXmu -lXt -lXpm -lXext -lSM -lICE -lX11 -lreadline -ltinfo -lelf -lm
graph/GraphEditP.h:66:6: error: type 'GraphEditState' violates the C++ One Definition Rule [-Werror=odr]
   66 | enum GraphEditState {
      |      ^
DataDisp.C:2014:8: note: a different type is defined in another translation unit
 2014 | struct GraphEditState {
      |        ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: * [Makefile:2300: ddd] Error 1
```

Originally reported downstream: https://bugs.gentoo.org/858347

Attached is a full build log.

Eli Schwartz <eschwartz>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #55828:  build.log added by eschwartz (163KiB - text/x-log)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eickeler (Posted a comment)
  • -email is unavailable- added by eager (Updated the item)
  • -email is unavailable- added by eschwartz (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-03-15 eickeler Open/ClosedOpen Closed
    2024-03-15 eickeler StatusNone Fixed
    2024-03-12 eager Assigned toNone eager
    2024-03-11 eschwartz Attached File- Added build.log, #55828

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code