From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bug-guix-bounces+larch=yhetil.org@gnu.org>
Received: from mp12.migadu.com ([2001:41d0:403:4789::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms9.migadu.com with LMTPS
	id xVVeJB1N1WRMggEASxT56A
	(envelope-from <bug-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 10 Aug 2023 22:48:29 +0200
Received: from aspmx1.migadu.com ([2001:41d0:403:4789::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp12.migadu.com with LMTPS
	id 6A+jIx1N1WSoxAAAauVa8A
	(envelope-from <bug-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 10 Aug 2023 22:48:29 +0200
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 059113B508
	for <larch@yhetil.org>; Thu, 10 Aug 2023 22:48:29 +0200 (CEST)
Authentication-Results: aspmx1.migadu.com;
	dkim=none;
	spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org";
	dmarc=none
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1691700509;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:mime-version:mime-version:
	 content-type:content-type:resent-cc:resent-from:resent-sender:
	 resent-message-id:in-reply-to:in-reply-to:references:references:
	 list-id:list-help:list-unsubscribe:list-subscribe:list-post;
	bh=neNWrQSMSkd7vIgFeB6vtmLvq77etY2M+duReC1MRFI=;
	b=BpxG7cOyTouseXHuoDbC9Ldhw3lGqJqKvSzF4+4wh9026B/kUqXZHCHqs/ho5kdsWPUHgJ
	EN/4EGrjZcb2WHjeoUMmm9SzfFL795W4/69WnEsxnggz6v6gC4d9U74Es/1YAtC82ntPyi
	hxt0BT8jACKBgmbtXs/n9fXRciuJps+ZaN1E5MRllo6ng5k0m6EH/jE59RJCctO3vYbjDi
	iZkBgVvQKkG12jxfu23gy/r8kQb3fUbeIz7dzc8O9z8TRjjqwfNbbayZPvKaBCts0jHjE5
	7sG4xHhJZbK4kSTF2fqLoVV2M3n53sdE5aQpXgMkRmC9pnrwdWqEzJazfFsbFA==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=none;
	spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org";
	dmarc=none
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691700509; a=rsa-sha256; cv=none;
	b=ac7VSBhzN8qF5VGgqYJY2V90AITsx9XahLUBzdyFp1dNz0lkrWr+cP3V+S1ApxRPporfJv
	Y0UF3KzyIGGYBtu3dcYCwNNM4Ir3qAkdTNW9TvCpXFHal4kKLDUwaafqGZJj6xikPFyShQ
	b6PtsZ3t46iXT5oEGYUZSwkvXB9dZ53t3z/tkFF9AADz4Qo4PVmuQY83nD6wjZkVB9lq+x
	WYjCfyaQCgLhsRbZaCNHAaZBxus1fNnAc+el/0+GEccy9xazzGMxH5/6NYv1Qb6M0h6Jx7
	9FLcWTb24+VJfl+mFnGYyKXGqmL8khpzD7SB39SD/t6oAVWuAcawXHeEvkuaRA==
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-guix-bounces@gnu.org>)
	id 1qUCZj-0003cU-Fp; Thu, 10 Aug 2023 16:48:08 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1qUCZe-0003an-PW
 for bug-guix@gnu.org; Thu, 10 Aug 2023 16:48:02 -0400
Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1qUCZe-0000cZ-BV
 for bug-guix@gnu.org; Thu, 10 Aug 2023 16:48:02 -0400
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qUCZd-0000hq-My
 for bug-guix@gnu.org; Thu, 10 Aug 2023 16:48:01 -0400
X-Loop: help-debbugs@gnu.org
Subject: bug#64981: GTK4 applications broken (missing libGLESv2)
References: <87h6pjag4n.fsf@riseup.net>
In-Reply-To: <87h6pjag4n.fsf@riseup.net>
Resent-From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-guix@gnu.org
Resent-Date: Thu, 10 Aug 2023 20:48:01 +0000
Resent-Message-ID: <handler.64981.B64981.16917004702646@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 64981
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: moreinfo
To: 64981@debbugs.gnu.org
Received: via spool by 64981-submit@debbugs.gnu.org id=B64981.16917004702646
 (code B ref 64981); Thu, 10 Aug 2023 20:48:01 +0000
Received: (at 64981) by debbugs.gnu.org; 10 Aug 2023 20:47:50 +0000
Received: from localhost ([127.0.0.1]:44181 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1qUCZR-0000ga-2F
 for submit@debbugs.gnu.org; Thu, 10 Aug 2023 16:47:50 -0400
Received: from cyberdimension.org ([2001:910:1314:ffff::1]:40400
 helo=gnutoo.cyberdimension.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <GNUtoo@cyberdimension.org>) id 1qUCZM-0000fk-3K
 for 64981@debbugs.gnu.org; Thu, 10 Aug 2023 16:47:47 -0400
Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1])
 by cyberdimension.org (OpenSMTPD) with ESMTP id 8854a438
 for <64981@debbugs.gnu.org>; Thu, 10 Aug 2023 20:47:39 +0000 (UTC)
Received: from primary_laptop (localhost [::1])
 by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id d97d3631
 for <64981@debbugs.gnu.org>; Thu, 10 Aug 2023 20:47:39 +0000 (UTC)
Date: Thu, 10 Aug 2023 22:47:08 +0200
From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Message-ID: <20230810224708.5d091140@primary_laptop>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="Sig_/WTd18wWUBQX6TYIcNl1kCQt";
 protocol="application/pgp-signature"; micalg=pgp-sha256
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-guix@gnu.org
List-Id: Bug reports for GNU Guix <bug-guix.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-guix>,
 <mailto:bug-guix-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-guix>
List-Post: <mailto:bug-guix@gnu.org>
List-Help: <mailto:bug-guix-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-guix>,
 <mailto:bug-guix-request@gnu.org?subject=subscribe>
Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org
Sender: bug-guix-bounces+larch=yhetil.org@gnu.org
X-Migadu-Flow: FLOW_IN
X-Migadu-Country: US
X-Migadu-Queue-Id: 059113B508
X-Migadu-Scanner: mx1.migadu.com
X-Spam-Score: -4.78
X-Migadu-Spam-Score: -4.78
X-TUID: HwtsmqsI4xKC

--Sig_/WTd18wWUBQX6TYIcNl1kCQt
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,

I've the same issue for several programs.

I'm using sway and I tried to use dino.

I've built dino like that:
> guix install dino \
> 	--with-debug-info=3Dgtk \
> 	--with-debug-info=3Dglib \
> 	--with-debug-info=3Dglibc \
> 	--with-debug-info=3Dlibepoxy
>=20
> cat $(which dino) | sed 's#exec -a "$0" #exec -a "$0" gdb #g' > dino
> chmod +x dino

And here's my gdbinit:
> $ cat ~/.gdbinit=20
> guile
> (use-modules (gdb))
> (execute (string-append "set debug-file-directory "
>                         (or (getenv "GDB_DEBUG_FILE_DIRECTORY")
>                             "~/.guix-profile/lib/debug")))
> end

Then I run ./dino and I get that:
> $ ./dino=20
> GNU gdb (GDB) 12.1
> Copyright (C) 2022 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.h=
tml>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-unknown-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <https://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
>     <http://www.gnu.org/software/gdb/documentation/>.
>=20
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from /gnu/store/qhc45j9hjspvig6m1wjvx4nxpjwsnq4d-dino-0.4=
.2/bin/.dino-real...
> (No debugging symbols found in /gnu/store/qhc45j9hjspvig6m1wjvx4nxpjwsnq4=
d-dino-0.4.2/bin/.dino-real)
> (gdb) run
> Starting program: /gnu/store/qhc45j9hjspvig6m1wjvx4nxpjwsnq4d-dino-0.4.2/=
bin/.dino-real=20
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppm=
xi3-glibc-2.35/lib/libthread_db.so.1".
> [New Thread 0x7ffff33ff640 (LWP 27192)]
> [Thread 0x7ffff33ff640 (LWP 27192) exited]
> [New Thread 0x7ffff33ff640 (LWP 27193)]
> [New Thread 0x7ffff1bf4640 (LWP 27194)]
> [Detaching after fork from child process 27195]
> [New Thread 0x7ffff13f3640 (LWP 27196)]
> [New Thread 0x7ffff0bea640 (LWP 27197)]
> [New Thread 0x7fffe3611640 (LWP 27198)]
> [New Thread 0x7fffe2e10640 (LWP 27199)]
> [New Thread 0x7fffe260f640 (LWP 27200)]
> [New Thread 0x7fffe1e0e640 (LWP 27201)]
> [Thread 0x7fffe260f640 (LWP 27200) exited]
> [New Thread 0x7fffe260f640 (LWP 27202)]
> [Thread 0x7fffe1e0e640 (LWP 27201) exited]
> [New Thread 0x7fffe1e0e640 (LWP 27203)]
> [Thread 0x7fffe260f640 (LWP 27202) exited]
> [Thread 0x7fffe1e0e640 (LWP 27203) exited]
> [New Thread 0x7fffe1e0e640 (LWP 27204)]
> [New Thread 0x7fffe260f640 (LWP 27205)]
> [Thread 0x7fffe1e0e640 (LWP 27204) exited]
> [Thread 0x7fffe260f640 (LWP 27205) exited]
> [New Thread 0x7fffe260f640 (LWP 27206)]
> [New Thread 0x7fffe1e0e640 (LWP 27207)]
> [Thread 0x7fffe260f640 (LWP 27206) exited]
> [Thread 0x7fffe1e0e640 (LWP 27207) exited]
> [New Thread 0x7fffe1e0e640 (LWP 27208)]
> [New Thread 0x7fffe260f640 (LWP 27209)]
> [New Thread 0x7fffe1318640 (LWP 27210)]
> [New Thread 0x7fffe0b17640 (LWP 27211)]
> [New Thread 0x7fffbf3ff640 (LWP 27212)]
> [New Thread 0x7fffbebfe640 (LWP 27213)]
> [New Thread 0x7fffabfff640 (LWP 27214)]
> [New Thread 0x7fffab7fe640 (LWP 27215)]
> [New Thread 0x7fffaaffd640 (LWP 27216)]
> Couldn't open libGLESv2.so.2: libGLESv2.so.2: cannot open shared object f=
ile: No such file or directory
>=20
> Thread 1 ".dino-real" received signal SIGABRT, Aborted.
> 0x00007ffff48e4fec in __pthread_kill_implementation () from /gnu/store/gs=
jczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libc.so.6
> (gdb) bt
> #0  0x00007ffff48e4fec in __pthread_kill_implementation ()
>    from /gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libc.s=
o.6
> #1  0x00007ffff489b202 in raise () from /gnu/store/gsjczqir1wbz8p770zndrp=
w4rnppmxi3-glibc-2.35/lib/libc.so.6
> #2  0x00007ffff488645b in abort () from /gnu/store/gsjczqir1wbz8p770zndrp=
w4rnppmxi3-glibc-2.35/lib/libc.so.6
> #3  0x00007ffff4590eb5 in get_dlopen_handle (load=3Dtrue, exit_on_fail=3D=
true,=20
>     lib_name=3D0x7ffff45b26d3 "libGLESv2.so.2", handle=3D0x7ffff45ff028 <=
api+72>)
>     at ../source/src/dispatch_common.c:316
> #4  get_dlopen_handle (handle=3D0x7ffff45ff028 <api+72>, lib_name=3D0x7ff=
ff45b26d3 "libGLESv2.so.2",=20
>     exit_on_fail=3D<optimized out>, load=3D<optimized out>) at ../source/=
src/dispatch_common.c:293
> #5  0x00007ffff4591842 in epoxy_gles2_dlsym (name=3D0x7ffff45a536b <entry=
point_strings+25867> "glGetString")
>     at ../source/src/dispatch_common.c:722
> #6  epoxy_gles2_dlsym (name=3D0x7ffff45a536b <entrypoint_strings+25867> "=
glGetString")
>     at ../source/src/dispatch_common.c:717
> #7  epoxy_get_bootstrap_proc_address (name=3D0x7ffff45a536b <entrypoint_s=
trings+25867> "glGetString")
>     at ../source/src/dispatch_common.c:835
> #8  0x00007ffff4534303 in gl_single_resolver (provider=3Dprovider@entry=
=3DPROVIDER_always_present,=20
>     entrypoint_offset=3D<optimized out>, entrypoint_offset@entry=3D25867)=
 at src/gl_generated_dispatch.c:75810
