From patchwork Wed May 22 07:02:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3123 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6B74F3F9F8 for ; Wed, 22 May 2024 09:03:11 +0200 (CEST) Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2e1d4a03597sf87004611fa.0 for ; Wed, 22 May 2024 00:03:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716361390; cv=pass; d=google.com; s=arc-20160816; b=RRgSvqp3wqkvkjS67KUu40orpSEdNuCQSixNgb1VUGVOIjU2lBerPdU0TYeR5Hk3oe Ykai1XfzkbHJy6CWWzTH0tWA8pVUDD7DlyjtPRmtvjnlKRDgMo+oan+BduYhCJIMG8Hz XONPkDMpKX4eUy01CGn48GW0DERpHGkbXxVjxNHz2/Yx76SVyShfng/DWLUiO17SyXfT TbZV003gCXJ84UmyalHdl9S3WshwkoHR4y8DUdhOq0Gxedf/O4mik1jNLHhpxlSPrz/f nIbulJNAvlHrR3acnw4MQKWerBp95AnRCaS5W2i7yA2y5U3a0ntCWaalyOcF2BCZrWTD Jidg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=4Y7mRDl5jf9+5IP2Y43KhJMQvQ62LXMN2NIXjTJs33g=; fh=U9OMW+HtP+jdA+IabPdByWw+90Lv+A+sjkMyi/dd3BQ=; b=RxHlbJ27Wwbu7CQ5SSvPIL+3sHxu+pXpsmd7Pu8SvUXGz4ywENCJ7GCgp8bDW/zVZa cs03bvXal7oG1PI67uju011qWptBqwj8ojOgkUHcI30t0UhSyesy3tpt6ms6nldXmjzS RphCg8GN6M6+d8NFXyFkN9vhT+6vCrO+fLhjXFa4Jx4slpBBXHDAqaC+ppFcyJGmvPuW DHyw8CQx9xp/IYjmiZvrNvVaHUHzivVryTyUC3SOdNDsIa6zFH6DOyZ8zbMGaZwhOFWM MkS7ub9Md+ErLMdfwoE3OBGaFEjXST1X+/M5sJedURu388IRqoPlQ0bQEOVRO5tGy0oW ffmQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d7LhdQCj; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1716361390; x=1716966190; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=4Y7mRDl5jf9+5IP2Y43KhJMQvQ62LXMN2NIXjTJs33g=; b=GIt5gz5OdMJrQBfVevrjl7Pf3nLyOcn+tLoccUsds0KmNUqzwIvn+OY1gQFMisxwQf gR7RpmqVliCs4heIoOzeZHwydL33fKG6FO7l/fKdLxkOtpiV16dYp9LV/QRQPWlPJ47Z CQ6U7KE2lO8cSPbX+Z9DLj/1KlUunHPNZLSw8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716361390; x=1716966190; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4Y7mRDl5jf9+5IP2Y43KhJMQvQ62LXMN2NIXjTJs33g=; b=wCUjrwKSGJ0rhqH9aCwDjsivcXxBat5c5Q8ZxF8BuzuASaNIbSxI7T4qn4+OwkYIrG K8cU+EuhClsRmyqiYL4+KikB8wtc2e1w/26o7fqPX+lfVU9tWv/oaQAe0Sflm0PAUg/D ekSjeNRUSwmuYxxODmR4G6t1fFOr4SxnZ81wm5lnUI3DVO0k0ym5fhzTK1HWRGzLRt0f TIU/NW09DBvqwFqvZjQL/A56OtQZZU/0Vd88kvBicA5YxLp6v/0hUzMtikh5AWAUQEby 5k418q2rp7nFzH7iB+XzdMdNZfJbJEYzRJJNTv10jEUm+MpRfcRCGm02fAYix4oIC5jK YBMQ== X-Forwarded-Encrypted: i=2; AJvYcCVovTkfs1FO98USniFye2oD3IB21Pu0ZQBa7b/X1r0UiKEWLRe2HVTvIpI8jVZwy8DPJF/8wnTXji9NK16BZ/LGFu2zT2VcHaApvdJ56MF/+TuJkQjkM6pVH0QUYw== X-Gm-Message-State: AOJu0Yzlpg36fHld/blthMbfklelUVDpcoLgW+Hhcuo7SL3hcobkle3z OTGpMau5HJw72Gaq7RsKijujozyENUHlXQ5kBx5bSMoguDffyMEKctPVTtu1lPg6PA== X-Google-Smtp-Source: AGHT+IFRwYiA0SJxiJ9z9BTKIgL4+Bx+g++d2lgkEKbwWV6beCzxekZn4auoRex2d9ui5sEpt83Kvw== X-Received: by 2002:a05:651c:1728:b0:2e2:be7a:e497 with SMTP id 38308e7fff4ca-2e94965289fmr5068641fa.49.1716361390726; Wed, 22 May 2024 00:03:10 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a2e:7211:0:b0:2de:4938:4f10 with SMTP id 38308e7fff4ca-2e4b5a1a3aels2596191fa.0.-pod-prod-09-eu; Wed, 22 May 2024 00:03:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVpG5lNnIGjrHHaYnOlJ08Cl6HBpK20qmEsG7RzMvKqTF+nF3+S80i7V94oMrJ+OC5rlNrhf2RWOmpWaFYafJXWNBhU0WzG3cjhqIbRaxUcW9Iz X-Received: by 2002:a19:5f0b:0:b0:51e:1bed:13a8 with SMTP id 2adb3069b0e04-526bf9222bemr475855e87.29.1716361388533; Wed, 22 May 2024 00:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716361388; cv=none; d=google.com; s=arc-20160816; b=l2FlJAy6V9vCfHC2VAjxK+/i8RhhbT1a0JApKx+THQZYMJVjWCwCofUkD26GRaSjzc i5Wcgg2rTK94dEu/fD6iuugpaiTtpZ0BwJkHp9tqyAMtetveAhzhkJYze6KCasFjUVMI EaEuhNVJQqFYWdIbRLAo4/GscA/7GHKvwseaUespS1MWC8NrClQhqK+Rlq4v548cceVt 5lG1gaG1Y4xEt0bUJd0mP2sBGvi2+2wHCvYY7Lh3YAUFlF2W2z40osAvm6ZZHUIwLUc4 L9NFOs01iA2U77tHGQ2RDDX+1gL/pcHDKEr6+okkn5/pNY0g0sDiVMF9XjneXfEbvsoB YdGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=MgfWGgiQajxxZIbFh0WrrBQ7eWIro5sUJL90CTsJ53I=; fh=8lxrQO4msa4hVxTVq+mimIRtuPpf+q43SDX0uxGZd5Q=; b=KkwWLrBVcUF0fLG7gUsROEaFkOdDdP+MmcRy/E9SOZ5/Ca6NOTNpQfxTafhTr/ohit us3R9odA0W9hRGdpHSQs11lObm+UsSKtxS4/dDGxdowAINFh2zDe4oAigNB/mppW67gq pTe7KxTNpQr5Ep3/h8pRqrA/LzEWsGbnbHyIMbKqK+xJt5/MVTfRkpU0MhtPMtZ4QPlj DZH1kcN4IPFGhcB5HBj0h0xfsXyv2H1GqKKNybIu3aw1WMDbqutTKe8Y8GNzRYqB+lyN tBx2hkWJ9QznbSpl7mkKfMdz5wccu5VJvxMyfwYi2UNGVp3/xW8GBOmPhM71F0MqCaJ/ 3+Qg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d7LhdQCj; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a5a1797bdb1sor682579766b.6.2024.05.22.00.03.08 for (Google Transport Security); Wed, 22 May 2024 00:03:08 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCWUNNeMc6Yn++JfcPhAT2l/vKdGtmSMDOV4aTm/808qupQsJdLHc+5/cQpCC1iNnwrxXTcubnNBRedW31DWWJSE4kWkhLHX0J4zwGJonehXtWkw X-Received: by 2002:a50:a40e:0:b0:572:71b3:3c4d with SMTP id 4fb4d7f45d1cf-57832c3c679mr568402a12.34.1716361387204; Wed, 22 May 2024 00:03:07 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.40.196]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-574d738c80csm12028365a12.81.2024.05.22.00.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 00:03:06 -0700 (PDT) From: Dario Binacchi To: buildroot@buildroot.org Cc: "Yann E . MORIN" , Jagan Teki , Romain Naour , Fabrice Fontaine , Mahyar Koshkouei , Giulio Benetti , Michael Nosthoff , Alex Suykov , =?utf-8?b?TWljaGHFgiDFgXlzemN6?= =?utf-8?q?ek?= , Bernd Kuhls , Peter Korsgaard , Julien Corjon , Sergey Matyukevich , linux-amarula@amarulasolutions.com, michael@amarulasolutions.com, Dario Binacchi Subject: [PATCH v2 14/18] package/patchelf: update the patch to be applied with fuzz 0 Date: Wed, 22 May 2024 09:02:33 +0200 Message-ID: <20240522070238.3282121-15-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240522070238.3282121-1-dario.binacchi@amarulasolutions.com> References: <20240522070238.3282121-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d7LhdQCj; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This commit allows the package patch to be applied with fuzz factor 0. The fuzz factor specifies how many lines of the patch can be inexactly matched, so the value 0 requires all lines to be exactly matched. Signed-off-by: Dario Binacchi --- ...ke-the-rpath-relative-under-a-specif.patch | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/package/patchelf/0001-Add-option-to-make-the-rpath-relative-under-a-specif.patch b/package/patchelf/0001-Add-option-to-make-the-rpath-relative-under-a-specif.patch index 8710bfb629af..c29fac7d9fb7 100644 --- a/package/patchelf/0001-Add-option-to-make-the-rpath-relative-under-a-specif.patch +++ b/package/patchelf/0001-Add-option-to-make-the-rpath-relative-under-a-specif.patch @@ -1,4 +1,4 @@ -From 618220bfb55c875d6a4d197cb24fe632ac93ec85 Mon Sep 17 00:00:00 2001 +From 6e8915572db65cf63b7a82f9b24af6f9cad92ba7 Mon Sep 17 00:00:00 2001 From: Wolfgang Grandegger Date: Mon, 20 Feb 2017 16:29:24 +0100 Subject: [PATCH] Add option to make the rpath relative under a specified root @@ -43,15 +43,17 @@ pending. Signed-off-by: Wolfgang Grandegger [Fabrice: update for 0.13] Signed-off-by: Fabrice Fontaine +[Dario: make the patch to be applied with fuzz factor 0] +Signed-off-by: Dario Binacchi --- - src/patchelf.cc | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 175 insertions(+), 21 deletions(-) + src/patchelf.cc | 199 +++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 171 insertions(+), 28 deletions(-) diff --git a/src/patchelf.cc b/src/patchelf.cc -index 1d9a772..35b4a33 100644 +index fd1e7b7b61c3..f3b7ba8867bf 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc -@@ -46,6 +46,10 @@ static bool debugMode = false; +@@ -45,6 +45,10 @@ static bool debugMode = false; static bool forceRPath = false; @@ -62,8 +64,8 @@ index 1d9a772..35b4a33 100644 static std::vector fileNames; static std::string outputFileName; static bool alwaysWrite = false; -@@ -77,6 +81,49 @@ static unsigned int getPageSize(){ - return pageSize; +@@ -81,6 +85,49 @@ static bool hasAllowedPrefix(const std::string & s, const std::vector class ElfFile -@@ -183,9 +230,13 @@ public: +@@ -197,9 +244,13 @@ public: - void setInterpreter(const string & newInterpreter); + void setInterpreter(const std::string & newInterpreter); - typedef enum { rpPrint, rpShrink, rpSet, rpAdd, rpRemove } RPathOp; + typedef enum { rpPrint, rpShrink, rpMakeRelative, rpSet, rpAdd, rpRemove} RPathOp; -+ + +- void modifyRPath(RPathOp op, const std::vector & allowedRpathPrefixes, std::string newRPath); + bool libFoundInRPath(const std::string & dirName, + const std::vector neededLibs, + std::vector & neededLibFound); - -- void modifyRPath(RPathOp op, const std::vector & allowedRpathPrefixes, std::string newRPath); ++ + void modifyRPath(RPathOp op, std::string rootDir, const std::vector & allowedRpathPrefixes, std::string newRPath, const std::string & fileName); - void addNeeded(set libs); + void addNeeded(const std::set & libs); -@@ -1041,8 +1092,28 @@ static void concatToRPath(string & rpath, const string & path) +@@ -1267,8 +1318,28 @@ static void concatToRPath(std::string & rpath, const std::string & path) template @@ -157,9 +159,9 @@ index 1d9a772..35b4a33 100644 +void ElfFile::modifyRPath(RPathOp op, std::string rootDir, + const std::vector & allowedRpathPrefixes, std::string newRPath, const std::string & fileName) { - Elf_Shdr & shdrDynamic = findSection(".dynamic"); + auto shdrDynamic = findSection(".dynamic"); -@@ -1096,6 +1167,11 @@ void ElfFile::modifyRPath(RPathOp op, string newRPath) +@@ -1314,6 +1385,11 @@ void ElfFile::modifyRPath(RPathOp op, return; } @@ -171,7 +173,7 @@ index 1d9a772..35b4a33 100644 if (op == rpShrink && !rpath) { debug("no RPATH to shrink\n"); return; -@@ -1120,31 +1196,80 @@ void ElfFile::modifyRPath(RPathOp op, string newRPath) +@@ -1343,31 +1419,80 @@ void ElfFile::modifyRPath(RPathOp op, continue; } @@ -271,7 +273,7 @@ index 1d9a772..35b4a33 100644 if (op == rpRemove) { if (!rpath) { debug("no RPATH to delete\n"); -@@ -1413,7 +1543,9 @@ static bool shrinkRPath = false; +@@ -1736,7 +1861,9 @@ static bool removeRPath = false; static bool setRPath = false; static bool addRPath = false; static bool printRPath = false; @@ -281,7 +283,7 @@ index 1d9a772..35b4a33 100644 static std::set neededLibsToRemove; static std::map neededLibsToReplace; static std::set neededLibsToAdd; -@@ -1438,16 +1570,18 @@ static void patchElf2(ElfFile & elfFile) +@@ -1760,16 +1887,18 @@ static void patchElf2(ElfFile && elfFile, const FileContents & fileContents, con elfFile.setInterpreter(newInterpreter); if (printRPath) @@ -305,7 +307,7 @@ index 1d9a772..35b4a33 100644 if (printNeeded) elfFile.printNeededLibs(); -@@ -1508,6 +1642,9 @@ void showHelp(const string & progName) +@@ -1821,6 +1950,9 @@ void showHelp(const std::string & progName) [--remove-rpath]\n\ [--shrink-rpath]\n\ [--allowed-rpath-prefixes PREFIXES]\t\tWith '--shrink-rpath', reject rpath entries not starting with the allowed prefix\n\ @@ -315,8 +317,8 @@ index 1d9a772..35b4a33 100644 [--print-rpath]\n\ [--force-rpath]\n\ [--add-needed LIBRARY]\n\ -@@ -1564,6 +1701,17 @@ int main(int argc, char * * argv) - setRPath = true; +@@ -1889,6 +2021,17 @@ int mainWrapped(int argc, char * * argv) + addRPath = true; newRPath = argv[i]; } + else if (arg == "--make-rpath-relative") { @@ -334,5 +336,5 @@ index 1d9a772..35b4a33 100644 printRPath = true; } -- -1.9.1 +2.43.0