From patchwork Sat Dec 1 03:10:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zong Li X-Patchwork-Id: 30496 Received: (qmail 123781 invoked by alias); 1 Dec 2018 03:13:27 -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 123604 invoked by uid 89); 1 Dec 2018 03:13:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:sk:c125mr8, HX-Received:4e83, H*RU:209.85.210.193, Hx-spam-relays-external:209.85.210.193 X-HELO: mail-pf1-f193.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rnYyQocC7MXKkd9sKmnOTlomdLFWV/aJg0N5DkpWmj0=; b=bu1Xntg5lHwzdLv5tCW5FmGiuWfE182RsOMp0VXhZNMyVPgKTHC7pZzQxHfG9+eLhm ssyfOo2aO6zKj2FVbkQiKAwrU3jvHo7gunHcom3W2ySHNfGgXySPk984Npb1gX3bDkfq Mm6q6UPyW0DO5UNsXmkx2vVLZ6/jR7MzFfZwtS7MpfxIjIqUfJYzRH7ESpat0X68yBq9 StFW48KFg8+jtnUYFqfRba2URnp+x9Ne9GnWBynlHHMJauLYeWxiJbNKx+6S4l6wUUxw pNuQXEUvDKcUFHHDLyBTlSIr1BoLWqwckwOSBZp1GyHMFRfKNsQloYxuUx2wnyA+4/WG DD7g== Return-Path: From: Zong Li To: joseph@codesourcery.com, palmer@dabbelt.com, darius@bluespec.com, andrew@sifive.com, dj@redhat.com, libc-alpha@sourceware.org Cc: zong@andestech.com, Zong Li Subject: [PATCH v4 03/10] RISC-V: Add path of library directories for the 32-bit Date: Sat, 1 Dec 2018 11:10:46 +0800 Message-Id: In-Reply-To: References: For the recommand of 64 bit version, we add the libraries path of 32 bit in this patch. 2018-11-29 Zong Li * sysdeps/unix/sysv/linux/riscv/dl-cache.h (add_system_dir): Add libraries path for rv32. --- ChangeLog | 2 ++ sysdeps/unix/sysv/linux/riscv/dl-cache.h | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a50a024..8986cd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2018-11-29 Zong Li * 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. 2018-11-28 Florian Weimer diff --git a/sysdeps/unix/sysv/linux/riscv/dl-cache.h b/sysdeps/unix/sysv/linux/riscv/dl-cache.h index cbd6ef5..f3a999a 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. @@ -51,7 +53,14 @@ size_t len = strlen (dir); \ char path[len + 9]; \ 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); \