From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-dev+bounces-100470-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 32798158089
	for <garchives@archives.gentoo.org>; Thu, 14 Sep 2023 14:58:07 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id A1A2F2BC07C;
	Thu, 14 Sep 2023 14:58:03 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 5772F2BC031
	for <gentoo-dev@lists.gentoo.org>; Thu, 14 Sep 2023 14:58:03 +0000 (UTC)
Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-59b50b4556eso11898787b3.1
        for <gentoo-dev@lists.gentoo.org>; Thu, 14 Sep 2023 07:58:02 -0700 (PDT)
X-Gm-Message-State: AOJu0YzFkoPhwNcaLFdQfOep55hKSM4CobHPR7eVVlob+JqRN8qsFoDj
	Jleo5zK48gi1plxnIN27aZbDg3LPqCt/MEbAwoY=
X-Google-Smtp-Source: AGHT+IF0Qc9GApjZ6pSySLSJVDP3SeTI7wOECpu0Q0FtEurB8ydEJ67tmReijcq9qUqADdRXHA/T6fmBBUUW1A0BCAA=
X-Received: by 2002:a0d:ffc6:0:b0:58c:9974:b660 with SMTP id
 p189-20020a0dffc6000000b0058c9974b660mr5335266ywf.22.1694703480450; Thu, 14
 Sep 2023 07:58:00 -0700 (PDT)
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@lists.gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
MIME-Version: 1.0
References: <7802203.lOV4Wx5bFT@kona> <20230911082243.65aa85f5@Akita>
 <4128737.ElGaqSPkdT@kona> <20230911084231.73dd619f@Akita> <5848191c-8708-edfe-0c69-eeced3907b0d@gmail.com>
 <87zg1szc23.fsf@gentoo.org> <20230911141451.7c88dd7a@Akita>
 <87edj4z9q6.fsf@gentoo.org> <20230911143249.704f5d3a@Akita>
 <87sf7kxtue.fsf@gentoo.org> <20230911151008.77c829ea@Akita>
 <87edj4xsjr.fsf@gentoo.org> <20230911193424.4f6ef6ad@Akita>
 <CAGfcS_neh=gu+16mo7gLRWVtHoSs2hBirvFVR_G50yJWRckHGQ@mail.gmail.com>
 <20230914.055018.1755699845772827205.enometh@meer.net> <86led8x21v.fsf@gentoo.org>
In-Reply-To: <86led8x21v.fsf@gentoo.org>
From: Mike Gilbert <floppym@gentoo.org>
Date: Thu, 14 Sep 2023 10:57:48 -0400
X-Gmail-Original-Message-ID: <CAJ0EP42RkKUgo_hWxZpX+1T+rki_cBXtsTJFuRV2=FHL5MpzAg@mail.gmail.com>
Message-ID: <CAJ0EP42RkKUgo_hWxZpX+1T+rki_cBXtsTJFuRV2=FHL5MpzAg@mail.gmail.com>
Subject: Re: [gentoo-dev] Re: last rites: sys-fs/eudev
To: gentoo-dev@lists.gentoo.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: e2553dfe-37fe-4037-9352-5218a40e73ef
X-Archives-Hash: 192a5c404553789f3df4ffeea28490f8

On Thu, Sep 14, 2023 at 10:25=E2=80=AFAM Arsen Arsenovi=C4=87 <arsen@gentoo=
.org> wrote:
> Madhu <enometh@meer.net> writes:
> > systemd-udev cannot be built as a static binary again presumably a
> > carefully thought out design decision behind its design and
> > philosophy.
>
> Since static linking is seldom a good idea, it is more likely that
> simply nobody bothered.  I don't recall any udev components in systemd
> v249 (which is the version I attempted to rebase eudev on top of) which
> can't be static linked.

The main issue is symbol conflicts with several major projects.

systemd makes careful use of ELF symbol visibility (hidden symbols) to
prevent conflicts when libudev or libsystemd are linked with other
projects.

As I understand it, it is up to the linker to apply any visibility
rules. This doesn't work for static libs since the linker isn't
actually involved in their creation. A static library is really just
an archive with a bunch of unlinked ELF objects.

Since the symbol visibility rules are not applied, attempting to link
against libudev.a or libsystemd.a leads to symbol conflicts in
packages like LVM2 and cryptsetup. There are some Gentoo bug reports
about this, but I can't find them immediately.

The systemd project (upstream) has chosen not to work around these
conflicts by renaming symbols, and instead chooses not to support
static linking at all. They see static libs as being defective by
design. If the symbol visibility issue could be resolved at the
toolchain level, they would probably be more willing to support it.