From patchwork Thu Dec 1 16:20:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 28448 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp352807wrr; Thu, 1 Dec 2022 08:20:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6EPSlKIUEBZnsClfDEHgbJUnfmcz7rFdhmyUl6dURARYmCiIiA0Z1lPpV/afZs5TnhTu2s X-Received: by 2002:a05:6402:289a:b0:46a:c421:d913 with SMTP id eg26-20020a056402289a00b0046ac421d913mr27093274edb.328.1669911655782; Thu, 01 Dec 2022 08:20:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669911655; cv=none; d=google.com; s=arc-20160816; b=WS1/5SoZR2f7LQVxhfniYwk1LKmYJADBDkNwDbAwnqOQ6Zc9/+d+wSdFBgdPLFhS8v RZLWD4rBmvKLXIoBdOGRKwC0C5Ghz1Z7vd6yDKJxe9lB+PoeP3IeB6fg9koRO8/daawY YTf8utGhJs6sPQzvBJzBKF6pem5DeYKcLDVEUA39wcMSnETqdTuQ4lthmcNhjze84CHU 05XF3CV05VOv+3yJZAyzznWhhJN0rUAXUwMSYMnUNw8pTBcg2zoJhAiOSeHVgCzMXpNd erQaNOiTRVMOYjiwQOiyQyXSuX0Jm3scMivI5hCMXKKpHNHgWxTZMUXRud7jk7tE6FCv isGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=USQZOtke8CfPjU1+XM+uHkWg83GJ2XQ6i9gWrCjjHIs=; b=nVebxO4x872kz8phf7UFvmCubRsfPrJ6wxhjHaUpLSYSJMylDz8MZ5dIyDvFvUq4cn aBOu6R1p0CWkXimxc8isNVMmjry8FlL7Ruzl2fBgRbY6uJgAEfX3SgCm9nRNeluIU5SA 3jE9TyYHnNvY5NAtaoi+MiqChfeBRNbaQJe+xw0FeWI4aE0BdfuGmdThgx2AkdnLYxtg c2wuWidaWVfFwwfWP6lYTXzpzLG9BJu0Yv8GZ0pXM9jPE3M8xfu1MjbaIwYoe4XnbKsD AAVAttBeKemBpX04NYySiRk1Y9cn79sFi9iRkVPwSDHVbLq9BJcCk2muruOdnFWvQCcQ 9/Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=OpB19b6f; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id g15-20020a056402428f00b004690009024csi2079364edc.503.2022.12.01.08.20.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 08:20:55 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=OpB19b6f; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D48CA3858433 for ; Thu, 1 Dec 2022 16:20:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D48CA3858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669911654; bh=USQZOtke8CfPjU1+XM+uHkWg83GJ2XQ6i9gWrCjjHIs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=OpB19b6faHUTQiBuCYAXIg2R1KRfJHFG2eBx48EApRVzHIyOZ4pThefZwMs9tyDpM Z4QmuItPRIJqJ77H/xjBPfU9j1XwZJtPpq1QtzXSPXud7eZNHjkHEOylR9S23upifF EnQITLR4M8Qu7v39YGI7acS9egcbIrPhmLZ96gSg= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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 Received: by mail-pj1-x1031.google.com with SMTP id x13-20020a17090a46cd00b00218f611b6e9so2560026pjg.1 for ; Thu, 01 Dec 2022 08:20:42 -0800 (PST) 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-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) 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 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Binutils" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751029284486984189?= X-GMAIL-MSGID: =?utf-8?q?1751029284486984189?= 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.