From patchwork Mon Feb 15 18:55:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 1440693 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" header.d=embedded.rocks header.i=@embedded.rocks header.a=rsa-sha256 header.s=default header.b=zLcksMSr; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfYGr0n90z9sBJ for ; Tue, 16 Feb 2021 05:56:16 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 594D386B1C; Mon, 15 Feb 2021 18:56:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y1rx1o-fQr4A; Mon, 15 Feb 2021 18:56:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 0743886B9C; Mon, 15 Feb 2021 18:56:06 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 4793B1BF976 for ; Mon, 15 Feb 2021 18:56:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 446E6858D3 for ; Mon, 15 Feb 2021 18:56:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xe3r07KLsrKX for ; Mon, 15 Feb 2021 18:56:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 03969858C9 for ; Mon, 15 Feb 2021 18:56:01 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 2CF362400FE for ; Mon, 15 Feb 2021 19:55:58 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DfYGG2JgMz9rxP for ; Mon, 15 Feb 2021 19:55:50 +0100 (CET) Authentication-Results: mail.embedded.rocks (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=embedded.rocks DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embedded.rocks; h=content-transfer-encoding:content-type:content-type :mime-version:x-mailer:message-id:date:date:subject:subject:from :from:received:received; s=default; t=1613415348; x=1614020149; bh=gY2DuNIc9mOay3NXNPqwcS6y+cTJiq/3i8nKTz5V0YE=; b=zLcksMSrN+IM xe+aYZiKBk54EqjlouhpUfK+500L8BokisNfBUHekIjXRDQABQDpUke4+If8GNUS IVGhNN+dIqv/L2cLZMha9ybOxTwn8dyqGfoECdSEyGD/nwbvsPPtZTqBYorg8Irx PkufouOaHbrNECioZz53KA73t6DRrDbcFKT0tiepxq8SjuUAMnqDY5hDiq0I3k2t VzHbiZ92hhAR04FAvMdheILzrZur2HZAXlvXLhWxkl+4hl6qJwhW/wkZteNqAlz6 wyNav7c1I9LqFxcJ1HCK0HG0RUeY7+tHlK5uSqRpuawEEDAVgAa4KEHsGgSP1kPY Nl4O1qpTmQ== Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id Eu7YDJqFX0YZ; Mon, 15 Feb 2021 19:55:48 +0100 (CET) Received: from nzxt.localdomain (business-176-095-158-210.static.arcor-ip.net [176.95.158.210]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Mon, 15 Feb 2021 19:55:47 +0100 (CET) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Mon, 15 Feb 2021 19:55:41 +0100 Message-Id: <20210215185541.111347-1-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2020.02.x] package/fakeroot: add upstream patches to fix glibc 2.33 compatibility X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Glibc 2.33 removed `_STAT_VER`. On host systems, which updated to glibc 2.33, building host-fakeroot breaks: ``` In file included from communicate.h:20, from libfakeroot.c:60: libfakeroot.c: In function ‘chown’: libfakeroot.c:99:40: error: ‘_STAT_VER’ undeclared (first use in this function) 99 | #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b) ``` The issue has been discussed on some system package threads, e.g.: https://bugs.archlinux.org/task/69572 https://bugzilla.redhat.com/show_bug.cgi?id=1889862#c13 A patch set was prepared by Ilya Lipnitskiy which included two other patches not related to the glibc 2.33 compatibility and prepared as merge request for upstream: https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg57280.html Upstream accepted the merge request: https://salsa.debian.org/clint/fakeroot/-/merge_requests/10 Note, that this patch series only contains the necessay patches for glibc 2.33 compatibility. Signed-off-by: Jörg Krause --- ...fine-_STAT_VER-if-not-already-define.patch | 45 +++++++++++ ...d-wrappers-for-new-glibc-2.33-symbol.patch | 80 +++++++++++++++++++ ....ac-fix-__xmknod-at-pointer-argument.patch | 66 +++++++++++++++ package/fakeroot/fakeroot.mk | 1 + 4 files changed, 192 insertions(+) create mode 100644 package/fakeroot/0005-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch create mode 100644 package/fakeroot/0006-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch create mode 100644 package/fakeroot/0007-configure.ac-fix-__xmknod-at-pointer-argument.patch diff --git a/package/fakeroot/0005-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch b/package/fakeroot/0005-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch new file mode 100644 index 0000000000..5acdd4e8dc --- /dev/null +++ b/package/fakeroot/0005-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch @@ -0,0 +1,45 @@ +From 03bc0ee07fb6e293d081ffd8af1654788b434f6a Mon Sep 17 00:00:00 2001 +From: Ilya Lipnitskiy +Date: Thu, 11 Feb 2021 20:59:25 -0800 +Subject: [PATCH 1/3] libfakeroot.c: define _STAT_VER if not already defined +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +glibc 2.33 does does declare `_STAT_VER` anymore. + +Based on patch from Jan Pazdziora: +https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/SMQ3RYXEYTVZH6PLQMKNB3NM4XLPMNZO/ + +Backported from: feda578ca3608b7fc9a28a3a91293611c0ef47b7 + +Signed-off-by: Ilya Lipnitskiy +Signed-off-by: Jörg Krause +--- + libfakeroot.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/libfakeroot.c b/libfakeroot.c +index 3e80e38..14cdbc4 100644 +--- a/libfakeroot.c ++++ b/libfakeroot.c +@@ -90,6 +90,16 @@ + #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) + #endif + ++#ifndef _STAT_VER ++ #if defined (__aarch64__) ++ #define _STAT_VER 0 ++ #elif defined (__x86_64__) ++ #define _STAT_VER 1 ++ #else ++ #define _STAT_VER 3 ++ #endif ++#endif ++ + /* + These INT_* (which stands for internal) macros should always be used when + the fakeroot library owns the storage of the stat variable. +-- +2.30.1 + diff --git a/package/fakeroot/0006-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch b/package/fakeroot/0006-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch new file mode 100644 index 0000000000..a77041bb75 --- /dev/null +++ b/package/fakeroot/0006-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch @@ -0,0 +1,80 @@ +From feda578ca3608b7fc9a28a3a91293611c0ef47b7 Mon Sep 17 00:00:00 2001 +From: Ilya Lipnitskiy +Date: Thu, 11 Feb 2021 21:00:04 -0800 +Subject: [PATCH 2/3] libfakeroot.c: add wrappers for new glibc 2.33+ symbols +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch add wrappers for newly exported symbols in glibc 2.33. + +Backported from: feda578ca3608b7fc9a28a3a91293611c0ef47b7 + +Signed-off-by: Ilya Lipnitskiy +Signed-off-by: Jörg Krause +--- + libfakeroot.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +diff --git a/libfakeroot.c b/libfakeroot.c +index 14cdbc4..d75c51f 100644 +--- a/libfakeroot.c ++++ b/libfakeroot.c +@@ -1352,6 +1352,54 @@ int renameat(int olddir_fd, const char *oldpath, + #endif /* HAVE_FSTATAT */ + + ++#if defined(__GLIBC__) && __GLIBC_PREREQ(2,33) ++/* Glibc 2.33 exports symbols for these functions in the shared lib */ ++ int lstat(const char *file_name, struct stat *statbuf) { ++ return WRAP_LSTAT LSTAT_ARG(_STAT_VER, file_name, statbuf); ++ } ++ int stat(const char *file_name, struct stat *st) { ++ return WRAP_STAT STAT_ARG(_STAT_VER, file_name, st); ++ } ++ int fstat(int fd, struct stat *st) { ++ return WRAP_FSTAT FSTAT_ARG(_STAT_VER, fd, st); ++ } ++ ++ #ifdef HAVE_FSTATAT ++ int fstatat(int dir_fd, const char *path, struct stat *st, int flags) { ++ return WRAP_FSTATAT FSTATAT_ARG(_STAT_VER, dir_fd, path, st, flags); ++ } ++ #endif ++ ++ #ifdef STAT64_SUPPORT ++ int lstat64(const char *file_name, struct stat64 *st) { ++ return WRAP_LSTAT64 LSTAT64_ARG(_STAT_VER, file_name, st); ++ } ++ int stat64(const char *file_name, struct stat64 *st) { ++ return WRAP_STAT64 STAT64_ARG(_STAT_VER, file_name, st); ++ } ++ int fstat64(int fd, struct stat64 *st) { ++ return WRAP_FSTAT64 FSTAT64_ARG(_STAT_VER, fd, st); ++ } ++ ++ #ifdef HAVE_FSTATAT ++ int fstatat64(int dir_fd, const char *path, struct stat64 *st, int flags) { ++ return WRAP_FSTATAT64 FSTATAT64_ARG(_STAT_VER, dir_fd, path, st, flags); ++ } ++ #endif ++ #endif ++ ++ int mknod(const char *pathname, mode_t mode, dev_t dev) { ++ return WRAP_MKNOD MKNOD_ARG(_STAT_VER, pathname, mode, &dev); ++ } ++ ++ #if defined(HAVE_FSTATAT) && defined(HAVE_MKNODAT) ++ int mknodat(int dir_fd, const char *pathname, mode_t mode, dev_t dev) { ++ return WRAP_MKNODAT MKNODAT_ARG(_STAT_VER, dir_fd, pathname, mode, &dev); ++ } ++ #endif ++#endif /* GLIBC_PREREQ */ ++ ++ + #ifdef FAKEROOT_FAKENET + pid_t fork(void) + { +-- +2.30.1 + diff --git a/package/fakeroot/0007-configure.ac-fix-__xmknod-at-pointer-argument.patch b/package/fakeroot/0007-configure.ac-fix-__xmknod-at-pointer-argument.patch new file mode 100644 index 0000000000..186991bb5a --- /dev/null +++ b/package/fakeroot/0007-configure.ac-fix-__xmknod-at-pointer-argument.patch @@ -0,0 +1,66 @@ +From 432dd46e662772020306a2ce8b1be38321697e69 Mon Sep 17 00:00:00 2001 +From: Ilya Lipnitskiy +Date: Sat, 13 Feb 2021 19:32:08 -0800 +Subject: [PATCH 3/3] configure.ac: fix __xmknod{,at} pointer argument +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Switch default to assume * and not the absence of *. + +On glibc 2.33+, there is no definition for these functions in header +files, so the compile test doesn't work. But, we can default to using +the pointer (as is the case with newer glibc), and use the header file +on older platforms to fail the test and use no pointer. + +Backported from: c3eebec293e35b997bb46c22fb5a4e114afb5e7f + +Signed-off-by: Ilya Lipnitskiy +Signed-off-by: Jörg Krause +--- + configure.ac | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 73415d2..d85566f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -183,13 +183,13 @@ AC_MSG_CHECKING([for type of arg of __xmknod]) + ]], [[ + int __xmknod ( int ver, + const char *pathname , +- mode_t mode , dev_t dev); ++ mode_t mode , dev_t *dev); + ]])],[ +- AC_DEFINE(XMKNOD_FRTH_ARG,) +- AC_MSG_RESULT([no extra *]) +- ],[ + AC_DEFINE(XMKNOD_FRTH_ARG,[*]) + AC_MSG_RESULT([needs *]) ++ ],[ ++ AC_DEFINE(XMKNOD_FRTH_ARG,) ++ AC_MSG_RESULT([no extra *]) + + ]) + +@@ -210,13 +210,13 @@ AC_MSG_CHECKING([for type of arg of __xmknodat]) + int __xmknodat ( int ver, + int dirfd, + const char *pathname , +- mode_t mode , dev_t dev); ++ mode_t mode , dev_t *dev); + ]])],[ +- AC_DEFINE(XMKNODAT_FIFTH_ARG,) +- AC_MSG_RESULT([no extra *]) +- ],[ + AC_DEFINE(XMKNODAT_FIFTH_ARG,[*]) + AC_MSG_RESULT([needs *]) ++ ],[ ++ AC_DEFINE(XMKNODAT_FIFTH_ARG,) ++ AC_MSG_RESULT([no extra *]) + + ]) + +-- +2.30.1 + diff --git a/package/fakeroot/fakeroot.mk b/package/fakeroot/fakeroot.mk index 1be99071bf..becb719abe 100644 --- a/package/fakeroot/fakeroot.mk +++ b/package/fakeroot/fakeroot.mk @@ -16,6 +16,7 @@ HOST_FAKEROOT_CONF_ENV = \ ac_cv_header_sys_capability_h=no \ ac_cv_func_capset=no # 0003-Select-TCP-when-lack-of-SYSV-IPC.patch touches configure.ac +# 0007-configure.ac-fix-__xmknod-at-pointer-argument.patch touches configure.ac HOST_FAKEROOT_AUTORECONF = YES FAKEROOT_LICENSE = GPL-3.0+ FAKEROOT_LICENSE_FILES = COPYING