<div dir="ltr"><div><div><div>On Fri, 11 May 2018 15:12:55 +0200 Sebastian Ramacher <<a href="mailto:sramacher@debian.org">sramacher@debian.org</a>> wrote:<br>
> On 2018-05-10 06:43:34, Vincas Dargis wrote:<br>
> > If I export these variables:<br>
> > <br>
> > export DEB_BUILD_MAINT_OPTIONS=sanitize=+address,+undefined<br>
> <br>
> You'll need to pass that via DEB_BUILD_OPTIONS to not interfere with the<br>
> options set in debian/rules.<br><br></div>Thanks, though I did not help either.<br><br></div>I had to modify Makefile.am and bin/Makefile.am to prepend LD_PRELOAD to avoid errors when executing vlc-cache-gen, due to that<br>"ASan runtime does not come first in initial library list" error:<br><br>```<br>--- vlc-2.2.7.orig/bin/Makefile.am<br>+++ vlc-2.2.7/bin/Makefile.am<br>@@ -83,7 +83,7 @@ MOSTLYCLEANFILES = $(noinst_DATA)<br> ../modules/plugins.dat: vlc-cache-gen$(EXEEXT)<br>        $(AM_V_at)rm -f ../modules/plugins.dat<br>        $(AM_V_GEN)if test "$(build)" = "$(host)"; then \<br>-               ./vlc-cache-gen$(EXEEXT) ../modules ; \<br>+        LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.3:/usr/lib/x86_64-linux-gnu/libubsan.so.0 ./vlc-cache-gen$(EXEEXT) ../modules ; \<br>        else \<br>                echo "Cross-compilation: cache generation skipped!" ; \<br>        fi<br>```<br><br>```<br>--- vlc-2.2.7.orig/Makefile.am<br>+++ vlc-2.2.7/Makefile.am                               <br>@@ -985,6 +985,7 @@ install-exec-hook:<br>        if test "$(build)" = "$(host)"; then \ <br>                PATH="$(DESTDIR)$(bindir):$$PATH" \<br>                LD_LIBRARY_PATH="$(DESTDIR)$(libdir):$$LD_LIBRARY_PATH" \<br>+               LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.3:/usr/lib/x86_64-linux-gnu/libubsan.so.0 \<br>                "$(DESTDIR)$(vlclibdir)/vlc-cache-gen$(EXEEXT)" \<br>                         "$(DESTDIR)$(vlclibdir)/plugins" ; \<br>        else \                    <br>```<br><br></div>Also, I had to set that ASAN_OPTIONS=detect_leaks=0 when building and when installing rebuilt package, for <br>the same issue with vlc-cache-gen + ASAN.<br><div><div><div><div> 
<br>
> If you are tracking down a bug, please try it with 3.0.x first. If it fails<br>
> there, consider using configure's --with-sanitizier to get a build with<br>
> sanitizers.<br><br></div><div>The problem in my use case that wrapper library VLC-QT does not yet support 3.0.x, I can't do that easily.<br><br></div><div>And it seems `--with-sanitizer` is only on vlc >=3 right? .<br><br></div><div>Anyway, I found "sanitize" option in `man dpkg-buildflags" and expected for it to work with VLC package.</div></div></div></div></div>