all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Vong <alexvong1995@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: help-guix@gnu.org
Subject: Re: (dynamic-link "libm") doesn't work on guile
Date: Sat, 09 Jan 2016 22:08:13 +0800	[thread overview]
Message-ID: <87fuy6rgky.fsf@gmail.com> (raw)
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")

ludo@gnu.org (Ludovic Courtès) writes:

> Alex Vong <alexvong1995@gmail.com> 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’s because libm.so and libc.so are linker scripts, whereas
> 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.so.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.so.6 /gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/lib/libc_nonshared.a  AS_NEEDED ( /gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/lib/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
<https://sourceware.org/ml/libc-alpha/2011-07/msg00139.html>,
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’.

  reply	other threads:[~2016-01-09 14:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 10:36 (dynamic-link "libm") doesn't work on guile Alex Vong
2016-01-08  2:30 ` Leo Famulari
2016-01-08 11:56   ` Alex Vong
2016-01-08  3:27 ` 宋文武
2016-01-08 10:07   ` Ludovic Courtès
2016-01-08 12:43   ` Alex Vong
2016-01-08 13:51     ` Ludovic Courtès
2016-01-09 14:08       ` Alex Vong [this message]
2016-01-09 17:39         ` Ludovic Courtès
2016-01-10  6:05           ` Alex Vong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fuy6rgky.fsf@gmail.com \
    --to=alexvong1995@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.