From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id dNW4AI/J+V/tUgAAWB0awg (envelope-from ) for ; Sat, 09 Jan 2021 10:19:43 -0500 Received: by simark.ca (Postfix, from userid 112) id E63AA1EE11; Sat, 9 Jan 2021 10:19:42 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 925011E940 for ; Sat, 9 Jan 2021 10:19:42 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 468FE38708C7; Sat, 9 Jan 2021 15:19:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 468FE38708C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610205582; bh=z7xJbM/SrRHwM7zHfaYWHoDBiCeEWonzTWSsV1tfqWI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Ug3gBpZXH2MpUyiZVcwfOMSkhGRmHiEBVOtSYEcLBpIHR4NYhZTutIdE2WK7uVQQ3 qNWfB3OoIQmHBzTIKbKr3rqdGLMcC6qkZhTUbTRrlZeUBNagAwlxoRckqea3kanDpu 0s3DUJ9JMamXn8odyS5ii1sd8LvCr6wqK8r1FbTM= Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 1000D38708CF for ; Sat, 9 Jan 2021 15:19:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1000D38708CF Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id F25433406F2 for ; Sat, 9 Jan 2021 15:19:38 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH] sim: rl78: move storage out of header Date: Sat, 9 Jan 2021 10:19:36 -0500 Message-Id: <20210109151936.9041-1-vapier@gentoo.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This port declares its pc variable in a header and then includes it times. This causes linker errors with newer gcc due to the change in -fno-common behavior. Move the storage to a C file so we only have one instance of it in the final program. --- sim/rl78/cpu.c | 2 ++ sim/rl78/cpu.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sim/rl78/cpu.c b/sim/rl78/cpu.c index a1b85435001e..a38d6f688aee 100644 --- a/sim/rl78/cpu.c +++ b/sim/rl78/cpu.c @@ -36,6 +36,8 @@ int rl78_g10_mode = 0; int g13_multiply = 0; int g14_multiply = 0; +SI pc; + #define REGISTER_ADDRESS 0xffee0 typedef struct { diff --git a/sim/rl78/cpu.h b/sim/rl78/cpu.h index 4629e0b69b05..a21de326731f 100644 --- a/sim/rl78/cpu.h +++ b/sim/rl78/cpu.h @@ -39,7 +39,7 @@ extern int rl78_in_gdb; SI get_reg (RL78_Register); SI set_reg (RL78_Register, SI); -SI pc; +extern SI pc; extern const char * const reg_names[]; -- 2.28.0