From patchwork Sun Jan 10 10:44:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Pettersson X-Patchwork-Id: 1424237 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=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=ectCUiQz; dkim-atps=neutral Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DDD425FRrz9sWK for ; Sun, 10 Jan 2021 21:44:32 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 707AE3857C5B; Sun, 10 Jan 2021 10:44:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 707AE3857C5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1610275468; bh=VY0UueIt7KcPQtFeS4Inj69DTr6ZkY7sZMkfUg0LT1s=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ectCUiQz3z1RP3qQBZOURsUaDL/OiR4AnYhhQ/NHK8Erb/qw+urYuyfpbUvU7lOfY oFOKCjGhMv/gE+p0tBLmBOwIVJzJmL/+SjZNuxu9p79QQ8BuvbnrJPjz0cv15oIyrX i8NUV7AY7KYfk9nb3ENJAEu51qyZLTbLmhl0u1PY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 1E725385802B for ; Sun, 10 Jan 2021 10:44:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1E725385802B Received: by mail-ot1-x333.google.com with SMTP id d8so14178808otq.6 for ; Sun, 10 Jan 2021 02:44:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VY0UueIt7KcPQtFeS4Inj69DTr6ZkY7sZMkfUg0LT1s=; b=Y551MzT3YMUUQYa/f0fW10U8AdIJMv5ejnO0nasJ44lpvpsGnkoZtPn0VNxTs56NLK NAE5y6XgiS4GDy3339tLsKEpFK/yVXPuqzVYKW+3D9gOuJvVqWVH2km7C9VsfXcyGcDl zowpQNgBn9GYG/rg0uI2jwU71CsqVaGHJvfaxagyidwbpaY290SW+105Q7vvTmG/KzEG jkLjbknhv8uyYYUqh5rGmQscAoQVsMH5+G8ZAaWuiP5fMAs/3NUDXFgphAp+AOPLVzKc zIJ/1ioXjP68S/y6mtmdeBrfXx9IYD998qZkf9W9aiLfb4aJLDb3bBjju7QZI/IbuMlT W+iw== X-Gm-Message-State: AOAM533ArrCTDn2s0HgYuiwiHQc1p8HwGuLRNDlPyqUQHS7bqL5w2fy1 Fh9imypZmA2QOGRfY8TxRDNPWG25S7YieMIccN0WtVXZD5PgSw== X-Google-Smtp-Source: ABdhPJyeYwOFlSzbO7tfnLdMHyYVDBHXKfpg8FtmeMt6xTIcG8WVa4+vAWAqagXyd9H+ERtAuq+2qLnJspdLtYoeCgU= X-Received: by 2002:a9d:3b1:: with SMTP id f46mr8219047otf.370.1610275464246; Sun, 10 Jan 2021 02:44:24 -0800 (PST) MIME-Version: 1.0 Date: Sun, 10 Jan 2021 11:44:12 +0100 Message-ID: Subject: [PATCH v2] fix Ada bootstrap on Cygwin64 (PR bootstrap/94918) To: GCC Patches X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mikael Pettersson via Gcc-patches From: Mikael Pettersson Reply-To: Mikael Pettersson Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This fixes a compilation error preventing bootstrap with Ada on x86_64-pc-cygwin. See PR bootstrap/94918 for details. Compared to the initial patch sent in May 2020, this v2 patch places the fix in Ada's raise-gcc.c instead of the shared unwind-generic.h, which should hopefully simplify getting it applied. Tested by bootstrapping this and the preliminary workaround for PR98590 on x86_64-pc-cygwin. Ok for master and branches? (Patch also attached to protect it against gmail formatting.) gcc/ada/ 2021-01-10 Mikael Pettersson PR bootstrap/94918 * raise-gcc.c: (__SEH__): Prevent windows.h from including x86intrin.h or emmintrin.h on Cygwin64. --- gcc-11-20210103/gcc/ada/raise-gcc.c.~1~ 2021-01-03 23:32:14.000000000 +0100 +++ gcc-11-20210103/gcc/ada/raise-gcc.c 2021-01-10 11:13:07.878685936 +0100 @@ -79,6 +79,15 @@ typedef char bool; (SJLJ or DWARF). We need a consistently named interface to import from a-except, so wrappers are defined here. */ +#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__) && \ + defined (__CYGWIN__) && !defined (__CYGWIN32__) && !defined (IN_RTS) +/* Note: windows.h (via unwind-generic.h) on cygwin-64 includes x86intrin.h + which uses malloc. That fails to compile if malloc is poisoned, i.e. if + !IN_RTS. */ +#define _X86INTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED +#endif + #ifndef IN_RTS /* For gnat1/gnatbind compilation: cannot use unwind.h, as it is for the target. So mimic configure... gcc/ada/ 2021-01-10 Mikael Pettersson PR bootstrap/94918 * raise-gcc.c: (__SEH__): Prevent windows.h from including x86intrin.h or emmintrin.h on Cygwin64. --- gcc-11-20210103/gcc/ada/raise-gcc.c.~1~ 2021-01-03 23:32:14.000000000 +0100 +++ gcc-11-20210103/gcc/ada/raise-gcc.c 2021-01-10 11:13:07.878685936 +0100 @@ -79,6 +79,15 @@ typedef char bool; (SJLJ or DWARF). We need a consistently named interface to import from a-except, so wrappers are defined here. */ +#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__) && \ + defined (__CYGWIN__) && !defined (__CYGWIN32__) && !defined (IN_RTS) +/* Note: windows.h (via unwind-generic.h) on cygwin-64 includes x86intrin.h + which uses malloc. That fails to compile if malloc is poisoned, i.e. if + !IN_RTS. */ +#define _X86INTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED +#endif + #ifndef IN_RTS /* For gnat1/gnatbind compilation: cannot use unwind.h, as it is for the target. So mimic configure...