> #9  0x00007ffff454485f in epoxy_glGetString_resolver () at src/gl_generat=
ed_dispatch.c:89821
> #10 epoxy_glGetString_global_rewrite_ptr (name=3D7938) at src/gl_generate=
d_dispatch.c:50154
> #11 0x00007ffff4590cd5 in epoxy_internal_gl_version (version_string=3Dver=
sion_string@entry=3D7938,=20
>     error_version=3Derror_version@entry=3D0, factor=3Dfactor@entry=3D10) =
at ../source/src/dispatch_common.c:397
> #12 0x00007ffff4591091 in epoxy_gl_version () at ../source/src/dispatch_c=
ommon.c:437
> #13 0x00007ffff5480bb5 in gdk_gl_context_check_extensions (context=3D0xd0=
65e0)
>     at ../gtk-4.8.1/gdk/gdkglcontext.c:1498
> #14 gdk_gl_context_make_current (context=3D0xd065e0) at ../gtk-4.8.1/gdk/=
gdkglcontext.c:1605
> #15 0x00007ffff54afd18 in gsk_gl_renderer_realize (error=3D0x7fffffffa978=
, surface=3D<optimized out>,=20
>     renderer=3D0xc68200) at ../gtk-4.8.1/gsk/gl/gskglrenderer.c:123
> #16 gsk_gl_renderer_realize (renderer=3D0xc68200, surface=3D<optimized ou=
t>, error=3D0x7fffffffa978)
>     at ../gtk-4.8.1/gsk/gl/gskglrenderer.c:86
> #17 0x00007ffff5498fa7 in gsk_renderer_realize (renderer=3Drenderer@entry=
=3D0xc68200,=20
>     surface=3Dsurface@entry=3D0xb8c0b0, error=3Derror@entry=3D0x7fffffffa=
978) at ../gtk-4.8.1/gsk/gskrenderer.c:309
> #18 0x00007ffff5499786 in gsk_renderer_new_for_surface (surface=3Dsurface=
@entry=3D0xb8c0b0)
>     at ../gtk-4.8.1/gsk/gskrenderer.c:649
> #19 0x00007ffff5322ad8 in gtk_window_realize (widget=3D0x95c2f0) at ../gt=
k-4.8.1/gtk/gtkwindow.c:4294
> #20 0x00007ffff4ba64ef in g_closure_invoke ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #21 0x00007ffff4bb7f6d in ?? ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #22 0x00007ffff4bbe689 in g_signal_emit_valist ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #23 0x00007ffff4bbebb2 in g_signal_emit ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #24 0x00007ffff5315931 in gtk_widget_realize (widget=3D0x95c2f0) at ../gt=
k-4.8.1/gtk/gtkwidget.c:3412
> #25 0x00007ffff5327a72 in gtk_window_show (widget=3D0x95c2f0) at ../gtk-4=
.8.1/gtk/gtkwindow.c:3818
> #26 0x00007ffff4ba6719 in ?? ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #27 0x00007ffff4bbea16 in g_signal_emit_valist ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #28 0x00007ffff4bbebb2 in g_signal_emit ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #29 0x00007ffff530acf1 in gtk_widget_show (widget=3D0x95c2f0) at ../gtk-4=
.8.1/gtk/gtkwidget.c:2692
> #30 0x00007ffff532559c in gtk_window_present_with_time (window=3D<optimiz=
ed out>, timestamp=3D0)
>     at ../gtk-4.8.1/gtk/gtkwindow.c:5237
> #31 0x00007ffff4ba64ef in g_closure_invoke ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #32 0x00007ffff4bb8306 in ?? ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #33 0x00007ffff4bbe689 in g_signal_emit_valist ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #34 0x00007ffff4bbebb2 in g_signal_emit ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgo=
bject-2.0.so.0
> #35 0x00007ffff4cd6328 in ?? ()
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgi=
o-2.0.so.0
> #36 0x00007ffff4cd647e in g_application_run ()
> --Type <RET> for more, q to quit, c to continue without paging--
>    from /gnu/store/nb40pwd37v6i1g4b1fq4l6q4h9px3asr-glib-2.72.3/lib/libgi=
o-2.0.so.0
> #37 0x000000000042ef77 in main ()

