From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id m1SsA666smHSPgAAWB0awg (envelope-from ) for ; Thu, 09 Dec 2021 21:25:50 -0500 Received: by simark.ca (Postfix, from userid 112) id F11D61F0D0; Thu, 9 Dec 2021 21:25:49 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 790FF1ECEB for ; Thu, 9 Dec 2021 21:25:49 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CE1EC3858022 for ; Fri, 10 Dec 2021 02:25:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE1EC3858022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639103148; bh=nb9KBYR7aQ7B8G7dZnHSQ4MbCb5+IME/ZxJUil6Uc/c=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=nw5iN1jy9KiO3UdJwzcBJuVEaTyBOhbp/j4A3c1e5NBRYeWC3BriHCk2f/YziFxmj tPOgJ1tVovLvN6PHieC+vv5GfKM4J+8NmOk7e2RaqhjKgB2uUcHqKl6l+EkaXP8eHo ERO2xso1sJrWKHRkD7VoR691XXSS/ZtZZThwGios= Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 81BC13858037 for ; Fri, 10 Dec 2021 02:25:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 81BC13858037 Received: by smtp.gentoo.org (Postfix, from userid 559) id C7DF5343284; Fri, 10 Dec 2021 02:25:02 +0000 (UTC) Date: Thu, 9 Dec 2021 21:25:08 -0500 To: Tom Tromey Subject: Re: [PATCH] Fix ARM simulator build on Windows Message-ID: Mail-Followup-To: Tom Tromey , gdb-patches@sourceware.org References: <20211209140212.3980587-1-tromey@adacore.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PzDQq5HHzhHf8RgJ" Content-Disposition: inline In-Reply-To: <20211209140212.3980587-1-tromey@adacore.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" --PzDQq5HHzhHf8RgJ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 09 Dec 2021 07:02, Tom Tromey wrote: > For a Windows-hosted build with arm-elf as the target, the sim build > fails like: what is your --host ? guessing it's a mingw toolchain. > [...]sim-io.c:214:29: error: 'struct host_callback_struct' has no member = named 'open' >=20 > The recent header reorganization seems to have caused this, because > now 'open' is redefined by the gnulib fcntl.h. yeah, i think that's why it started breaking. > The fix is simple: remove the undef of 'open' from sim-io.c. mmm, not that simple. the error you're seeing is because the open macro rewrote the host_callback_struct structure. and then we tried to use it, but they no longer matched. include/sim/callback.h: struct host_callback_struct { int (*open) (host_callback *, const char*, int mode); common/sim-io.c: int sim_io_open (SIM_DESC sd, const char *name, int flags) {=20 return STATE_CALLBACK (sd)->open (STATE_CALLBACK (sd), name, flags); } i'm not keen on relying on open being defined to a simple symbol name and t= hus it will continue to compile. if it's defined to something more complicated= , i imagine it will still fail to compile. #define open(args...) _foo_open(1234, ## args) so i think it's better to move the undef between the system includes and the local sim includes so it's undone for the header & source. this file doesn= 't use actual open() call, so should be fine. -mike --- a/sim/common/sim-io.c +++ b/sim/common/sim-io.c @@ -33,12 +33,12 @@ #include #endif =20 +#undef open + #include "sim-main.h" #include "sim-io.h" #include "sim/callback.h" =20 -#undef open - /* Define the rate at which the simulator should poll the host for a quit. */ #ifndef POLL_QUIT_INTERVAL --PzDQq5HHzhHf8RgJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmGyuoQACgkQQWM7n+g3 9YF7shAArSw13Kgrk0ZjENy5wYtThyWKNmt4tAUh7faAYfZeRno47Qn5dqjoJJ0o dOGPM0F7XviqN6UMjR9gBuLHMmMTLunladRczH2zYyTK2Jf0Gv6/rhrksBjWMJ/L vBOdHK6e/z6TK/lCjUt3+rSYqQNBnbXrue9BfmUGU7flZa9Or/EbzQ/WZY9Dsd+o 8JrfRRF+K/vc1v35oX8r5wB57OH+WGuqsCxUQOOL83eIo04eVhlns2dCfVu8uJLD Q7iQ6m+38cYVwoIPHIyBHjOiIyoAYs8VXIjqc/k1FlRfE3y4QYHD3elg7LHb9Lgq Ztziw2gpSztxL7HFfrvHhr/wpt+ck223wj80opJIv476KjFtGO6UlxTnTZvM5NPI R/lq4mFc7OojJaDx2iFt2AHPDdUdONhEFeQyeelp+t5AiyrvyU11lY8myCkm0hy2 G/s/Q5GYXPvlmrdnJzxFraj3Ku1VD/gj3syhZKFqJXoOn+Xjayql6w+mODtESlB5 Gk6vFv0Q0hABYzdSayqKekxRkkFga7m05IB7J9/PsvLZV9x+wjvoVbEZ+W6NG4/q qOCbJPN8emGr3mdlJbUxDGuteQSk9nfrlabsGA2gSo+qXzXIj9fM3q+01h/rrFAZ Yo+iEeH2fpVxymym1JO/2BGu/C1XPNaSm9l30zSQK277YeKP/i8= =s5GW -----END PGP SIGNATURE----- --PzDQq5HHzhHf8RgJ--