From patchwork Tue Apr 7 13:34:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 46828 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D803F214BA for ; Tue, 7 Apr 2015 13:34:30 +0000 (UTC) Received: by wibgr10 with SMTP id gr10sf3559312wib.2 for ; Tue, 07 Apr 2015 06:34:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-subscribe:list-archive:list-post:list-help :sender:delivered-to:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding:x-original-sender :x-original-authentication-results; bh=VwZJD88Ro+OnP1HM+HaZf6ujUnkaCjkmOeH9RyZnAPs=; b=GngKjEqGwyrm5NZIe8hYaHU/fDPyNrWEO4/YjHKk9dcb9UPMnhuUEFhANUTIu+xDTq Vtq0AzQG/1TCujzfayEBHqAF9GJWu7OoT7l880Tx4zqT7+KSjMDoDPthut/qvLM+jPs2 PXU5w2ETjEiQEhoO+JBMAG0pK58fxPk7FPLTclMOTIhlRqZOfraPbIAqj6vjNbso8Kj8 sosSHTTlVUhXRfciK9Yzc8jbFUJhZ4vGKfOD4dvYff7rlQruCWq6rMTe7ICED2QD5J1p sQVDFYYTzye3tOmRvjKrOrx8ARpVziE/WWaPVI0QNnNrCynW+/Vj5H54BM8ptr1Tbq+t DhYw== X-Gm-Message-State: ALoCoQmrDizWHx90kK8JQtRWpmj+Tms1BjqQwBOm8p4TYHaQjPJgy8fXR/CdhypW7EnR46olYbLQ X-Received: by 10.112.29.39 with SMTP id g7mr4037664lbh.1.1428413670140; Tue, 07 Apr 2015 06:34:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.226 with SMTP id m2ls45007laa.71.gmail; Tue, 07 Apr 2015 06:34:29 -0700 (PDT) X-Received: by 10.152.6.34 with SMTP id x2mr17609159lax.47.1428413669934; Tue, 07 Apr 2015 06:34:29 -0700 (PDT) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com. [2a00:1450:4010:c04::22c]) by mx.google.com with ESMTPS id ka5si6050509lbc.119.2015.04.07.06.34.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 06:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22c as permitted sender) client-ip=2a00:1450:4010:c04::22c; Received: by lboc7 with SMTP id c7so42574283lbo.1 for ; Tue, 07 Apr 2015 06:34:29 -0700 (PDT) X-Received: by 10.152.26.34 with SMTP id i2mr17935848lag.117.1428413669511; Tue, 07 Apr 2015 06:34:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp428747lbt; Tue, 7 Apr 2015 06:34:28 -0700 (PDT) X-Received: by 10.66.148.165 with SMTP id tt5mr36596282pab.38.1428413667381; Tue, 07 Apr 2015 06:34:27 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id fu3si11424520pac.135.2015.04.07.06.34.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 06:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-58347-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 21331 invoked by alias); 7 Apr 2015 13:34:16 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 21321 invoked by uid 89); 7 Apr 2015 13:34:15 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f49.google.com X-Received: by 10.140.232.3 with SMTP id d3mr24187088qhc.46.1428413652394; Tue, 07 Apr 2015 06:34:12 -0700 (PDT) Message-ID: <5523DCD1.4050005@linaro.org> Date: Tue, 07 Apr 2015 10:34:09 -0300 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: libc-alpha@sourceware.org, Steven Munroe Subject: [PATCH] powerpc: Fix __wcschr static build X-Original-Sender: adhemerval.zanella@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22c as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 Hi, I am reposting this patch with my new email address. This patch fix the static build for strftime, which uses __wcschr. Current powerpc32 implementation defines the __wcschr be an alias to __wcschr_ppc32 and current implementation misses the correct alias for static build. It also changes the default wcschr.c logic so a IFUNC implementation should just define WCSCHR and undefine the required alias/internal definitions. Tested on i386 and on cross powerpc32 build. Ok to apply? --- 2015-04-07 Adhemerval Zanella * wcsmbs/wcschr.c [WCSCHR] (wcschr): Define as __wcschr. Remove conditionals for weak_alias and libc_hidden_weak. * sysdeps/i386/i686/multiarch/wcschr-c.c [libc]: Undefine libc_hidden_weak and weak_alias. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c [libc]: Undefine libc_hidden_weak. Define libc_hidden_def for SHARED builds and weak_alias for static one. --- diff --git a/sysdeps/i386/i686/multiarch/wcschr-c.c b/sysdeps/i386/i686/multiarch/wcschr-c.c index 786c132..38d41d0 100644 --- a/sysdeps/i386/i686/multiarch/wcschr-c.c +++ b/sysdeps/i386/i686/multiarch/wcschr-c.c @@ -1,6 +1,12 @@ #include #if IS_IN (libc) +# undef libc_hidden_weak +# define libc_hidden_weak(name) + +# undef weak_alias +# define weak_alias(name,alias) + # ifdef SHARED # undef libc_hidden_def # define libc_hidden_def(name) \ @@ -8,9 +14,9 @@ strong_alias (__wcschr_ia32, __wcschr_ia32_1); \ __hidden_ver1 (__wcschr_ia32_1, __GI___wcschr, __wcschr_ia32_1); # endif -# define WCSCHR __wcschr_ia32 #endif extern __typeof (wcschr) __wcschr_ia32; -#include "wcsmbs/wcschr.c" +#define WCSCHR __wcschr_ia32 +#include diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c index df586a6..3b2ab3a 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c @@ -18,16 +18,26 @@ #include #if IS_IN (libc) +# undef libc_hidden_weak +# define libc_hidden_weak(name) + +# undef weak_alias +# undef libc_hidden_def + # ifdef SHARED -# undef libc_hidden_def -# define libc_hidden_def(name) \ +# define libc_hidden_def(name) \ __hidden_ver1 (__wcschr_ppc, __GI_wcschr, __wcschr_ppc); \ strong_alias (__wcschr_ppc, __wcschr_ppc_1); \ __hidden_ver1 (__wcschr_ppc_1, __GI___wcschr, __wcschr_ppc_1); -# endif -# define WCSCHR __wcschr_ppc +# define weak_alias(name,alias) +# else +# define weak_alias(name, alias) \ + _weak_alias(__wcschr_ppc, __wcschr) +# define libc_hidden_def(name) +# endif /* SHARED */ #endif extern __typeof (wcschr) __wcschr_ppc; +#define WCSCHR __wcschr_ppc #include diff --git a/wcsmbs/wcschr.c b/wcsmbs/wcschr.c index a287283..77624be 100644 --- a/wcsmbs/wcschr.c +++ b/wcsmbs/wcschr.c @@ -17,17 +17,13 @@ #include -/* Find the first occurrence of WC in WCS. */ -#ifdef WCSCHR -# define wcschr WCSCHR -#else -# define wcschr __wcschr +#ifndef WCSCHR +# define WCSCHR __wcschr #endif +/* Find the first occurrence of WC in WCS. */ wchar_t * -wcschr (wcs, wc) - const wchar_t *wcs; - const wchar_t wc; +WCSCHR (const wchar_t *wcs, const wchar_t wc) { do if (*wcs == wc) @@ -36,9 +32,6 @@ wcschr (wcs, wc) return NULL; } -libc_hidden_def (wcschr) -#ifndef WCSCHR -# undef wcschr +libc_hidden_def (__wcschr) weak_alias (__wcschr, wcschr) libc_hidden_weak (wcschr) -#endif