From patchwork Thu Jul 12 10:26:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zong Li X-Patchwork-Id: 942890 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-94196-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="QMy1tyhG"; 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 41RBw04cjHz9ryt for ; Thu, 12 Jul 2018 20:27:44 +1000 (AEST) 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:mime-version:content-type; q=dns; s=default; b=DruFd mV9Ce9x9xKvkwQlmdWZGjtFgfd0PgIUhDe/Tn6rT2rrxzw6n7igE56EGCUOTJbo0 iyt9phX6/tuZ3WecriMS3O8WSiPRMc1WBmgTvJhAY5LI3daIWKaDgUI6SGhHzbr/ mY27FAg3Vi8+38jUpatnOppEFMkrV6D6Lq0rx0= 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:mime-version:content-type; s=default; bh=aw7vRIxYPL4 cwu142GCY2ByPHsY=; b=QMy1tyhG94nZHHqkY6aUGa5mVU2NIqg5UYUtNWWnKhr k+AR376qSvc/TnxU+0D9/Y++0wAMfmm6kbH9484sB/b9WfRGiRJF5cwBwDxr+m3X 97I+jwQvjMqu9TbwCKzLOiNFF7vb/T/AN9P1cvq8505HLqToYl/4Cep8kaqBTzVE = Received: (qmail 76859 invoked by alias); 12 Jul 2018 10:27:22 -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 76740 invoked by uid 89); 12 Jul 2018 10:27:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_MANYTO, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: ATCSQR.andestech.com From: Zong Li To: , , , , , CC: , Zong Li Subject: [PATCH 3/9] RISC-V: Add path of library directories for the 32 bit Date: Thu, 12 Jul 2018 18:26:19 +0800 Message-ID: <739a0094ac5fc88b6aa01bf1fd0f557c9d043ed5.1531384754.git.zong@andestech.com> In-Reply-To: References: MIME-Version: 1.0 X-DNSRBL: X-MAIL: ATCSQR.andestech.com w6CASJfC016663 For the recommand of 64 bit version, we add the libraries path of 32 bit in this patch. --- sysdeps/unix/sysv/linux/riscv/dl-cache.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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); \