From patchwork Tue Jun 12 22:19:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 928527 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-93124-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (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="y5b/l01A"; 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 4154Bv26pRz9s0W for ; Wed, 13 Jun 2018 08:22:47 +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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=oprP8zPlbLfoVaqkjJoU1KFZq2vNh91 hTIebCoIEF/H7AsVa/hKeIY3YMQ8ZKW0tKhj4emD2aLoikTekoSUWJvmHccdBSLo 9Kpyxg934bunlc0TN2af+QJKfXedXja8SewgeXGBWPwuKpRfqz7xgfAvt05OP1/w IiEqHZVbuvA8= 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:subject:date:message-id:in-reply-to :references; s=default; bh=c0hZx/RVtBakRTYmBnONjctuWHg=; b=y5b/l 01AwKzagiA3VpcvBnfP7VvRvUTzf/kUtEvIswtcu7AaMzC4X+/aXMpysfLX+1sqU NgtF+jDjxorKcMJsy1zJZOxMgf1zXEOTUJLfu4Vtd/dmdcpO34+EDY7MsG4FagLK yyltRJ5brwZBzTiAFQNakZ1feTijiWqSsPbLEk= Received: (qmail 94467 invoked by alias); 12 Jun 2018 22:20:06 -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 93302 invoked by uid 89); 12 Jun 2018 22:20:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=sk:strncpy X-HELO: mga01.intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH 19/20] libcpu-rt-c/x86-64: Add strncpy Date: Tue, 12 Jun 2018 15:19:38 -0700 Message-Id: <20180612221939.19545-20-hjl.tools@gmail.com> In-Reply-To: <20180612221939.19545-1-hjl.tools@gmail.com> References: <20180612221939.19545-1-hjl.tools@gmail.com> * sysdeps/x86_64/Makefile (cpu-rt-c-routines): Add strncpy. * sysdeps/x86_64/multiarch/Makefile (libcpu-rt-c-sysdep_routines): Add strncpy-c, strncpy-sse2-unaligned and strncpy-ssse3. * sysdeps/x86_64/multiarch/strncpy.c: Support libcpu-rt-c. --- sysdeps/x86_64/Makefile | 2 +- sysdeps/x86_64/multiarch/Makefile | 4 +++- sysdeps/x86_64/multiarch/strncpy.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile index 4e872b1220..17d3a07894 100644 --- a/sysdeps/x86_64/Makefile +++ b/sysdeps/x86_64/Makefile @@ -149,7 +149,7 @@ endif ifeq ($(subdir),cpu-rt-c) cpu-rt-c-routines += memchr memcmp memcpy memmove mempcpy memrchr \ memset strcat strchr strcmp strcpy strlen strncat \ - strnlen strncmp \ + strnlen strncmp strncpy \ wmemset # For the CPU run-time tests. diff --git a/sysdeps/x86_64/multiarch/Makefile b/sysdeps/x86_64/multiarch/Makefile index e3c197ba84..de4938b3eb 100644 --- a/sysdeps/x86_64/multiarch/Makefile +++ b/sysdeps/x86_64/multiarch/Makefile @@ -91,5 +91,7 @@ libcpu-rt-c-sysdep_routines += memchr-sse2 memchr-avx2 \ strlen-sse2 strlen-avx2 strncat-c \ strncat-sse2-unaligned strncat-ssse3 \ strnlen-sse2 strnlen-avx2 strncmp-sse2 \ - strncmp-ssse3 strncmp-sse4_2 strncmp-avx2 + strncmp-ssse3 strncmp-sse4_2 strncmp-avx2 \ + strncpy-c strncpy-sse2-unaligned \ + strncpy-ssse3 endif diff --git a/sysdeps/x86_64/multiarch/strncpy.c b/sysdeps/x86_64/multiarch/strncpy.c index 3c3de8b18e..30bd615f99 100644 --- a/sysdeps/x86_64/multiarch/strncpy.c +++ b/sysdeps/x86_64/multiarch/strncpy.c @@ -18,7 +18,7 @@ . */ /* Define multiple versions only for the definition in libc. */ -#if IS_IN (libc) +#if IS_IN (libc) || IS_IN (libcpu_rt_c) # define strncpy __redirect_strncpy # include # undef strncpy @@ -28,7 +28,7 @@ libc_ifunc_redirected (__redirect_strncpy, strncpy, IFUNC_SELECTOR ()); -# ifdef SHARED +# if defined SHARED && !IS_IN (libcpu_rt_c) __hidden_ver1 (strncpy, __GI_strncpy, __redirect_strncpy) __attribute__ ((visibility ("hidden"))); # endif