From patchwork Tue Nov 12 18:31:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Emilio_Cobos_=C3=81lvarez?= X-Patchwork-Id: 1193762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106960-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=crisal.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="O9wrHA30"; 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 47CGYt2mcmz9sNx for ; Wed, 13 Nov 2019 05:32:18 +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 :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=UdapvFrQGMI4BbralvfU7CnOFu0ZwiNeNnAmHR8Nl1cbQnVDdUSVf nMCQP+9qIt7Wt2YdXRTDFx7FrN45KGsMTjrpk+DeIsFmli/r1o/E1arA4S0HoQKh w23NbtVxk7qUCaY1YTjiJg/csUT2aZURfFSYHUMd0WvzE5Xgx+Z3BA= 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=eAFqN0yVOr3GvPzxjgUX8i4t7aw=; b=O9wrHA30DBS7xdBrTBWWZ20VGmR/ ojf2i2Dz8Dp8vkzjpNR/5wzLLzN+aCGJI4AunEMvMbRmYiHV+olxdY9nBNm0wSFC VxosE8p2CaTbjogXU7cOcu3xpO6LQphaVNu9IKx6WfKfA9FY9jTcUpfQUUfl0Gb0 QG9y7N4xkX/Gz/o= Received: (qmail 119261 invoked by alias); 12 Nov 2019 18:32:12 -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 119253 invoked by uid 89); 12 Nov 2019 18:32:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=lvarez, HContent-Transfer-Encoding:8bit X-HELO: emiliocobos.net From: =?utf-8?q?Emilio_Cobos_=C3=81lvarez?= Authentication-Results: mail.emiliocobos.net; dmarc=none (p=none dis=none) header.from=crisal.io To: libc-alpha@sourceware.org Cc: =?utf-8?q?Emilio_Cobos_=C3=81lvarez?= Subject: [PATCH] libc: Don't use a custom wrapper macro around __has_include. Date: Tue, 12 Nov 2019 19:31:15 +0100 Message-Id: <20191112183115.2048865-1-emilio@crisal.io> MIME-Version: 1.0 This causes issues when using clang with -frewrite-includes to e.g., submit the translation unit to a distributed compiler. In my case, I was building Firefox using sccache. See https://bugs.llvm.org/show_bug.cgi?id=43982 for a reduced test-case since I initially thought this was a clang bug. Apparently doing this is invalid C++ per: * http://eel.is/c++draft/cpp.cond#7.sentence-2 (See https://bugs.llvm.org/show_bug.cgi?id=37990) Signed-off-by: Emilio Cobos Álvarez --- misc/sys/cdefs.h | 8 -------- sysdeps/unix/sysv/linux/bits/statx.h | 14 ++++++++------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index abcb0d5e3c..467dbd9547 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -412,14 +412,6 @@ # define __glibc_has_attribute(attr) 0 #endif -#ifdef __has_include -/* Do not use a function-like macro, so that __has_include can inhibit - macro expansion. */ -# define __glibc_has_include __has_include -#else -# define __glibc_has_include(header) 0 -#endif - #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && !__GNUC_PREREQ (4,7)) diff --git a/sysdeps/unix/sysv/linux/bits/statx.h b/sysdeps/unix/sysv/linux/bits/statx.h index ff3f2e8973..14d5992226 100644 --- a/sysdeps/unix/sysv/linux/bits/statx.h +++ b/sysdeps/unix/sysv/linux/bits/statx.h @@ -26,12 +26,14 @@ /* Use "" to work around incorrect macro expansion of the __has_include argument (GCC PR 80005). */ -#if __glibc_has_include ("linux/stat.h") -# include "linux/stat.h" -# ifdef STATX_TYPE -# define __statx_timestamp_defined 1 -# define __statx_defined 1 -# endif +#ifdef __has_include +# if __has_include("linux/stat.h") +# include "linux/stat.h" +# ifdef STATX_TYPE +# define __statx_timestamp_defined 1 +# define __statx_defined 1 +# endif +# endif #endif #include