From patchwork Sat Jun 22 04:37:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 33263 Received: (qmail 89844 invoked by alias); 22 Jun 2019 04:40:07 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 89717 invoked by uid 89); 22 Jun 2019 04:40:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: esa3.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1561178405; x=1592714405; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X3Oa9sBElLgw5ePt4V3CNTRUrd/ZqNl0ae0k06M/j8M=; b=WfO9O4NbO6qD6Y3hqK1GOi3htJv3rCTLsnREpaop3Sh8AQpOj5vepDLL /c82qGEukUyaFFfCloHmPR7YYAwhP678H8kfquxNyRAn6s0pT3+3VxjiB Jw4njiWTQASDdcfJrRFKyYGZa2Y+QBIVEeh/OlpX5LZjS8IiHkIdFhspD B5vIbv77gyjy9u5GYsUtnXJtFCqgz+KhSYZ1WhWQA5fAE67yrAaw6FFa9 xeHcBmlaANYTCDm7M22K3WrSMSJo5FLV4pUxQtKg0s3k1GG/8GQoy/Leo C2yJayHjkHgXFpvHRzFOPbSN0CmeCSVQ5WDEftNpg1nu58EK7ssstd/0Z g==; IronPort-SDR: t8bNrH1Bod4DXSVmxI/EGcTEw02ZWJLmfElqSjZP1RsZXlY8ozeDmcQF6oOXtFwCG0gfo0WHGu zFzTvbhz2DUXaCmm7ZIFxllfnVf5sa68ToXsn3pVx0ugPeDLys9swVRVaEQWNOYTdFW0y82GdB BXHU6vDHqScPZcnEJa7Y8zDFq7SzksF9HoagH8bdRNH5ZT5PcWjWoaEWC2mIG4ZBw+GIej1yRB As9MXhcOVJN4EqFBVQHSoTzE7jJzSuwOYXS5nN7o2MTzCeHPkEgGoOCJg8NNeWzjGb7f+KfHlj gB51xeNMF4S0b4XhusVBpJ9C IronPort-SDR: qn+5vZsaFaMQOZxSwKhmk/Z15Cebr7O3kPeLBhFovXAQugWE93eRW+VPeivx3Z45USoozFeTOW +DzM46eOl3oAJD+ZzhmOLgSqpFBxpRNW//34j8XPgOIn+Glf8iYZL2R/2EY6dTFEMIIRVUoryR Zb5nyd4IGydlv9wa/f4y7zgXeBbc8BvReLol40cEu1IPAG4KaV0t5atFT7xS4IuKH9YtxXAVKn HHPHDtquideFnbJgPvLkZUzREAGD2HQclrioYuw6sbi/NvmCttKDrwH3CljLoCRpmBIgwrMymQ YZQ= From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair.francis@wdc.com, alistair23@gmail.com Subject: [RFC v1 09/16] RISC-V: Add path of library directories for the 32-bit Date: Fri, 21 Jun 2019 21:37:36 -0700 Message-Id: <859c14ca1a6b37fb411412ab49f0136fc98db95c.1561177967.git.alistair.francis@wdc.com> In-Reply-To: References: MIME-Version: 1.0 From: Zong Li For the recommand of 64 bit version, we add the libraries path of 32 bit in this patch. This includes a fix to avoid an out of bound array check when building with GCC 8.2. 2018-11-29 Zong Li * sysdeps/unix/sysv/linux/riscv/dl-cache.h (add_system_dir): Add libraries path for rv32. Signed-off-by: Alistair Francis --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/riscv/dl-cache.h | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a752ae444..73d07ab159 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,9 @@ 2018-06-20 Zong Li * sysdeps/unix/sysv/linux/riscv/ldconfig.h (LD_SO_ABI): Support rv32. + * sysdeps/unix/sysv/linux/riscv/ldconfig.h (LD_SO_ABI): Support rv32. + * sysdeps/unix/sysv/linux/riscv/dl-cache.h (add_system_dir): Add + libraries path for rv32. 2019-06-20 Dmitry V. Levin Florian Weimer diff --git a/sysdeps/unix/sysv/linux/riscv/dl-cache.h b/sysdeps/unix/sysv/linux/riscv/dl-cache.h index 2a15e28e3b..5943060536 100644 --- a/sysdeps/unix/sysv/linux/riscv/dl-cache.h +++ b/sysdeps/unix/sysv/linux/riscv/dl-cache.h @@ -34,6 +34,8 @@ RISC-V, libraries can be found in paths ending in: - /lib64/lp64d - /lib64/lp64 + - /lib32/ilp32d + - /lib32/ilp32 - /lib (only ld.so) so this will add all of those paths. @@ -49,9 +51,16 @@ do \ { \ size_t len = strlen (dir); \ - char path[len + 9]; \ + char path[len + 10]; \ memcpy (path, dir, len + 1); \ - if (len >= 12 && ! memcmp(path + len - 12, "/lib64/lp64d", 12)) \ + if (len >= 13 && ! memcmp(path + len - 13, "/lib32/ilp32d", 13)) \ + { \ + len -= 9; \ + path[len] = '\0'; \ + } \ + if (len >= 12 \ + && (! memcmp(path + len - 12, "/lib32/ilp32", 12) \ + || ! memcmp(path + len - 12, "/lib64/lp64d", 12))) \ { \ len -= 8; \ path[len] = '\0'; \ @@ -64,6 +73,10 @@ add_dir (path); \ if (len >= 4 && ! memcmp(path + len - 4, "/lib", 4)) \ { \ + memcpy (path + len, "32/ilp32d", 10); \ + add_dir (path); \ + memcpy (path + len, "32/ilp32", 9); \ + add_dir (path); \ memcpy (path + len, "64/lp64d", 9); \ add_dir (path); \ memcpy (path + len, "64/lp64", 8); \