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: 1006291 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-97841-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Nk+pGlXG"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bu1Xntg5"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 436GYv5WNrz9s3C for ; Sat, 1 Dec 2018 14:13:55 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=pUQM4HCmlGefWVPEHbmcDU0YdUSg42R SB5btGaK/s7KT3+AEJhmQuzjw9QGDN3Zdwa2A//YOPXD+NSNvPw2hbWqY7E2qjKP EEkCEzWR8DtoJws+XIpCpsKQ/MvwUOGaBBfC1RCULnFIFLSD2rzzDkTS4BP/sFK7 HszEutktHcZ4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=/YtLzAGumR3PFrJDJvRuog2wDnk=; b=Nk+pG lXGI/hyhNOI6T18YtlZ4YPu/u8RK9MWTTxuNCBOl+8X4+/U6+1yMHOkJ8AEMfgdz G/GPAYM7IdRah4tfc1EpPMSE/vzqzP+BSONVRcQ116ePgJ/NAxKMnuEEO85m1P/Z yE2j86nVd/HwUtYQl53CqPZ03EAnlllj3bSV1Q= 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== 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); \