This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/3] Move gdb/common/diagnostics.h to include/diagnostics.h
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: John Marshall <John dot W dot Marshall at glasgow dot ac dot uk>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 4 Jun 2018 06:12:36 -0700
- Subject: Re: [PATCH 1/3] Move gdb/common/diagnostics.h to include/diagnostics.h
- References: <20180521121557.16535-1-hjl.tools@gmail.com> <B781F464-751E-4D45-8881-36F6003759BE@glasgow.ac.uk>
On Mon, Jun 4, 2018 at 3:51 AM, John Marshall
<John.W.Marshall@glasgow.ac.uk> wrote:
> On 21 May 2018, at 13:15, H dot J dot Lu <hjl dot tools at gmail dot com> wrote:
>> Move gdb/common/diagnostics.h to include/diagnostics.h so that it can
>> be used in binutils.
>
> This patch broke building gdb on MacOS with clang (i.e., after ./configure with no options):
>
> CXX gdb.o
> In file included from ../../../binutils-gdb/gdb/gdb.c:19:
> In file included from ../../../binutils-gdb/gdb/defs.h:531:
> In file included from ../../../binutils-gdb/gdb/gdbarch.h:39:
> In file included from ../../../binutils-gdb/gdb/frame.h:72:
> In file included from ../../../binutils-gdb/gdb/language.h:26:
> ../../../binutils-gdb/gdb/symtab.h:1361:1: error: _Pragma takes a parenthesized string literal
> DEF_VEC_P (symtab_ptr);
>
>> --- a/gdb/common/diagnostics.h
>> +++ b/include/diagnostics.h
>> [snip]
>> @@ -15,10 +13,8 @@
>> You should have received a copy of the GNU General Public License
>> along with this program. If not, see <http://www.gnu.org/licenses/>. */
>>
>> -#ifndef COMMON_DIAGNOSTICS_H
>> -#define COMMON_DIAGNOSTICS_H
>> -
>> -#include "common/preprocessor.h"
>
> Putting this #include back fixes the build. Apparently in this configuration, include/diagnostics.h doesn't otherwise have a definition of STRINGIFY whereas on Linux or other platforms it does, via some coincidence of different host-related includes or something.
Please add
#include "common/preprocessor.h"
to gdb.c.
--
H.J.