From patchwork Thu May 14 12:54:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fischer X-Patchwork-Id: 3097 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 49NBMr3DWxz3xyt for ; Thu, 14 May 2020 12:55:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 49NBMp6pX4z4f3; Thu, 14 May 2020 12:55:02 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 49NBMp54dtz2xMq; Thu, 14 May 2020 12:55:02 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 49NBMm2zYjz2xMq for ; Thu, 14 May 2020 12:55:00 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 49NBMl6cwgz1D6 for ; Thu, 14 May 2020 12:54:59 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1589460899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=8/TQBChc90eA3rU6hdqMVAJcNb1A+A5nCFivh2buqyA=; b=sOSRuo/HODEYUF3kzbE5zjCX5JHB0Cug7UinkzdPo03HVonLhwXuiPg7i4aD0pMLpUq0rA Rl/g/IuAyw1uuEDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1589460899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=8/TQBChc90eA3rU6hdqMVAJcNb1A+A5nCFivh2buqyA=; b=svzRnuH9LuU72w+RPt6JrUhydfxdRjRyv0mHoPV+sKVp06XhxIHbfH5KVXMioDfPhLvP7M ZecdfRG9jrh5kp9JlwRtyNFsUln2yHBQD1XBWbsbXQpbv5LbOJLbq0uicBrcb064RJ1kZB c0iR8EkA6ZlB4taQK498GWTQx0zI1rRAmsW4xX9tO5TkPogxDJPxPao+67ggds6750DkWw k1+UVu8NteB8pgi5m2zgZv2sER+dsVPuH31Z/B2xQXkHrB2XmkltbuXBfAmH5/pSSf1FMP r5VfxHqZUiHiJMR91fQWC+nCrelkfPuM0szI/fhCosRT15c6p3c0yfIiXxj6og== From: Matthias Fischer To: development@lists.ipfire.org Subject: [PATCH] glibc: Fix for 'ldconfg -v' complaining about 'path given more than once' and 'No such file or directory' Date: Thu, 14 May 2020 14:54:52 +0200 Message-Id: <20200514125452.13030-1-matthias.fischer@ipfire.org> Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=matthias.fischer@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 1. After upgrading to 64bit and doing an simple update, 'ldconfig -v' told me: ... ldconfig: Path `/lib64' given more than once ldconfig: Can't stat /libx32: No such file or directory ldconfig: Path `/usr/lib64' given more than once ldconfig: Can't stat /usr/libx32: No such file or directory ... Searching for this messages led me to https://trac.clfs.org/ticket/1098 ("Remove extra /lib64, /libx32 references from ldconfig for Pure64") => I built a patch and tested. Running here. Works. 2. While checking '_build.base.log' I found that the first patch seemed to need some adjustments: ... cd /usr/src/glibc-2.31 && patch -Np1 < /usr/src/src/patches/glibc-localedef-no-archive.patch patching file localedata/Makefile Hunk #1 succeeded at 434 with fuzz 1 (offset 211 lines). ... => I moved this patch to the new 'glibc' patch directory and adjusted the line number. Signed-off-by: Matthias Fischer --- lfs/glibc | 3 ++- .../glibc-localedef-no-archive.patch | 9 ++++--- ..._references_from_ldconfig_for_pure64.patch | 27 +++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) rename src/patches/{ => glibc}/glibc-localedef-no-archive.patch (54%) create mode 100644 src/patches/glibc/remove_extra_lib64_libx32_references_from_ldconfig_for_pure64.patch diff --git a/lfs/glibc b/lfs/glibc index f9959c6e3..182b75eb5 100644 --- a/lfs/glibc +++ b/lfs/glibc @@ -125,12 +125,13 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) @mkdir $(DIR_SRC)/glibc-build - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-localedef-no-archive.patch ifneq "$(TOOLCHAIN)" "1" ifeq "$(BUILD_ARCH)" "x86_64" cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \ scripts/test-installation.pl + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/glibc/remove_extra_lib64_libx32_references_from_ldconfig_for_pure64.patch endif ifeq "$(BUILD_ARCH)" "i586" diff --git a/src/patches/glibc-localedef-no-archive.patch b/src/patches/glibc/glibc-localedef-no-archive.patch similarity index 54% rename from src/patches/glibc-localedef-no-archive.patch rename to src/patches/glibc/glibc-localedef-no-archive.patch index 40bc68dc3..f4d040ff7 100644 --- a/src/patches/glibc-localedef-no-archive.patch +++ b/src/patches/glibc/glibc-localedef-no-archive.patch @@ -1,10 +1,11 @@ ---- glibc-2.27/localedata/Makefile~ 2018-02-07 22:31:00.968944449 +0000 -+++ glibc-2.27/localedata/Makefile 2018-02-07 22:31:26.201764894 +0000 -@@ -223,6 +223,7 @@ $(INSTALL-SUPPORTED-LOCALES): install-lo +diff -U 3 a/localedata/Makefile b/localedata/Makefile +--- a/localedata/Makefile Sat Feb 1 12:52:50 2020 ++++ b/localedata/Makefile Thu May 14 10:53:33 2020 +@@ -434,6 +434,7 @@ echo -n '...'; \ input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \ $(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \ + --no-archive \ -i locales/$$input -f charmaps/$$charset \ $(addprefix --prefix=,$(install_root)) $$locale \ - && echo ' done'; \ + && echo ' done'; diff --git a/src/patches/glibc/remove_extra_lib64_libx32_references_from_ldconfig_for_pure64.patch b/src/patches/glibc/remove_extra_lib64_libx32_references_from_ldconfig_for_pure64.patch new file mode 100644 index 000000000..900e702fb --- /dev/null +++ b/src/patches/glibc/remove_extra_lib64_libx32_references_from_ldconfig_for_pure64.patch @@ -0,0 +1,27 @@ +diff -U 3 a/sysdeps/unix/sysv/linux/x86_64/dl-cache.h b/sysdeps/unix/sysv/linux/x86_64/dl-cache.h +--- a/sysdeps/unix/sysv/linux/x86_64/dl-cache.h Thu May 14 01:13:16 2020 ++++ b/sysdeps/unix/sysv/linux/x86_64/dl-cache.h Thu May 14 01:19:49 2020 +@@ -27,6 +27,9 @@ + size_t len = strlen (dir); \ + char path[len + 4]; \ + memcpy (path, dir, len + 1); \ ++add_dir (path); \ ++} while (0) ++#define unused_var \ + if (len >= 6 && ! memcmp (path + len - 6, "/lib64", 6)) \ + { \ + len -= 2; \ +diff -U 3 a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h +--- a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h Thu May 14 01:13:16 2020 ++++ b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h Thu May 14 01:20:00 2020 +@@ -18,9 +18,7 @@ + #include + + #define SYSDEP_KNOWN_INTERPRETER_NAMES \ +- { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, \ +- { "/libx32/ld-linux-x32.so.2", FLAG_ELF_LIBC6 }, \ +- { "/lib64/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 }, ++ { "/lib/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 }, + #define SYSDEP_KNOWN_LIBRARY_NAMES \ + { "libc.so.6", FLAG_ELF_LIBC6 }, \ + { "libm.so.6", FLAG_ELF_LIBC6 },