Link error when compiling with -fsanitize=undefined

Kornel Benko kornel at lyx.org
Thu Sep 16 20:13:15 UTC 2021


Am Thu, 16 Sep 2021 15:12:34 -0400
schrieb Scott Kostyshak <skostysh at lyx.org>:

> I was curious about compiling with -fsanitize=undefined.
> 
> When building (with CMake), I get the following:
> 
> [ 93%] Linking CXX executable ../../bin/tex2lyx
> cd /home/scott/lyxbuilds/master/CMakeBuild/src/tex2lyx && /usr/bin/cmake -E
> cmake_link_script CMakeFiles/tex2lyx.dir/link.txt --verbose=1 /usr/lib/ccache/c++ -Wall
> -Wextra -Wno-deprecated-copy --std=c++20 -DENABLE_ASSERTIONS=1 -fsanitize=undefined
> -fno-strict-aliasing  -O0 -g3 -D_DEBUG  -fsanitize=undefined -rdynamic
> CMakeFiles/tex2lyx.dir/Context.cpp.o CMakeFiles/tex2lyx.dir/Parser.cpp.o
> CMakeFiles/tex2lyx.dir/Preamble.cpp.o CMakeFiles/tex2lyx.dir/boost.cpp.o
> CMakeFiles/tex2lyx.dir/dummy_impl.cpp.o CMakeFiles/tex2lyx.dir/math.cpp.o
> CMakeFiles/tex2lyx.dir/table.cpp.o CMakeFiles/tex2lyx.dir/tex2lyx.cpp.o
> CMakeFiles/tex2lyx.dir/text.cpp.o
> CMakeFiles/tex2lyx.dir/__/graphics/GraphicsParams.cpp.o
> CMakeFiles/tex2lyx.dir/__/insets/ExternalTemplate.cpp.o
> CMakeFiles/tex2lyx.dir/__/insets/ExternalTransforms.cpp.o
> CMakeFiles/tex2lyx.dir/__/insets/InsetLayout.cpp.o
> CMakeFiles/tex2lyx.dir/__/Author.cpp.o CMakeFiles/tex2lyx.dir/__/CiteEnginesList.cpp.o
> CMakeFiles/tex2lyx.dir/__/Color.cpp.o CMakeFiles/tex2lyx.dir/__/Counters.cpp.o
> CMakeFiles/tex2lyx.dir/__/Encoding.cpp.o CMakeFiles/tex2lyx.dir/__/FloatList.cpp.o
> CMakeFiles/tex2lyx.dir/__/Floating.cpp.o CMakeFiles/tex2lyx.dir/__/FontInfo.cpp.o
> CMakeFiles/tex2lyx.dir/__/LaTeXPackages.cpp.o CMakeFiles/tex2lyx.dir/__/Layout.cpp.o
> CMakeFiles/tex2lyx.dir/__/LayoutFile.cpp.o
> CMakeFiles/tex2lyx.dir/__/LayoutModuleList.cpp.o CMakeFiles/tex2lyx.dir/__/Lexer.cpp.o
> CMakeFiles/tex2lyx.dir/__/ModuleList.cpp.o CMakeFiles/tex2lyx.dir/__/TextClass.cpp.o
> CMakeFiles/tex2lyx.dir/__/Spacing.cpp.o CMakeFiles/tex2lyx.dir/__/version.cpp.o
> -o ../../bin/tex2lyx  ../../lib/libsupport.a
> -lmagic /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.2 /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2
> -lz /usr/bin/ld: CMakeFiles/tex2lyx.dir/dummy_impl.cpp.o:(.data.rel+0x118): undefined
> reference to `typeinfo for lyx::xml::FontTag' collect2: error: ld returned 1 exit status
> 
> Any tip on how to solve this?
> 
> Scott

We may need to include src/xml.cpp to the list of files for tex2lyx.
(line src/tex2lyx/CMakeLists.txt:13)

	Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210916/868b80f9/attachment.asc>


More information about the lyx-devel mailing list