So for some reasons it fails in libepoxy.

So I tried to reproduce the issue:
> $ cat dlopen-test.c
> /*
>  * Copyright =C2=A9 2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.or=
g>
>  *
>  * This program is free software: you can redistribute it and/or
> modify
>  * it under the terms of the GNU General Public License as published
> by
>  * the Free Software Foundation, either version 3 of the License, or
>  * (at your option) any later version.
>  *
>  * This program is distributed in the hope that it will be useful,
>  * but WITHOUT ANY WARRANTY; without even the implied warranty of
>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>  * GNU General Public License for more details.
>  *
>  * You should have received a copy of the GNU General Public License
>  * along with this program.  If not, see
> <http://www.gnu.org/licenses/>. */
>=20
> #include <assert.h>
> #include <dlfcn.h>
> #include <stdio.h>      =20
>=20
> int main()
> {
> 	void* handle;
>=20
> 	assert((RTLD_LAZY|RTLD_LOCAL) =3D=3D 1);
>       =20
> 	handle =3D dlopen("libGLESv2.so.2", RTLD_LAZY|RTLD_LOCAL);
>=20
> 	if (handle =3D=3D NULL) {
> 		fprintf(stderr, "error: %s\n", dlerror());
> 	} else {
> 		printf("handle: %p\n", handle);
> 	}
>=20
> 	return 0;
> }

