From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114564 invoked by alias); 18 Dec 2019 16:32:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 114555 invoked by uid 89); 18 Dec 2019 16:32:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=grammar X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Dec 2019 16:32:02 +0000 Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 9E1401E05A; Wed, 18 Dec 2019 11:32:00 -0500 (EST) Subject: Re: [PATCH] Fix build failure on macOS To: Tom Tromey , gdb-patches@sourceware.org References: <20191218150518.8540-1-tromey@adacore.com> From: Simon Marchi Message-ID: <19dacf6b-b2b4-8e60-20fc-5e0d3ba9dc35@simark.ca> Date: Wed, 18 Dec 2019 16:32:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191218150518.8540-1-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-12/txt/msg00763.txt.bz2 On 2019-12-18 10:05 a.m., Tom Tromey wrote: > PR build/25250 notes that the gdb 9 pre-release fails to build on > macOS, due to a name clash between field_kind::STRING and the STRING > token in ada-exp.y. I am not sure (I couldn't reproduce this myself), > but presumably this is due to differences caused by the version of > bison in use there. > > This patch works around the problem by renaming the field_kind > enumerator. I chose to rename this one because it is used in > relatively few places -- it's just an implementation detail of the > style code. > > Let me know what you think. I intend to check this in on the gdb 9 > branch as well. The difference between macOS's bison (2.3) and later version (I'm not sure at which release the behavior changed) is that the order of the prologue (where we #include stuff) versus the bison declarations (#define STRING xyz) changed. Bison 2.3 puts the declarations before the prologue, which can break included files as we see here. Later versions put the prologue before (actually the exact location of the code can be controlled by using %code). I don't really mind this particular fix, as it doesn't add complexity. But if in the future the macOS version gives us some more major headache, I would be comfortable just saying that we don't support it, and adding a %require statement in the grammar file. Recent bison versions are easily available through Homebrew and macports. Simon