From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 2D06D3858C74 for ; Wed, 10 Jan 2024 01:58:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D06D3858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2D06D3858C74 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704851920; cv=none; b=qQW0HciGB28zjBerffI5hhRW0q1xwUO/+ARIgUybFGd8KuY/XpxABrAkj95KTfbLa4fcSPnijNEAgzOTOGiiB1M8xPwM/SOxji0YH89Zk6xTb/e5L+otSMPre8STdFbUEFZjsKh+hk0J9x2DVh3wXFqL6okybEEdBOINm2ZzLy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704851920; c=relaxed/simple; bh=oZeXdK6MgqPGYFyMxQRlwPrEmAzBKe4brD0T0i+/FyI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=imcVWpl9ZK0awoSIoP+nLECQLTeuvxDfWeFOWQ0bs3wOpK44aXvSSGRjDMPGOf48vBy8uwTOWkPCwxWUkl9YwzdXLYsULtd3i6skA7DFabUdB7dhhRFTgFVilXNHK8ZJYkkAeYJgQQ6oE3590n98Io3XOI8QmzAGI93WsfpISSk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id A8503343350; Wed, 10 Jan 2024 01:58:36 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 3/5] sim: ppc: rework defines.h to handle HAVE symbols defined to 0 Date: Tue, 9 Jan 2024 20:58:24 -0500 Message-ID: <20240110015826.19937-3-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110015826.19937-1-vapier@gentoo.org> References: <20240110015826.19937-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_NUMSUBJECT,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The HAVE_DECL_xxx defines are always defined to 0 or 1. The current defines.h logic assumes every HAVE_xxx symbol is only defined iff it's defined to 1 which causes this to break. Tweak the sed logic to only match defines of 1. --- sim/Makefile.in | 2 +- sim/ppc/local.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/Makefile.in b/sim/Makefile.in index 1e94771577d9..b407b37803c5 100644 --- a/sim/Makefile.in +++ b/sim/Makefile.in @@ -5823,7 +5823,7 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen$(EXEEXT) testsuite/commo @SIM_ENABLE_ARCH_ppc_TRUE@ppc/defines.h: ppc/stamp-defines ; @true @SIM_ENABLE_ARCH_ppc_TRUE@ppc/stamp-defines: config.h Makefile -@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > ppc/defines.hin +@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_GEN)$(SED) -n -e '/^#define HAVE_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"HAVE_/; p }' < config.h > ppc/defines.hin @SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_at)$(SHELL) $(srcroot)/move-if-change ppc/defines.hin ppc/defines.h @SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_at)touch $@ diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk index 3f495cb44c0b..0031753b74bc 100644 --- a/sim/ppc/local.mk +++ b/sim/ppc/local.mk @@ -80,7 +80,7 @@ noinst_PROGRAMS += %D%/run %D%/defines.h: %D%/stamp-defines ; @true %D%/stamp-defines: config.h Makefile - $(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > %D%/defines.hin + $(AM_V_GEN)$(SED) -n -e '/^#define HAVE_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"HAVE_/; p }' < config.h > %D%/defines.hin $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/defines.hin %D%/defines.h $(AM_V_at)touch $@ -- 2.43.0