And there it works:
> $ gcc dlopen-test.c
> [gnutoo@primary_laptop dino]$ ./a.out=20
> handle: 0x9a52e0

But it somehow fails in my gdb sessions:
> (gdb) set directories ~/debug/rqlhj8xk7x34pnsq8y3gzf7dzwyn9flk-libepoxy-1=
.5.10-checkout/source/
> (gdb) f 4
> #4  get_dlopen_handle (handle=3D0x7ffff45ff028 <api+72>, lib_name=3D0x7ff=
ff45b26d3 "libGLESv2.so.2",=20
>     exit_on_fail=3D<optimized out>, load=3D<optimized out>) at ../source/=
src/dispatch_common.c:293
> warning: Source file is more recent than executable.
> 293	get_dlopen_handle(void **handle, const char *lib_name, bool exit_on_f=
ail, bool load)
> (gdb) l
> 288	{
> 289	    library_initialized =3D true;
> 290	}
> 291=09
> 292	static bool
> 293	get_dlopen_handle(void **handle, const char *lib_name, bool exit_on_f=
ail, bool load)
> 294	{
> 295	    if (*handle)
> 296	        return true;
> 297=09
> (gdb)=20
> 298	    if (!library_initialized) {
> 299	        fputs("Attempting to dlopen() while in the dynamic linker.\n"=
, stderr);
> 300	        abort();
> 301	    }
> 302=09
> 303	#ifdef _WIN32
> 304	    *handle =3D LoadLibraryA(lib_name);
> 305	#else
> 306	    pthread_mutex_lock(&api.mutex);
> 307	    if (!*handle) {
> (gdb)=20
> 308	        int flags =3D RTLD_LAZY | RTLD_LOCAL;
> 309	        if (!load)
> 310	            flags |=3D RTLD_NOLOAD;
> 311=09
> 312	        *handle =3D dlopen(lib_name, flags);
> 313	        if (!*handle) {
> 314	            if (exit_on_fail) {
> 315	                fprintf(stderr, "Couldn't open %s: %s\n", lib_name, d=
lerror());
> 316	                abort();
> 317	            } else {
> (gdb)=20
> 318	                (void)dlerror();
> 319	            }
> 320	        }
> 321	    }
> 322	    pthread_mutex_unlock(&api.mutex);
> 323	#endif
> 324=09
> 325	    return *handle !=3D NULL;
> 326	}
> 327=09
> (gdb) p *handle
> $1 =3D (void *) 0x0

