From patchwork Tue Apr 16 06:59:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1086091 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=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-499281-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="XQtL2aLe"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="NuxsNzqo"; 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 44jx7b17Vgz9s0W for ; Tue, 16 Apr 2019 16:59:37 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; q=dns; s=default; b=ImHvt2KKyePrUw90iJZ4 EShQkDqU4s76IjaCgF30CkmSnsVcLzR0aznio3Egn4eQpvdZwYMskY/Ebxzch8lT FRlLM2I8EtUXkSYCZEHGcp/73Mc+VIVxcx7iSEhLsJEszFOOIJdRl6XeuGaTqTDO gx6teU3MC0I13aLUXv3DnT0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; s=default; bh=EiAdT6ECvmibQn/RTsFq6MQriM U=; b=XQtL2aLe+pNjtVvJMaSYDWesYy8pbsPRB4urFUeiNcHkHJSvPsYg5ZYWbU nlNlFcKPu/AwiV7LnKOjL/ucgrXo++jMCOnlX5D+mijnXD6yaSBL20hdtoo4pHcd LBIJmluBsj2vTx+asxTOcerUaVFBDX4KCKZ2JNNfBE/8Y1Cbo= Received: (qmail 82739 invoked by alias); 16 Apr 2019 06:59:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 82707 invoked by uid 89); 16 Apr 2019 06:59:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Spam-Relays-External:sk:!192.16, H*RU:sk:!192.16, ULL, H*r:192.168.15 X-HELO: mail-pl1-f175.google.com Received: from mail-pl1-f175.google.com (HELO mail-pl1-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Apr 2019 06:59:26 +0000 Received: by mail-pl1-f175.google.com with SMTP id f36so9845955plb.5 for ; Mon, 15 Apr 2019 23:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :cc:to; bh=cF+9bhwUq20egq7gVRlDtTT/qlm86nqtSC05Z7k4vaE=; b=NuxsNzqoTGZAj8Aodxnyg2vHMUh2+llBWcfBBJm6I6tIQ5HM0kisNo7C0QHNcEKtzH cHiEy+z96B7/T6gNMOrPiisiEIsreX5vmsdvmZzSoadSIGLU1P3jgmTQd3uhP5Zr/yNh SMvHb+BFN5M3TiwAc1qrd9JNkSmO+hEpk+L/nGbVvv0R1t5dt47pExdCP45q4IjO8fUc JI2qZ+xNvT7gJYXFB7XtIiUFqWpAxPJOWvESLrr33FggB9D9cOxsmt5vGdf8h+o8SI8U FJDLR/g35gzrOZaBeU16jlFAgPWFppNUz0A8bAOMYKHBVABBbYaLnXq/IPsPMC/Ji6L3 Bkxw== Received: from [192.168.15.202] ([47.11.4.24]) by smtp.googlemail.com with ESMTPSA id v20sm75673505pfn.116.2019.04.15.23.59.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 23:59:23 -0700 (PDT) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [Patch, Darwin] Fix PR bootstrap/89864 Message-Id: <2CAB854A-7FA6-42D1-A5DA-F190B6594571@googlemail.com> Date: Tue, 16 Apr 2019 12:29:18 +0530 Cc: Mike Stump To: GCC Patches Hi, TL;DR So, it turns out that there’s an interaction between standards wording that makes an implementation conforming when it has extensions that, when used, make a program ill-formed (but with no diagnostic required) (see the PR for more detail). One might argue that using such extensions is asking for portability issues (the case here), but it’s not prohibited. The following patch applies a fixincludes to work around it for now, I’ve tested it DTRT for me and posted to the PR for other folks to confirm it works for them. OK for trunk (after wider testing)? branches? Iain fixincludes/ xxxx-xx-xx Erik Schnetter Jakub Jelinek Iain Sandoe PR bootstrap/89864 * inclhack.def (darwin_ucred__Atomic): New, work around _Atomic keyword use in headers included by C++. * fixincl.x: Regenerated. diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 8fd9f7e..d8ce89a 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1622,6 +1622,25 @@ fix = { "#define UINTMAX_C(v) (v ## ULL)"; }; +/* The SDK included with XCode 10.2 has the file that uses the + C11 _Atomic keyword (exposing it to C++ code). The work-around here follows + the header in declaring the entity volatile when _Atomic is not available. +*/ +fix = { + hackname = darwin_ucred__Atomic; + mach = "*-*-darwin*"; + files = sys/ucred.h; + select = "_Atomic"; + c_fix = wrap; + c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n" + "# define _Atomic volatile\n" + "#endif\n"; + c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n" + "# undef _Atomic\n" + "#endif\n"; + test_text = "_Atomic"; +}; + /* * Fix on Digital UNIX V4.0: * It contains a prototype for a DEC C internal asm() function,