From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id A3F253858C52 for ; Thu, 1 Dec 2022 16:20:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3F253858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1031.google.com with SMTP id x13-20020a17090a46cd00b00218f611b6e9so2560026pjg.1 for ; Thu, 01 Dec 2022 08:20:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=USQZOtke8CfPjU1+XM+uHkWg83GJ2XQ6i9gWrCjjHIs=; b=n0MV37TpaqnXUqdpvqVEU3XB4/2QmhoB2+9EhQmxC+oYkcbow6ik69Oqx9tGfBvsSA NXf8AKcsfnMOTaDC6/YbNBZ7Z0M+hjGBySmUfVZT331h7ekXsAD3isatw4jh9wD8HJI4 CvHg4Vlun1/IZ1uofKf9cLzPllnSkep1IIIQOvIQByzzUAsFxBqpg4Scyyu2Yjn8iFAo kgM0MLiwf8ducJNeboHyM+6cR21bc3MOZO83/bpLEcJsSMK9ei1A6jy5rL+KaSzquWad y2P4F9IxBKK2H9lMaqtrQ8Vwn4/hNCV0u7STHFwzfioxtq2g9VuQpU0q7EO9nbdtOG4F AWRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=USQZOtke8CfPjU1+XM+uHkWg83GJ2XQ6i9gWrCjjHIs=; b=77UuCIVEl/V+4v2rWNn5n3Bgfr1f1K5WkIuSF+skA2JeccY9QRmxhrs9LQ6DDlYHRT ijFwkrqRq0IsOqba0H+qCn3l3Xa//kHHNwpPnqQPs3S5VgIZHrS++wBnwF1WdAk39Rum PEb7f0k73OJklMTy86SVqn00eUcU+hQ9OMyflNTuSQ92KHJJlGgMJMe39IcPni76WsVB hTQEHJIPr7bNed/4FsV9TJ19gXxWQukkLiqOFfBs/B05LdPq3Y+Lmekgp0Vf0vmTek1k 9bQyRpR/mDiGCjk5x6PLqoANfioEIywcmQKxfcrfes3skjwiroGwX3fSy+9/zKChphiO 0fWA== X-Gm-Message-State: ANoB5pkfG+cXenzmJRjZDsVfimrk7mJRj6z/49G1BEEMynmAFOOmW1ZX Yx/bLwf2bD9lQKqkrV+CsZ09/PopZ98= X-Google-Smtp-Source: AA0mqf5qqH9C3eKHdWsFNEbF1OB9ZBoM8OxPyh35XUylI4tku+4s2trJHR7obq9Q/PBYCU+olXhd1g== X-Received: by 2002:a17:90b:3809:b0:20a:c64c:ae80 with SMTP id mq9-20020a17090b380900b0020ac64cae80mr61191032pjb.12.1669911641316; Thu, 01 Dec 2022 08:20:41 -0800 (PST) Received: from gnu-cfl-3.localdomain ([172.56.30.140]) by smtp.gmail.com with ESMTPSA id u64-20020a626043000000b005751f455e0esm3426621pfb.120.2022.12.01.08.20.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 08:20:40 -0800 (PST) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id F3C22740169 for ; Thu, 1 Dec 2022 08:20:38 -0800 (PST) From: "H.J. Lu" To: binutils@sourceware.org Subject: [PATCH] opcodes: Make i386-init.h depend on i386-tbl.h Date: Thu, 1 Dec 2022 08:20:38 -0800 Message-Id: <20221201162038.421271-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3024.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: i386-gen will generate both i386-tbl.h and i386-init.h in one go. Since both i386-tbl.h and i386-init.h depend on i386-gen, it leads to a race condition for i386-gen. Make i386-init.h depend on i386-tbl.h to avoid the race condition. * Makefile.am ($(srcdir)/i386%tbl.h $(srcdir)/i386%init.h): Removed. ($(srcdir)/i386-tbl.h): New rule. ($(srcdir)/i386-init.h): Likewise. * Makefile.in: Regenerated. --- opcodes/Makefile.am | 8 +++++--- opcodes/Makefile.in | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am index cb6ff0ebc5e..8565a73e902 100644 --- a/opcodes/Makefile.am +++ b/opcodes/Makefile.am @@ -553,13 +553,15 @@ i386-gen.o: i386-gen.c i386-opc.h $(srcdir)/../include/opcode/i386.h \ config.h sysdep.h $(COMPILE_FOR_BUILD) -c $(srcdir)/i386-gen.c -# i386-gen will generate both headers in one go. Use a pattern rule to properly -# express this, with the inner dash ('-') arbitrarily chosen to be the stem. -$(srcdir)/i386%tbl.h $(srcdir)/i386%init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h +# i386-gen will generate both i386-tbl.h and i386-init.h in one go. Make +# i386-init.h depend on i386-tbl.h to avoid the race condition. +$(srcdir)/i386-tbl.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h $(AM_V_GEN)$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \ < $(srcdir)/i386-opc.tbl \ | ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir) +$(srcdir)/i386-init.h: $(srcdir)/i386-tbl.h + i386-opc.lo: $(srcdir)/i386-tbl.h # While not really a dependency, specify i386-init.h here as well to make sure # it is generated even if i386-tbl.h is present and up-to-date. diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in index 5524af5ccd2..ea6fc772def 100644 --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -1528,13 +1528,15 @@ i386-gen.o: i386-gen.c i386-opc.h $(srcdir)/../include/opcode/i386.h \ config.h sysdep.h $(COMPILE_FOR_BUILD) -c $(srcdir)/i386-gen.c -# i386-gen will generate both headers in one go. Use a pattern rule to properly -# express this, with the inner dash ('-') arbitrarily chosen to be the stem. -$(srcdir)/i386%tbl.h $(srcdir)/i386%init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h +# i386-gen will generate both i386-tbl.h and i386-init.h in one go. Make +# i386-init.h depend on i386-tbl.h to avoid the race condition. +$(srcdir)/i386-tbl.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h $(AM_V_GEN)$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \ < $(srcdir)/i386-opc.tbl \ | ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir) +$(srcdir)/i386-init.h: $(srcdir)/i386-tbl.h + i386-opc.lo: $(srcdir)/i386-tbl.h # While not really a dependency, specify i386-init.h here as well to make sure # it is generated even if i386-tbl.h is present and up-to-date. -- 2.38.1