All the above is in Guix system.

The libGLESv2.so.2 comes from libglvnd, but libglvnd is not a
dependency of dino, and I only installed libglvnd with 'guix
package -i libglvnd' and dino is wrapped, so maybe for some reason
it doesn't find libglvnd.

I've tried to add libglvnd in dino inputs, but I got the same error
message (I didn't look at it with gdb though).

But if I install dino with Guix on top of parabola (a host
distribution) then it works fine.

I've also found out that gnome-weather was also complaining about a
missing libGLESv2:
> $ gnome-weather=20
> Couldn't open libGLESv2.so.2: libGLESv2.so.2: cannot open shared object f=
ile: No such file or directory
> Aborted
but I didn't try to debug that.

Probably many more applications (than dino and gnome-weather) are
broken on Guix system.

Denis.

--Sig_/WTd18wWUBQX6TYIcNl1kCQt
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmTVTMwACgkQX138wUF3
4mNkQw//SodQhOkZt+Oa/unaU1ouNmzzc0EtcwX7Q4ZYQmTnjMvEKTTZ6S5g7Vos
hVsh3olrESDd7A4nq708qDkwbbONpsq+FwKZf8D+y8y2vICo2ebnNYhoMyaEwHOf
3vm68Fo0kndn9om8sbMFL/j+0Eiszg5+JLCRYH+aVkkZD2f1hD3IXrxmIMP3UuxT
Url1Dsu0qg1xcgd8NbQfTTOzX3P26NEmrA+Gfm0epm6nxnTotHEWuLYW4FHjTQG6
3VAnNXPrHhagx3B/jHmyUirzUE8ocsRHGwqZVGLOOoItr80lsvAtEaqxoQ+29Xq7
tB8KYp2UVy3sjSPZhXm7JF7LN8pkNCewL+wAJHQNt3BPbcaJL1viZtmoebKh9p0g
3/cMjQS1E5Mxz6AfGkiBfAYbRaQcBKZuiv73MwMnPk35HzBZxw/qQvieY7a6Cwsg
5jpYMG7jkQFpFgurLlLW11pWugz84z94IMLYjnXZEMt2QbGjWr5PfYZNmA5Y6bt6
6dolBRiKTGfYcY60LuHKs5frFPUTnw2wpu+BohK+1hFjifGkAAG07TxiFzhKP7Cj
e0XvZ7wBbXaSYw1/a+cTuNGPBhh94ljkaO0dQvjXanJGnfwHQ3ldOqZJRHfJkd23
jo5B5wyWuv//39dnL3I3tHC3ZLhPpwz5VMxuRsyD1Qfo/yXmnxY=
=vLxo
-----END PGP SIGNATURE-----

--Sig_/WTd18wWUBQX6TYIcNl1kCQt--