Re: [Mesa-dev] [PATCH] egl/wayland: Fix linking libEGL_common.la

2017-07-23 Thread Mike Lothian
If I try and compile mesa with clang (even using ld.bfd) I get these errors:

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
one.a -lz -lpthread -pthread
glsl/.libs/libstandalone.a(libmesautil_la-disk_cache.o): In function
`disk_cache_remove':
/var/tmp/portage/media-libs/mesa-/work/mesa-/src/util/disk_cache.c:(.text+0x752):
undefined reference to `__atomic_fetch_add_8'
glsl/.libs/libstandalone.a(libmesautil_la-disk_cache.o): In function
`cache_put':
/var/tmp/portage/media-libs/mesa-/work/mesa-/src/util/disk_cache.c:(.text+0xa76):
undefined reference to `__atomic_fetch_add_8'
/var/tmp/portage/media-libs/mesa-/work/mesa-/src/util/disk_cache.c:(.text+0xe40):
undefined reference to `__atomic_fetch_add_8'


On Mon, 24 Jul 2017 at 00:03 Mike Lothian  wrote:

> 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
>
> I tried playing around with the dummy.cpp but I couldn't get it to trigger
> the c++ compiler
>
> On Fri, 21 Jul 2017 at 13:27 Emil Velikov 
> wrote:
>
>> On 20 July 2017 at 21:25, Mike Lothian  wrote:
>> > Because libmesautil.la includes string_to_uint_map.o, -lstdc++ is
>> > required for linking to succeed
>> >
>> It's a bit suspicious why not many others are seeing this issue.
>> Suspecting the GCC version/build flags has something to do here.
>>
>> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101851
>> >
>> > Signed-off-by: Mike Lothian 
>> > ---
>> >  src/egl/Makefile.am | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
>> > index 7c1a4929b8..830ed52b86 100644
>> > --- a/src/egl/Makefile.am
>> > +++ b/src/egl/Makefile.am
>> > @@ -83,7 +83,7 @@ AM_CFLAGS += $(WAYLAND_CFLAGS)
>> >  libEGL_common_la_LIBADD += $(WAYLAND_LIBS)
>> >  libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
>> >  libEGL_common_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/
>> libwayland-drm.la
>> > -libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la
>> > +libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la
>> -lstdc++
>>
>> As mentioned by Ken - ideally we won't be pulling C++ into libEGL. Can
>> you give try converting string_to_uint_map to C?
>> Alternatively use the dummy.cpp suggestion from Matt. We already have
>> some examples in the codebase.
>>
>> Thanks
>> Emil
>>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] egl/wayland: Fix linking libEGL_common.la

2017-07-23 Thread Mike Lothian
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

I tried playing around with the dummy.cpp but I couldn't get it to trigger
the c++ compiler

On Fri, 21 Jul 2017 at 13:27 Emil Velikov  wrote:

> On 20 July 2017 at 21:25, Mike Lothian  wrote:
> > Because libmesautil.la includes string_to_uint_map.o, -lstdc++ is
> > required for linking to succeed
> >
> It's a bit suspicious why not many others are seeing this issue.
> Suspecting the GCC version/build flags has something to do here.
>
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101851
> >
> > Signed-off-by: Mike Lothian 
> > ---
> >  src/egl/Makefile.am | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
> > index 7c1a4929b8..830ed52b86 100644
> > --- a/src/egl/Makefile.am
> > +++ b/src/egl/Makefile.am
> > @@ -83,7 +83,7 @@ AM_CFLAGS += $(WAYLAND_CFLAGS)
> >  libEGL_common_la_LIBADD += $(WAYLAND_LIBS)
> >  libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
> >  libEGL_common_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/
> libwayland-drm.la
> > -libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la
> > +libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la
> -lstdc++
>
> As mentioned by Ken - ideally we won't be pulling C++ into libEGL. Can
> you give try converting string_to_uint_map to C?
> Alternatively use the dummy.cpp suggestion from Matt. We already have
> some examples in the codebase.
>
> Thanks
> Emil
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] egl/wayland: Fix linking libEGL_common.la

2017-07-21 Thread Emil Velikov
On 20 July 2017 at 21:25, Mike Lothian  wrote:
> Because libmesautil.la includes string_to_uint_map.o, -lstdc++ is
> required for linking to succeed
>
It's a bit suspicious why not many others are seeing this issue.
Suspecting the GCC version/build flags has something to do here.

> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101851
>
> Signed-off-by: Mike Lothian 
> ---
>  src/egl/Makefile.am | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
> index 7c1a4929b8..830ed52b86 100644
> --- a/src/egl/Makefile.am
> +++ b/src/egl/Makefile.am
> @@ -83,7 +83,7 @@ AM_CFLAGS += $(WAYLAND_CFLAGS)
>  libEGL_common_la_LIBADD += $(WAYLAND_LIBS)
>  libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
>  libEGL_common_la_LIBADD += 
> $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la
> -libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la
> +libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la -lstdc++

As mentioned by Ken - ideally we won't be pulling C++ into libEGL. Can
you give try converting string_to_uint_map to C?
Alternatively use the dummy.cpp suggestion from Matt. We already have
some examples in the codebase.

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] egl/wayland: Fix linking libEGL_common.la

2017-07-20 Thread Matt Turner
On Thu, Jul 20, 2017 at 1:25 PM, Mike Lothian  wrote:
> Because libmesautil.la includes string_to_uint_map.o, -lstdc++ is
> required for linking to succeed
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101851
>
> Signed-off-by: Mike Lothian 
> ---
>  src/egl/Makefile.am | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
> index 7c1a4929b8..830ed52b86 100644
> --- a/src/egl/Makefile.am
> +++ b/src/egl/Makefile.am
> @@ -83,7 +83,7 @@ AM_CFLAGS += $(WAYLAND_CFLAGS)
>  libEGL_common_la_LIBADD += $(WAYLAND_LIBS)
>  libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
>  libEGL_common_la_LIBADD += 
> $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la
> -libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la
> +libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la -lstdc++

Instead of adding -lstdc++ to LIBADD, you want to use the C++ linker
by specifying a dummy cpp file in EXTRA_*_SOURCES. grep for dummy.cpp
and you'll fine examples.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] egl/wayland: Fix linking libEGL_common.la

2017-07-20 Thread Mike Lothian
Because libmesautil.la includes string_to_uint_map.o, -lstdc++ is
required for linking to succeed

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101851

Signed-off-by: Mike Lothian 
---
 src/egl/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
index 7c1a4929b8..830ed52b86 100644
--- a/src/egl/Makefile.am
+++ b/src/egl/Makefile.am
@@ -83,7 +83,7 @@ AM_CFLAGS += $(WAYLAND_CFLAGS)
 libEGL_common_la_LIBADD += $(WAYLAND_LIBS)
 libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
 libEGL_common_la_LIBADD += 
$(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la
-libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la
+libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la -lstdc++
 dri2_backend_FILES += drivers/dri2/platform_wayland.c  \
drivers/dri2/linux-dmabuf-unstable-v1-protocol.c
 endif
-- 
2.13.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev