From nobody Sun Feb 26 14:57:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPmtn1B1jz3tgyP; Sun, 26 Feb 2023 14:57:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PPmtn0mTVz3mvc; Sun, 26 Feb 2023 14:57:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677423425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WTlN+V6GZcyR8EUjr+ur9RYxCCljWL5NR29I9VqML64=; b=Rq9uD74O/mLmrZl2zjN9wnFg7ATKg5YJFwimsAPh3lXu1RECnFETFTEbzVp/U+V47FH9Qa qpB6O1mt/HIox9yptT6lMtb/58+ugE7KTMTg1ylh3yaVWKfbsQEt16XowW+oXcVxQGLm8A N644tXxHY5Li/eG3HUlW9Ev+iNzqapJxaZRZDvZcASl7FpgTqX6tEcYzbrd49KFWpezr5r mBcX+5CejfC5odXx7VibekvkgIVzK+6oPm5jpHK0mQAhR3xV4+OCW2GzBNirkmM6b4QI23 xCXHoPE9sdlS0cgOxY+5fggazMr1i4ilDmFZERY3qeKpOOC4D47KCU2wnHw4iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677423425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WTlN+V6GZcyR8EUjr+ur9RYxCCljWL5NR29I9VqML64=; b=w3IwXW+zAqXzT+AnzOG/YlHWmS1TOHJxH6PnSwrgTmjc5tsMDq+MAV2COfrOnsl9bI76YA EmvF7K+iewANtWqNwSk0DIsOEuskTWqoROuFS84tXajg/5tKsviYlGxrHf3RJJjH9k1aTY O6GYOsb6SxDAwZyb9+LH/SNoumJXg6YHxHPfEx0GlKA4j8tgbDjthHk/wm8EGcVRWo2J8h zGbJGJiMCAYIXwXL3np21MnyKXmoF2dgOg17iyY48mmsjZ+FmnaAH/SEd2cdQS/S+j87nC wyAny30LNMDbrPmaRNho/XraFXBZCK2Y9x5s/Gf1ZH+5z5TgEmVZw5If2vnKiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677423425; a=rsa-sha256; cv=none; b=PlxBNtHju2C9zgOFAxYMe8POEuVknbJu0OvrUNEnF84tpVIzIs3Y4ZrNnUeqSF92QWYXeG WBQO0/rQruJ4NnJ4cGKk/PnWj3OTxONqmNWwm9PW9J5E5brlynZbgggjoVSItpwNj2CrLQ qQEwH0Z9qg0yunFzzMGAbPXFhzjGLKqTvXf7LB01DbVyE3zbbeRclY8WJWhT1beltqI3b1 81iXatvkRWm5WmjekZxvTWB8YqdLsZENIngEXfTp+vyPL6JjmjxclznPOJKJm/1qn9XNIb Qi72F3V3rvvdA8i9noBZjr4cnbnPWxfIFfXEqT8roi9nhuA2VCCPT+C2Ho0xig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPmtm6wQyzp6M; Sun, 26 Feb 2023 14:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31QEv4tP041537; Sun, 26 Feb 2023 14:57:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31QEv4Hd041536; Sun, 26 Feb 2023 14:57:04 GMT (envelope-from git) Date: Sun, 26 Feb 2023 14:57:04 GMT Message-Id: <202302261457.31QEv4Hd041536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: ab80f0b21fbb - main - Ensure .inc files are regenerated when llvm/clang tblgen binaries change List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71 commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71 Author: Dimitry Andric AuthorDate: 2023-02-25 15:25:57 +0000 Commit: Dimitry Andric CommitDate: 2023-02-26 14:56:07 +0000 Ensure .inc files are regenerated when llvm/clang tblgen binaries change When doing a fully incremental build (with WITHOUT_CLEAN enabled), from a commit before llvm 15 was merged (3264f6b88fce), to a commit after that, a number of .inc files were not regenerated. This could lead to unexpected compilation errors when these .inc files were included from llvm-project sources, similar to: In file included from /usr/src/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:8268: /usr/obj/usr/src/amd64.amd64/lib/clang/libclang/clang/Basic/arm_mve_builtin_cg.inc:279:18: error: no matching constructor for initialization of 'clang::CodeGen::Address' Address Val2 = Address(Val1, CharUnits::fromQuantity(2)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Work around this by making the .inc files dependent on the tblgen binary used for generating them. E.g., we can relatively safely assume that if the binary gets updated, the .inc files must also be updated. (Although this is not 100% optimal, the gain by complicating things even more is probaby not worth the effort.) MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38770 --- lib/clang/clang.pre.mk | 1 + lib/clang/headers/Makefile | 2 ++ lib/clang/libclang/Makefile | 22 +++++++++++++++------- lib/clang/liblldb/Makefile | 3 +++ lib/clang/libllvm/Makefile | 2 ++ lib/clang/llvm.pre.mk | 1 + usr.bin/clang/lld/Makefile | 2 ++ usr.bin/clang/lldb-server/Makefile | 2 ++ usr.bin/clang/lldb/Makefile | 2 ++ usr.bin/clang/llvm-cxxfilt/Makefile | 2 ++ usr.bin/clang/llvm-dwarfutil/Makefile | 2 ++ usr.bin/clang/llvm-nm/Makefile | 2 ++ usr.bin/clang/llvm-objcopy/Makefile | 2 ++ usr.bin/clang/llvm-objdump/Makefile | 2 ++ usr.bin/clang/llvm-readobj/Makefile | 2 ++ usr.bin/clang/llvm-size/Makefile | 2 ++ usr.bin/clang/llvm-strings/Makefile | 2 ++ usr.bin/clang/llvm-symbolizer/Makefile | 2 ++ 18 files changed, 48 insertions(+), 7 deletions(-) diff --git a/lib/clang/clang.pre.mk b/lib/clang/clang.pre.mk index 520a9300e6ce..9ef401645f14 100644 --- a/lib/clang/clang.pre.mk +++ b/lib/clang/clang.pre.mk @@ -5,3 +5,4 @@ CLANG_SRCS= ${LLVM_BASE}/clang CLANG_TBLGEN?= clang-tblgen +CLANG_TBLGEN_BIN!= which ${CLANG_TBLGEN} diff --git a/lib/clang/headers/Makefile b/lib/clang/headers/Makefile index 4e5a08e9fed2..df53b7dc7ea0 100644 --- a/lib/clang/headers/Makefile +++ b/lib/clang/headers/Makefile @@ -214,6 +214,8 @@ riscv_${hdr:H}.h: ${CLANG_SRCS}/include/clang/Basic/riscv_${hdr:H}.td GENINCS+= riscv_${hdr:H}.h .endfor +${GENINCS}: ${CLANG_TBLGEN_BIN} + CLEANFILES= ${GENINCS} ${GENINCS:C/$/.d/} .include diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile index 7181da12a065..ac85db06ed58 100644 --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -1037,13 +1037,6 @@ clang/Basic/riscv_vector_builtin_sema.inc: \ -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/riscv_vector.td TGHDRS+= clang/Basic/riscv_vector_builtin_sema.inc -clang/Driver/Options.inc: ${CLANG_SRCS}/include/clang/Driver/Options.td - ${LLVM_TBLGEN} -gen-opt-parser-defs \ - -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ - ${CLANG_SRCS}/include/clang/Driver/Options.td -TGHDRS+= clang/Driver/Options.inc - clang/Parse/AttrParserStringSwitches.inc: \ ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parser-string-switches \ @@ -1121,10 +1114,25 @@ OpenCLBuiltins.inc: ${CLANG_SRCS}/lib/Sema/OpenCLBuiltins.td ${CLANG_SRCS}/lib/Sema/OpenCLBuiltins.td TGHDRS+= OpenCLBuiltins.inc +${TGHDRS}: ${CLANG_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} +clang/Driver/Options.inc: ${CLANG_SRCS}/include/clang/Driver/Options.td + ${LLVM_TBLGEN} -gen-opt-parser-defs \ + -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ + -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Driver/Options.td +LTGHDRS+= clang/Driver/Options.inc + +${LTGHDRS}: ${LLVM_TBLGEN_BIN} + +DEPENDFILES+= ${LTGHDRS:C/$/.d/} +DPSRCS+= ${LTGHDRS} +CLEANFILES+= ${LTGHDRS} ${LTGHDRS:C/$/.d/} + .include "../clang.build.mk" INTERNALLIB= diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile index e5590ff1e536..1a1494fd2bfb 100644 --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -701,6 +701,7 @@ SRCS+= Utility/XcodeSDK.cpp SRCS+= Version/Version.cpp LLDB_TBLGEN?= lldb-tblgen +LLDB_TBLGEN_BIN!= which ${LLDB_TBLGEN} CommandOptions.inc: ${LLDB_SRCS}/source/Commands/Options.td ${LLDB_TBLGEN} -gen-lldb-option-defs \ @@ -728,6 +729,8 @@ ${path:T}PropertiesEnum.inc: ${LLDB_SRCS}/source/${path}Properties.td TGHDRS+= ${path:T}PropertiesEnum.inc .endfor +${TGHDRS}: ${LLDB_TBLGEN_BIN} + DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index a031f0fdd706..1cfd75f509c0 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -2128,6 +2128,8 @@ TGHDRS+= X86GenRegisterInfo.inc TGHDRS+= X86GenSubtargetInfo.inc .endif # MK_LLVM_TARGET_X86 +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/lib/clang/llvm.pre.mk b/lib/clang/llvm.pre.mk index 774d7d47ea37..92124a7bf092 100644 --- a/lib/clang/llvm.pre.mk +++ b/lib/clang/llvm.pre.mk @@ -5,3 +5,4 @@ LLVM_BASE= ${SRCTOP}/contrib/llvm-project LLVM_SRCS= ${LLVM_BASE}/llvm LLVM_TBLGEN?= llvm-tblgen +LLVM_TBLGEN_BIN!= which ${LLVM_TBLGEN} diff --git a/usr.bin/clang/lld/Makefile b/usr.bin/clang/lld/Makefile index aed22a7ae847..150f74b90984 100644 --- a/usr.bin/clang/lld/Makefile +++ b/usr.bin/clang/lld/Makefile @@ -95,6 +95,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/lldb-server/Makefile b/usr.bin/clang/lldb-server/Makefile index 532c2aa2047a..b11fbfbbef33 100644 --- a/usr.bin/clang/lldb-server/Makefile +++ b/usr.bin/clang/lldb-server/Makefile @@ -37,6 +37,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/lldb/Makefile b/usr.bin/clang/lldb/Makefile index 0637b8844cad..b6486756d882 100644 --- a/usr.bin/clang/lldb/Makefile +++ b/usr.bin/clang/lldb/Makefile @@ -30,6 +30,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-cxxfilt/Makefile b/usr.bin/clang/llvm-cxxfilt/Makefile index 0036fbe6cf8d..0ce39d66f0f5 100644 --- a/usr.bin/clang/llvm-cxxfilt/Makefile +++ b/usr.bin/clang/llvm-cxxfilt/Makefile @@ -21,6 +21,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-dwarfutil/Makefile b/usr.bin/clang/llvm-dwarfutil/Makefile index a436acf0e197..6dd9bd2d5259 100644 --- a/usr.bin/clang/llvm-dwarfutil/Makefile +++ b/usr.bin/clang/llvm-dwarfutil/Makefile @@ -18,6 +18,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-nm/Makefile b/usr.bin/clang/llvm-nm/Makefile index 0df48744632d..d3099e5a75be 100644 --- a/usr.bin/clang/llvm-nm/Makefile +++ b/usr.bin/clang/llvm-nm/Makefile @@ -19,6 +19,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-objcopy/Makefile b/usr.bin/clang/llvm-objcopy/Makefile index 20f5f191b766..5cdbf5e32d2d 100644 --- a/usr.bin/clang/llvm-objcopy/Makefile +++ b/usr.bin/clang/llvm-objcopy/Makefile @@ -23,6 +23,8 @@ ${hdr}.inc: ${LLVM_BASE}/${SRCDIR}/${hdr}.td TGHDRS+= ${hdr}.inc .endfor +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-objdump/Makefile b/usr.bin/clang/llvm-objdump/Makefile index c20bc172528f..b4286ffec623 100644 --- a/usr.bin/clang/llvm-objdump/Makefile +++ b/usr.bin/clang/llvm-objdump/Makefile @@ -26,6 +26,8 @@ ${hdr}.inc: ${LLVM_BASE}/${SRCDIR}/${hdr}.td TGHDRS+= ${hdr}.inc .endfor +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-readobj/Makefile b/usr.bin/clang/llvm-readobj/Makefile index 4b547d81c583..8926eb03bdbf 100644 --- a/usr.bin/clang/llvm-readobj/Makefile +++ b/usr.bin/clang/llvm-readobj/Makefile @@ -30,6 +30,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-size/Makefile b/usr.bin/clang/llvm-size/Makefile index 20bd5de61192..f39e5db6f872 100644 --- a/usr.bin/clang/llvm-size/Makefile +++ b/usr.bin/clang/llvm-size/Makefile @@ -19,6 +19,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-strings/Makefile b/usr.bin/clang/llvm-strings/Makefile index 1438aa847997..253766ba084d 100644 --- a/usr.bin/clang/llvm-strings/Makefile +++ b/usr.bin/clang/llvm-strings/Makefile @@ -17,6 +17,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/usr.bin/clang/llvm-symbolizer/Makefile b/usr.bin/clang/llvm-symbolizer/Makefile index c4677169f912..ae417356df6b 100644 --- a/usr.bin/clang/llvm-symbolizer/Makefile +++ b/usr.bin/clang/llvm-symbolizer/Makefile @@ -20,6 +20,8 @@ ${INCFILE}: ${TDFILE} -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} +${TGHDRS}: ${LLVM_TBLGEN_BIN} + DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/}