From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id j1fkGEQ5hWpABDAAWB0awg (envelope-from ) for ; Wed, 19 Aug 2026 01:04:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1787115844; bh=kwxkztQ3bledCaAKcYEuAlukSmPtwgLldgucnnkjtPg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eJkPeuic0MJQUkWT5TUuTwjE673Ngop/Vn3lvgxL8HG7zCENZ93G9FxGSQ6OPO91R ZGB5YdHSM/kTlWwzUj+KEkiCyE8DOBMQBLA5+FjJBpVjurcqzgdDyV5Hzvl/0FZzAi YObWwA5m6t9MFlbscicvMM0wQa5WaLrDyglgXtqk= Received: by simark.ca (Postfix, from userid 112) id 4F62B1E09E; Wed, 19 Aug 2026 01:04:04 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ZL4MExGx; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7AE881E09E for ; Wed, 19 Aug 2026 01:04:03 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 29F224BA23F4 for ; Wed, 19 Aug 2026 05:04:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29F224BA23F4 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ZL4MExGx Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id DB6374BA23E9; Wed, 19 Aug 2026 05:03:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DB6374BA23E9 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DB6374BA23E9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787115800; cv=none; b=ay+is5U1SEFkWCBaBHCh/4YvgwfqTifDdXdMfXLee5aoiI2jQk+mnCGIM98Di79WBDfTHKcuLxb5ZwnuL3LcKkBgLJZpqLQJQ6pIZM6X7w1hnN9HlTS7cfczFkwQUO1A+e/CK3kWxYg1x3GGa0elPzzSOzuo5xdGOmBOtm93BOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787115800; c=relaxed/simple; bh=kwxkztQ3bledCaAKcYEuAlukSmPtwgLldgucnnkjtPg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=bVnmDXPGUf1InvC2GWDSu2Gdv1MZf9ElxqlSiBMqZZZsbpUf5pcmVCD4UId8nGcyjPsmjXF7g4wQPuOC30SCyIx5XSqfW/BYca5DTG4sD+4bG/0ndrVhydhDLjjkJdERLY49zOidtyhrTzUj8M3dLj1ULitPvpELK8BCB1QWZQk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ZL4MExGx DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB6374BA23E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1787115798; bh=kwxkztQ3bledCaAKcYEuAlukSmPtwgLldgucnnkjtPg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ZL4MExGxr4AWT9uE7gwYRciW9jh5iRkM0Cuxg94swrEMcVQ6VFkXoEkN0wnpyr7p+ nAABRlXt3neC7W1M1OjOeE/dHlnYePe4cFqIK+y4YPgnftdl9eUe8SZQosnp1T/feC HOgVu0H4tdc2N/ZCBHTjNtpOUDLZRZq46i08HuRs= Received: by simark.ca (Postfix) id 88CCF1E09B; Wed, 19 Aug 2026 01:03:17 -0400 (EDT) Message-ID: <713f31a8-b405-4cb8-9ff8-a5172f2514ad@simark.ca> Date: Wed, 19 Aug 2026 01:03:17 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] include, opcodes: prefix REG_* macros in cris.h, nds32.h and microblaze-opcm.h To: Rainer Orth , Simon Marchi Cc: gdb-patches@sourceware.org, binutils@sourceware.org References: <20260818202744.171176-1-simon.marchi@efficios.com> Content-Language: en-US From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2026-08-18 16:55, Rainer Orth wrote: > Hi Simon, > >> Bug 34537 reports: >> >> When building gdb with the default configure options of gdb buildbots (which >> include --enable-targets=all), gdb fails to build: >> >> CXX microblaze-tdep.o >> In file included from ../../binutils-gdb/gdb/microblaze-tdep.c:37: >> ../../binutils-gdb/gdb/../opcodes/microblaze-opcm.h:101:9: error: ‘REG_PC’ redefined [-Werror] >> 101 | #define REG_PC 32 /* PC. */ >> | ^~~~~~ >> In file included from /usr/include/sys/ucontext.h:14, >> from /usr/include/sys/signal.h:197, >> from /usr/include/sys/procset.h:17, >> from /usr/include/sys/wait.h:22, >> from ../gnulib/import/sys/wait.h:28, >> from /usr/include/stdlib.h:16, >> from /usr/gcc/16/include/c++/16.1.0/cstdlib:83, >> from ../../binutils-gdb/gdb/../gdbsupport/common-defs.h:107, >> from ./../../binutils-gdb/gdb/defs.h:26, >> from : >> /usr/include/sys/regset.h:158:9: note: this is the location of the previous definition >> 158 | #define REG_PC REG_RIP >> | ^~~~~~ >> ../../binutils-gdb/gdb/../opcodes/microblaze-opcm.h:120:9: error: ‘REG_SP’ redefined [-Werror] >> 120 | #define REG_SP 1 /* stack pointer. */ >> | ^~~~~~ >> /usr/include/sys/regset.h:160:9: note: this is the location of the previous definition >> 160 | #define REG_SP REG_RSP >> | ^~~~~~ > [...] >> Attempt to fix it by prefixing the macros with the arch name. >> >> I only modified the macros starting with "REG_", but there are other >> macros with very generic names (e.g. "MAX_REG") that could be renamed >> too (for consistency, IMO, all the macros in those files should be >> prefixed the same way). > > Thanks for doing this: I wasn't sure how best to address this. I think it's just good practice to not use generic macro names in header files and namespace them a bit. >> I couldn't build-test this patch on Solaris, but it build with >> --enable-targets=all on Linux. > > I'll give it a whirl tomorrow. Just in case, there are Solaris 11.4 > systems in the cfarm for some time now (cfarm216 for sparc and cfarm215 > for x86). I tried building on cfarm216, just a simple $ ../configure --enable-targets=all && gmake but I hit other problems than what you reported, the first of which: CC igen/igen.o In file included from ../../binutils-gdb/sim/igen/igen.c:23: /usr/include/stdlib.h:307:12: error: conflicting types for ‘getopt’; have ‘int(int, char * const*, const char *)’ 307 | extern int getopt(int, char *const *, const char *); | ^~~~~~ In file included from ../../binutils-gdb/sim/igen/igen.c:22: ../../binutils-gdb/sim/../include/getopt.h:115:12: note: previous declaration of ‘getopt’ with type ‘int(void)’ 115 | extern int getopt (); | ^~~~~~ In file included from ../../binutils-gdb/sim/igen/misc.h:36, from ../../binutils-gdb/sim/igen/igen.c:25: /usr/gcc/15/lib/gcc/sparcv9-sun-solaris2.11/15.2.0/include-fixed/stdio.h:373:17: error: conflicting types for ‘getopt’; have ‘int(int, char * const*, const char *)’ 373 | extern int getopt(int, char *const *, const char *); | ^~~~~~ ../../binutils-gdb/sim/../include/getopt.h:115:12: note: previous declaration of ‘getopt’ with type ‘int(void)’ 115 | extern int getopt (); | ^~~~~~ Simon