From nobody Thu Nov 16 13:33:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SWLZs5y8Xz50fh5 for ; Thu, 16 Nov 2023 13:33:25 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SWLZs4JfPz4lPH for ; Thu, 16 Nov 2023 13:33:25 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40853c639abso6173515e9.0 for ; Thu, 16 Nov 2023 05:33:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700141604; x=1700746404; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lW96j/wKf8sJlnRNt3IPBAjbstp+BCI9bk2arSwTpwM=; b=B7jSUT8cVGdN0mleJ4V1BUmhmd/2AElwleVR3xU3eSrrS5aboZtiimmTNtKBijOHTu cVN3J+eN7ebVF1xa5+YGSX0oEHAY8gdnZyC+fBv3kSqk059qSVs6KmQFVmZ9pHYD1sDn b7vfOwdjO+TytGqoUubzFrYbAN60z4Npkk7M9ASDArGxOCCKoj4mpfaIDIJIlF/8Ruv/ 5cWjILm0G992akx6ps7CVn0XREvWoaSjxkVOnN/0dFWdtk0VYwafUFB5N2ALu57TBxC5 H9c3IJ/Qn/5JD5Cl+aPxzj9VxXGmihvC8GOYQLmHJ3IhVkd6WLMoOxGV02kBCi+uE47h zK/g== X-Gm-Message-State: AOJu0YyPeVj9jxPFQgYU+opHqASD06eX+OYdcCeu9oWmyXDXvWzIueFd HRXlK2b9/iP4n8y/EKlAq2Y0sw== X-Google-Smtp-Source: AGHT+IHBPM2EagtiBuijXR0ISpIWolDceSiG9NLByBjiW1j9FeDw+JRrkVu3QJUBft40JKOJfMWqXA== X-Received: by 2002:a05:600c:4f0e:b0:406:5359:769f with SMTP id l14-20020a05600c4f0e00b004065359769fmr13739294wmq.0.1700141603727; Thu, 16 Nov 2023 05:33:23 -0800 (PST) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id t14-20020a05600c450e00b003fee567235bsm3764369wmo.1.2023.11.16.05.33.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Nov 2023 05:33:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Subject: Re: git: 99132daf6f70 - main - rc.d/ldconfig: Prepend rtld stdlib paths to ldconfig(32)_paths From: Jessica Clarke In-Reply-To: Date: Thu, 16 Nov 2023 13:33:12 +0000 Cc: Konstantin Belousov , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7E6896FA-85A3-41DC-9ECA-1D12B78BDA2E@freebsd.org> References: <202311132339.3ADNdZKF081019@gitrepo.freebsd.org> To: Dima Panov X-Mailer: Apple Mail (2.3774.200.91.1.1) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4SWLZs4JfPz4lPH On 16 Nov 2023, at 12:44, Dima Panov wrote: >=20 > Moin-moin! >=20 >=20 > This cause some errors while running, at least on aarch64, host and = poudriere jail >=20 >=20 > # service ldconfig restart > ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib = /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg = /usr/local/lib/e2fsprogs /usr/local/lib/mysql = /usr/local/lib/perl5/5.38/mach/CORE /usr/local/llvm16/lib > ELF binary type "9" not known. > eval: /libexec/ld-elf32.so.1: Exec format error > 32-bit compatibility ldconfig path: /usr/lib32 Yeah this breaks if the kernel and/or hardware don=E2=80=99t support = 32-bit compat (not uncommon on modern Arm hardware). Also, parsing the human-readable output of ld-elf.so.1 -v to determine the path seems wrong and fragile. Given the above problem I think this should just be reverted, but if we instead want to press ahead with something like this (with suitable handling of this case) then we should really have ld-elf.so.1 produce machine-readable output (which could just be the space-separated string) for use the rc script, not go mangling -v=E2=80=99s output. But I really don=E2=80=99t see the issue = with putting the paths in the script... Jess > On 14.11.2023 02:39, Konstantin Belousov wrote: >> The branch main has been updated by kib: >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D99132daf6f70cb0cc969c555d3612547= fa3cf1db >> commit 99132daf6f70cb0cc969c555d3612547fa3cf1db >> Author: John W. O'Brien >> AuthorDate: 2023-11-12 22:45:27 +0000 >> Commit: Konstantin Belousov >> CommitDate: 2023-11-13 23:39:17 +0000 >> rc.d/ldconfig: Prepend rtld stdlib paths to ldconfig(32)_paths >> Ensure that ldconfig-managed elf and elf32 hints always = include >> the standard library paths that are known independently to rtld. >> PR: 275031 >> Reviewed by: kib >> MFC after: 2 weeks >> Sponsored by: Saltant Solutions LLC >> Differential Revision: https://reviews.freebsd.org/D42557 >> --- >> libexec/rc/rc.d/ldconfig | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> diff --git a/libexec/rc/rc.d/ldconfig b/libexec/rc/rc.d/ldconfig >> index 178a8a987be4..ecbbca210ea0 100755 >> --- a/libexec/rc/rc.d/ldconfig >> +++ b/libexec/rc/rc.d/ldconfig >> @@ -22,7 +22,7 @@ ldconfig_start() >> ldconfig=3D${ldconfig_command} >> checkyesno ldconfig_insecure && _ins=3D"-i" >> if [ -x "${ldconfig_command}" ]; then >> - _LDC=3D"/lib /usr/lib" >> + _LDC=3D$(/libexec/ld-elf.so.1 -v | sed -n -e '/^Default lib path = /s///p' | tr : ' ') >> for i in ${ldconfig_local_dirs}; do >> if [ -d "${i}" ]; then >> _files=3D`find ${i} -type f` >> @@ -52,6 +52,9 @@ ldconfig_start() >> fi >> done >> _LDC=3D"" >> + if [ -x /libexec/ld-elf32.so.1 ]; then >> + _LDC=3D$(/libexec/ld-elf32.so.1 -v | sed -n -e '/^Default lib path = /s///p' | tr : ' ') >> + fi >> for i in ${ldconfig32_paths}; do >> if [ -r "${i}" ]; then >> _LDC=3D"${_LDC} ${i}" >=20 > --=20 > Sincerely, > Dima (fluffy@FreeBSD.org, https://t.me/FluffyBSD) > (desktop, kde, x11, office, ports-secteam)@FreeBSD team