Link error when compiling with -fsanitize=undefined
Scott Kostyshak
skostysh at lyx.org
Sun Sep 19 11:45:19 UTC 2021
On Sun, Sep 19, 2021 at 10:35:44AM +0200, Kornel Benko wrote:
> Am Sat, 18 Sep 2021 20:52:43 -0400
> schrieb Scott Kostyshak <skostysh at lyx.org>:
>
> > On Sat, Sep 18, 2021 at 06:46:47PM +0200, Kornel Benko wrote:
> > > Am Sat, 18 Sep 2021 10:34:49 -0400
> > > schrieb Scott Kostyshak <skostysh at lyx.org>:
> > >
> > > > > I tried but failed. The problem is that tex2lyx uses
> > > > > libzlibstatic.a, ../../lib/libsupport.a to link with, but these are compiled with
> > > > > -fsanitize. So the only way is to define dummy versions as Jean-Marc pointed
> > > > > out.
> > > >
> > > > Thank you for trying, Kornel!
> > > >
> > > > Scott
> > > >
> > >
> > > Actually it was pretty easy. According to the error message,
> > > undefined reference to `typeinfo for lyx::xml::FontTag'
> > > looked wrong, since it is defined in xml.h. But src/tex2lyx/dummy_impl.cpp used
> > > FontTag _and_ did not include it xml.h.
> > >
> > > So inserting this include cured the compilation for me.
> >
> > That's great you figured it out and it doesn't add too much complexity to the code. Are
> > you sure it ended up using the -fsanitize=undefined flag ? If you do
> >
> > ldd build-dir/bin/lyx | grep ubsan
> >
> > Does it show up?
> >
> > Scott
>
> libubsan.so.1 => /usr/lib/x86_64-linux-gnu/libubsan.so.1 (0x00007f49cdfd2000)
Great, I will experiment next week with it.
Thank you,
Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210919/18384dcd/attachment.asc>
More information about the lyx-devel
mailing list