From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vong Subject: Re: (dynamic-link "libm") doesn't work on guile Date: Sat, 09 Jan 2016 22:08:13 +0800 Message-ID: <87fuy6rgky.fsf@gmail.com> References: <87bn8x65i9.fsf@gmail.com> <87a8ogbvii.fsf@member.fsf.org> <87bn8w9r89.fsf@gmail.com> <87vb74ji1y.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHuBs-0008Ge-U4 for help-guix@gnu.org; Sat, 09 Jan 2016 09:08:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHuBo-0001S5-E1 for help-guix@gnu.org; Sat, 09 Jan 2016 09:08:24 -0500 In-Reply-To: <87vb74ji1y.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 08 Jan 2016 14:51:21 +0100") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: help-guix@gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Alex Vong skribis: > >> I think it is weird. It seems only dynamic linking with "libc" or "libm" >> fails, dynamic linking with external library like "libpcre2-8" or >> anyhome-made shared library would work. And yes, "libc-2.22" and >> "libm-2.22" also works for me. > > I think that=E2=80=99s because libm.so and libc.so are linker scripts, wh= ereas > libm-2.22.so and libc-2.22.so are the actual ELF files: > > $ cat ~/.guix-profile/lib/libm.so > /* GNU ld script > */ > OUTPUT_FORMAT(elf64-x86-64) > GROUP ( /gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/lib/libm.s= o.6 AS_NEEDED ( /gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/lib= /libmvec.so.1 ) ) > $ cat ~/.guix-profile/lib/libc.so > /* GNU ld script > Use the shared library, but some functions are only in > the static library, so try that secondarily. */ > OUTPUT_FORMAT(elf64-x86-64) > GROUP ( /gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/lib/libc.s= o.6 /gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/lib/libc_nonshar= ed.a AS_NEEDED ( /gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/li= b/ld-linux-x86-64.so.2 ) ) > I think you are right, libm.so is a binary file in Debian, while it is a linker script in guix. That's why it is not working. To understand the problem, I find this thread on the glibc mailing list , where the developer said ``no one is saying that dlopening the C library is wrong, but we are saying that dlopening "libc.so" instead of "libc.so.6" is wrong.``. Is there way to specify an ABI version (I suppose 6 is the ABI version since we have libm.so.6) when dlopening a shared library to avoid this glitch? > Ludo=E2=80=99.