From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.devel Subject: Re: Why does guile put -lgc into the linker flags? Date: Mon, 7 Oct 2024 10:47:53 +0900 Message-ID: References: <87seta3g8o.fsf@wolfsden.cz> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002d895f0623d936a0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="874"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Oct 07 03:48:57 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sxcro-00006F-7c for guile-devel@m.gmane-mx.org; Mon, 07 Oct 2024 03:48:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxcr8-0004QF-3I; Sun, 06 Oct 2024 21:48:14 -0400 Original-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 ) id 1sxcr3-0004Q4-Np for guile-devel@gnu.org; Sun, 06 Oct 2024 21:48:09 -0400 Original-Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxcr2-00040d-0M for guile-devel@gnu.org; Sun, 06 Oct 2024 21:48:09 -0400 Original-Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-656d8b346d2so2408442a12.2 for ; Sun, 06 Oct 2024 18:48:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728265684; x=1728870484; darn=gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=GWmVJLfvj55zU0aHALI8Ubwiphc28cpx+p0OReMxgy0=; b=OUZbjRE1ss68myyX6Ut35YIjHj9kjrBdF4sIk2OKAT0/Iv4pWtfJWrXpyKKePUnStC sNjXXe5BiotTYvc8alLs3xUZc1St4gx4uyvH45SSb3rHJW0Zy8tC8i0eHHGFvwvyXdvh lQ6Kw4/3Th4nDs9pl/kxWHxhWRnkyxymY3zgY1pTDjV5UGqEcSOMvUmgaKpAMyoFl0bP YjTc+2PghuaYIUhsyUwjl/nxOoUnY5CXcV9u75K6h07EcxGJ1Bu1k6cUTqfJOwidDxAI 29LDA3NdmPHoc5Rwxo7TVvcYHJ3pyW7bxJtcZ4LPgRH73yN5X/rqtABCvWD1dnLiIGW4 Os2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728265684; x=1728870484; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GWmVJLfvj55zU0aHALI8Ubwiphc28cpx+p0OReMxgy0=; b=QaAxoLar6d4XbcwkTKafaENZor2czuQXo9cLdZGO3uCPomkmQ/OkpPgTrqLjnKbKdA 3L3Xz5kd2P3/G37GDeXTxU6C7zQ3xls4J3ru0VJcRXmwKkW3qDlxsB+eDxELjQCbB3sQ wQc0qkqe7Hd922XdypL5Fz7PhvVW/aoWUh9VKFdwKF6xwC1KsUKCF6fDuIuduNFng4G6 Jf1J5gezJYoODt+xJSskfJ6EBw5ApMeTS+eGUB/RaNqCpSmavvJGNE5mR5jWBkyUcC5y VUecyrHcOtKTzSH/3y5EctCH6ZkeAq3zOSVgYjZ95QRN7EBmv4JIxMA8DCZj73721ysm obmQ== X-Gm-Message-State: AOJu0YwEuoiJe2jiBRI9Uttos3wMY6/Qpb9/9DbIa5v1BoLBPS+DPeQE NFGCs1s0Cl1CR5F0k0YmYtzVC1zR81wR4gL90cBe0Yp/Fy/5lZyKN47enV/dCfow3LJjsQbsfnv +9NdMs4o8VwbUitk8/RIZn6BqY2k1v/uM X-Google-Smtp-Source: AGHT+IFZ4FM/wPxX/5GfRjKYQFPh+IZdC9DA+UFFqQNoR4520Tz54xy0uQGei+bgIaeVLQ4YG5MQP+cNsO+h6JQZ5ak= X-Received: by 2002:a05:6a21:9cca:b0:1cf:4326:5602 with SMTP id adf61e73a8af0-1d6dfacace2mr16291339637.36.1728265684090; Sun, 06 Oct 2024 18:48:04 -0700 (PDT) In-Reply-To: <87seta3g8o.fsf@wolfsden.cz> Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=nalaginrut@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22725 Archived-At: --0000000000002d895f0623d936a0 Content-Type: text/plain; charset="UTF-8" Hello, I think the issue is that the libguile.h file does not help downstream packages isolate themselves from libgc completely. There are many static functions related to bdwgc in gc-inline.h, which will be combined with downstream code as a whole to compile, similar to using gc directly in your code. Best regards On Sat, Oct 5, 2024, 21:08 Tomas Volf <~@wolfsden.cz> wrote: > > Hello, > > this might be obvious to some, but I am curious why guile puts -lgc to > the linker flags: > > --8<---------------cut here---------------start------------->8--- > $ guile-config link > -L/gnu/store/mfkz7fvlfpv3ppwbkv0imb19nrf95akf-guile-3.0.9/lib > -L/gnu/store/pr73chdirm3jc2j7npc6hqzmcwjs7l8m-libgc-8.2.4/lib -lguile-3.0 > -lgc -lpthread -ldl > --8<---------------cut here---------------end--------------->8--- > > Why is it necessary? My guile extension interacts only with the > libguile, no? Even the GC-related functions are called via their scm_ > interface, I am never directly interacting with the Boehm GC. I even > thought that the fact that Boehm GC is used is an implementation detail, > not an ABI thing. > > I would have thought that just libguile linking with the libgc is > enough, but I am far from expert in this area. So I would appreciate if > someone could enlighten me. > > (I am not sure about the -lpthread and -ldl neither, but the -lgc is the > one that caused me some problems, so I am asking about that one.) > > Thanks and have a nice day, > Tomas > > PS: So once we switch to whippet, all extensions will need to be rebuilt > due to linking against -lgc, which will no longer be Guile's dependency? > So I guess .so version bump will be used for that? > > -- > There are only two hard things in Computer Science: > cache invalidation, naming things and off-by-one errors. > --0000000000002d895f0623d936a0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I think the issue is that the libguile.h fi= le does not help downstream packages isolate themselves from libgc complete= ly. There are many static functions related to bdwgc in gc-inline.h, which = will be combined with downstream code as a whole to compile, similar to usi= ng gc directly in your code.

Best regards

On Sat, = Oct 5, 2024, 21:08 Tomas Volf <~@wolfsden= .cz> wrote:

Hello,

this might be obvious to some, but I am curious why guile puts -lgc to
the linker flags:

--8<---------------cut here---------------start------------->8---
$ guile-config link
-L/gnu/store/mfkz7fvlfpv3ppwbkv0imb19nrf95akf-guile-3.0.9/lib -L/gnu/store/= pr73chdirm3jc2j7npc6hqzmcwjs7l8m-libgc-8.2.4/lib -lguile-3.0 -lgc -lpthread= -ldl
--8<---------------cut here---------------end--------------->8---

Why is it necessary?=C2=A0 My guile extension interacts only with the
libguile, no?=C2=A0 Even the GC-related functions are called via their scm_=
interface, I am never directly interacting with the Boehm GC.=C2=A0 I even<= br> thought that the fact that Boehm GC is used is an implementation detail, not an ABI thing.

I would have thought that just libguile linking with the libgc is
enough, but I am far from expert in this area.=C2=A0 So I would appreciate = if
someone could enlighten me.

(I am not sure about the -lpthread and -ldl neither, but the -lgc is the one that caused me some problems, so I am asking about that one.)

Thanks and have a nice day,
Tomas

PS: So once we switch to whippet, all extensions will need to be rebuilt due to linking against -lgc, which will no longer be Guile's dependency= ?
So I guess .so version bump will be used for that?

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
--0000000000002d895f0623d936a0--