<div dir="ltr">If I try and compile mesa with clang (even using ld.bfd) I get these errors:<div><br></div><div><span style="font-family:monospace">libtool: link: clang++ -m32 -fvisibility=hidden -Werror=pointer-arith -Werror=vla -O2 -march=native -pipe -Wall -fno-math-errno -fno-trapping-math -Qunused-arguments -O2 -march=native -pipe -fuse-ld=bfd -o glsl_compiler glsl/main.o  glsl/.libs/libstandal<br>one.a -lz -lpthread -pthread
<br>glsl/.libs/libstandalone.a(libmesautil_la-disk_cache.o): In function `disk_cache_remove':
<br>/var/tmp/portage/media-libs/mesa-9999/work/mesa-9999/src/util/disk_cache.c:(.text+0x752): undefined reference to `__atomic_fetch_add_8'
<br>glsl/.libs/libstandalone.a(libmesautil_la-disk_cache.o): In function `cache_put':
<br>/var/tmp/portage/media-libs/mesa-9999/work/mesa-9999/src/util/disk_cache.c:(.text+0xa76): undefined reference to `__atomic_fetch_add_8'
<br>/var/tmp/portage/media-libs/mesa-9999/work/mesa-9999/src/util/disk_cache.c:(.text+0xe40): undefined reference to `__atomic_fetch_add_8'<br>
<br></span></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 24 Jul 2017 at 00:03 Mike Lothian <<a href="mailto:mike@fireburn.co.uk">mike@fireburn.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This is only an issue when using ld.gold, ld.bfd works fine which is probably why no one else has seen it. It only started being a problem when the dmabuff stuff landed and the makefiles were cleaned up<div><br></div><div>I tried playing around with the dummy.cpp but I couldn't get it to trigger the c++ compiler</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, 21 Jul 2017 at 13:27 Emil Velikov <<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 20 July 2017 at 21:25, Mike Lothian <<a href="mailto:mike@fireburn.co.uk" target="_blank">mike@fireburn.co.uk</a>> wrote:<br>
> Because <a href="http://libmesautil.la" rel="noreferrer" target="_blank">libmesautil.la</a> includes string_to_uint_map.o, -lstdc++ is<br>
> required for linking to succeed<br>
><br>
It's a bit suspicious why not many others are seeing this issue.<br>
Suspecting the GCC version/build flags has something to do here.<br>
<br>
> Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=101851" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=101851</a><br>
><br>
> Signed-off-by: Mike Lothian <<a href="mailto:mike@fireburn.co.uk" target="_blank">mike@fireburn.co.uk</a>><br>
> ---<br>
>  src/egl/Makefile.am | 2 +-<br>
>  1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am<br>
> index 7c1a4929b8..830ed52b86 100644<br>
> --- a/src/egl/Makefile.am<br>
> +++ b/src/egl/Makefile.am<br>
> @@ -83,7 +83,7 @@ AM_CFLAGS += $(WAYLAND_CFLAGS)<br>
>  libEGL_common_la_LIBADD += $(WAYLAND_LIBS)<br>
>  libEGL_common_la_LIBADD += $(LIBDRM_LIBS)<br>
>  libEGL_common_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/<a href="http://libwayland-drm.la" rel="noreferrer" target="_blank">libwayland-drm.la</a><br>
> -libEGL_common_la_LIBADD += $(top_builddir)/src/util/<a href="http://libmesautil.la" rel="noreferrer" target="_blank">libmesautil.la</a><br>
> +libEGL_common_la_LIBADD += $(top_builddir)/src/util/<a href="http://libmesautil.la" rel="noreferrer" target="_blank">libmesautil.la</a> -lstdc++<br>
<br>
As mentioned by Ken - ideally we won't be pulling C++ into libEGL. Can<br>
you give try converting string_to_uint_map to C?<br>
Alternatively use the dummy.cpp suggestion from Matt. We already have<br>
some examples in the codebase.<br>
<br>
Thanks<br>
Emil<br>
</blockquote></div></blockquote></div>