[PATCH 1/3] Move gdb/common/diagnostics.h to include/diagnostics.h

H.J. Lu hjl.tools@gmail.com
Mon Jun 4 13:12:00 GMT 2018


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.



More information about the Binutils mailing list