From patchwork Sat May 2 19:31:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Pettersson X-Patchwork-Id: 1281745 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (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=Qr8vZQ/I; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 49DzlB2nqmz9sRf for ; Sun, 3 May 2020 05:31:47 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E0D5C384B0C0; Sat, 2 May 2020 19:31:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0D5C384B0C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588447904; bh=xdUv622Mbr7q41ID73ImE0CkTTnVnglJWcS/KXh5CMs=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Qr8vZQ/IBnZidvD6Urs7Qh+almX6Ls5gcv40FCK9EyjopJDtlxF3WXjE4pINBjgSX 6C2HObaVuPu6Jrc/PZH91Xh1w0e7+yx2YtmJA3ro1XWHUoD4xrCAovQQa0euSAbG0w +QKlmaQt4SgKNH8dj6tmM5O/dD4DvwhOalHKHlsE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by sourceware.org (Postfix) with ESMTPS id E3E03385DC35 for ; Sat, 2 May 2020 19:31:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E3E03385DC35 Received: by mail-oo1-xc35.google.com with SMTP id x16so1457115oop.13 for ; Sat, 02 May 2020 12:31:41 -0700 (PDT) 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=xdUv622Mbr7q41ID73ImE0CkTTnVnglJWcS/KXh5CMs=; b=pBPDKD0RylP+0RRmFpQ4+ROhQrbKCZAmtS3LLo4Oxy64Qpvv3NjK1ghLM2F3AcizgZ W486uOs/YNOoahy3MUN2t7RBaC7/aR97S/e0ozPrf0wI86HyRKvg3AnFifZ84SeHUHrs N34EydKrAAVQS3ucR4XTxF02BFxlhV47eqog87Z/CMs0T1qcgYv5UNIirrSPV9L8eyFF 4VGqmciQA8IoVIW2GPhwvrAAfCKx4lqeBZMRYqNAWWgQZUdULvLkcol8wnMdDzSXxQT4 nOJ+7sPUnNBY3BnoA6miWSOwNrEQG87vHxXd5HV0H2t1f7esaQHa8FzeqQYqCbRL8Cj1 eZ4w== X-Gm-Message-State: AGi0PuZ7dEDrfTSFSG47P1KiZewscUcUVw/k5zMV/7yvYZ9HyTgK1eta K8kFgV8BblTMqQaYXhsUld78fZnGq5BozkBEwrxxP1sEIXo= X-Google-Smtp-Source: APiQypLNLPoxqfbP8ply+3DAZigq6ue2EHv57V7aFvL61a3Thk0BWbxaKoTDSYNbazvXP53sDbDHmxofSgg3YnJW4J0= X-Received: by 2002:a4a:9285:: with SMTP id i5mr8785078ooh.50.1588447900335; Sat, 02 May 2020 12:31:40 -0700 (PDT) MIME-Version: 1.0 Date: Sat, 2 May 2020 21:31:28 +0200 Message-ID: Subject: [PATCH] fix Ada bootstrap on Cygwin64 (PR bootstrap/94918) To: GCC Patches X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, 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 three compilation errors preventing bootstrap of gcc-10/11 with Ada on x86_64-pc-cygwin. See PR bootstrap/94918 for details. Tested by bootstrapping on x86_64-pc-cygwin, and since it touches code shared with mingw, also by building a cross to x86_64-w64-mingw32. Ok for master and gcc-10 branch? (I don't have commit rights, so I will need assistance with that.) (The patch is also attached, since gmail _will_ corrupt this text.) gcc/ada/ 2020-05-02 Mikael Pettersson PR bootstrap/94918 * mingw32.h: Prevent windows.h from including emmintrin.h on Cygwin64. * libgnat/g-sercom__mingw.adb (Open): Insert missing type conversion. libgcc/ 2020-05-02 Mikael Pettersson PR bootstrap/94918 * unwind-generic.h (__SEH__): Prevent windows.h from including x86intrin.h and emmintrin.h. --- gcc-10.1.0-RC-20200430/gcc/ada/libgnat/g-sercom__mingw.adb.~1~ 2020-04-30 22:51:33.000000000 +0200 +++ gcc-10.1.0-RC-20200430/gcc/ada/libgnat/g-sercom__mingw.adb 2020-05-02 16:36:49.565719571 +0200 @@ -103,6 +103,7 @@ package body GNAT.Serial_Communications is C_Name : constant String := String (Name) & ASCII.NUL; Success : BOOL; + HFile : HANDLE; pragma Unreferenced (Success); begin @@ -110,7 +111,7 @@ package body GNAT.Serial_Communications Success := CloseHandle (HANDLE (Port.H)); end if; - Port.H := CreateFileA + HFile := CreateFileA (lpFileName => C_Name (C_Name'First)'Address, dwDesiredAccess => GENERIC_READ or GENERIC_WRITE, dwShareMode => 0, @@ -118,6 +119,7 @@ package body GNAT.Serial_Communications dwCreationDisposition => OPEN_EXISTING, dwFlagsAndAttributes => 0, hTemplateFile => 0); + Port.H := Serial_Port_Descriptor (HFile); pragma Assert (INVALID_HANDLE_VALUE = -1); --- gcc-10.1.0-RC-20200430/gcc/ada/mingw32.h.~1~ 2020-04-30 22:51:33.000000000 +0200 +++ gcc-10.1.0-RC-20200430/gcc/ada/mingw32.h 2020-05-02 16:36:44.485724702 +0200 @@ -56,6 +56,7 @@ /* Note: windows.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 #include --- gcc-10.1.0-RC-20200430/libgcc/unwind-generic.h.~1~ 2020-04-30 22:51:36.000000000 +0200 +++ gcc-10.1.0-RC-20200430/libgcc/unwind-generic.h 2020-05-02 16:36:44.485724702 +0200 @@ -30,6 +30,8 @@ #if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__) /* Only for _GCC_specific_handler. */ +#define _X86INTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED #include #endif gcc/ada/ 2020-05-02 Mikael Pettersson PR bootstrap/94918 * mingw32.h: Prevent windows.h from including emmintrin.h on Cygwin64. * libgnat/g-sercom__mingw.adb (Open): Insert missing type conversion. libgcc/ 2020-05-02 Mikael Pettersson PR bootstrap/94918 * unwind-generic.h (__SEH__): Prevent windows.h from including x86intrin.h and emmintrin.h. --- gcc-10.1.0-RC-20200430/gcc/ada/libgnat/g-sercom__mingw.adb.~1~ 2020-04-30 22:51:33.000000000 +0200 +++ gcc-10.1.0-RC-20200430/gcc/ada/libgnat/g-sercom__mingw.adb 2020-05-02 16:36:49.565719571 +0200 @@ -103,6 +103,7 @@ package body GNAT.Serial_Communications is C_Name : constant String := String (Name) & ASCII.NUL; Success : BOOL; + HFile : HANDLE; pragma Unreferenced (Success); begin @@ -110,7 +111,7 @@ package body GNAT.Serial_Communications Success := CloseHandle (HANDLE (Port.H)); end if; - Port.H := CreateFileA + HFile := CreateFileA (lpFileName => C_Name (C_Name'First)'Address, dwDesiredAccess => GENERIC_READ or GENERIC_WRITE, dwShareMode => 0, @@ -118,6 +119,7 @@ package body GNAT.Serial_Communications dwCreationDisposition => OPEN_EXISTING, dwFlagsAndAttributes => 0, hTemplateFile => 0); + Port.H := Serial_Port_Descriptor (HFile); pragma Assert (INVALID_HANDLE_VALUE = -1); --- gcc-10.1.0-RC-20200430/gcc/ada/mingw32.h.~1~ 2020-04-30 22:51:33.000000000 +0200 +++ gcc-10.1.0-RC-20200430/gcc/ada/mingw32.h 2020-05-02 16:36:44.485724702 +0200 @@ -56,6 +56,7 @@ /* Note: windows.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 #include --- gcc-10.1.0-RC-20200430/libgcc/unwind-generic.h.~1~ 2020-04-30 22:51:36.000000000 +0200 +++ gcc-10.1.0-RC-20200430/libgcc/unwind-generic.h 2020-05-02 16:36:44.485724702 +0200 @@ -30,6 +30,8 @@ #if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__) /* Only for _GCC_specific_handler. */ +#define _X86INTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED #include #endif