bug-ddd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #65456] Build fails with LTO


From: Eli Schwartz
Subject: [bug #65456] Build fails with LTO
Date: Mon, 11 Mar 2024 18:04:24 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?65456>

                 Summary: Build fails with LTO
                   Group: DDD
               Submitter: eschwartz
               Submitted: Mon 11 Mar 2024 10:04:24 PM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
                 Release: None
         Discussion Lock: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 11 Mar 2024 10:04:24 PM UTC By: Eli Schwartz <eschwartz>
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.






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Name: build.log  Size: 163KiB
<http://savannah.gnu.org/bugs/download.php?file_id=55828>

    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://git.savannah.nongnu.org/cgit/administration/savane.git/snapshot/savane-f95530753e974ac1d60f8c0c697f148099475f1a.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65456>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]