From patchwork Mon Jul 8 23:54:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Paul A. Clarke" X-Patchwork-Id: 1129431 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-103534-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="tm05KT3A"; 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 45jMkx0nfhz9sMQ for ; Tue, 9 Jul 2019 09:55:04 +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 :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=NkcoBREdadsVyOhdzWmCVOgS7F7FHn54HMm3I7UeE3ikw86aB0YqU SHVC5ZzD/DkPKtCSSl62VkUlcBbkw/KrH+GLLskuNN3v+mrCmLgTe3uXXzU4GZ/V U+ex9a86IioxM/ckI9N5ZjY930XvJKl3lKkm0WGabcJdii2+nMjkUo= 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 :mime-version:content-type:content-transfer-encoding; s=default; bh=fUcWGJhgdcDm5yGZYFD80MtRurI=; b=tm05KT3Aov7Gwx7qCwY564yd2PPC qz4mACCgHgfFVgHdPM5l/+LGxrFDq5tZ0437z/b4JlyX/g0Q64XUiypy5dALHygE MAolPrQ3zpKwmSGo1t7eGdLEH2c9GKjuBbwX00nN52d6Dzqi90AVQDOa/ypmJ35V Z3i0amLAOOWCVag= Received: (qmail 108544 invoked by alias); 8 Jul 2019 23:54:59 -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 108535 invoked by uid 89); 8 Jul 2019 23:54:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=H*Ad:D*br, Protect, HContent-Transfer-Encoding:8bit X-HELO: mx0a-001b2d01.pphosted.com From: "Paul A. Clarke" To: libc-alpha@sourceware.org Cc: tuliom@ascii.art.br, law@redhat.com, carlos@redhat.com Subject: [PATCH] [powerpc] fpu_control.h: protect use of __builtin_cpu_supports() Date: Mon, 8 Jul 2019 18:54:36 -0500 Message-Id: <1562630076-11320-1-git-send-email-pc@us.ibm.com> MIME-Version: 1.0 From: "Paul A. Clarke" Using __builtin_cpu_supports() requires support in GCC and Glibc. My recent patch to fpu_control.h added an unprotected use of __builtin_cpu_supports(), and this is a user-visible file. Compilation of Glibc itself will fail with a sufficiently new GCC and sufficiently old Glibc: ../sysdeps/powerpc/fpu/fegetexcept.c: In function ‘__fegetexcept’: ../sysdeps/powerpc/fpu/fenv_libc.h:52:20: error: builtin ‘__builtin_cpu_supports’ needs GLIBC (2.23 and newer) that exports hardware capability bits [-Werror] Fixes 3db85a9814784a74536a1f0e7b7ddbfef7dc84bb. 2019-07-08 Paul A. Clarke * sysdeps/powerpc/fpu/fpu_control.h (_FPU_GET_RC): Protect use of __builtin_cpu_supports with __BUILTIN_CPU_SUPPORTS__. --- sysdeps/powerpc/fpu/fenv_libc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h index 55b1697..59a8c44 100644 --- a/sysdeps/powerpc/fpu/fenv_libc.h +++ b/sysdeps/powerpc/fpu/fenv_libc.h @@ -47,12 +47,14 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden; #ifdef _ARCH_PWR9 # define fegetenv_status() fegetenv_status_ISA300() -#else +#elif defined __BUILTIN_CPU_SUPPORTS__ # define fegetenv_status() \ (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ ? fegetenv_status_ISA300() \ : fegetenv_register() \ ) +#else +# define fegetenv_status() fegetenv_register() #endif /* Equivalent to fesetenv, but takes a fenv_t instead of a pointer. */