Skip to content

[cmake] Pass LLVM_TABLEGEN_FLAGS to cross compile targets #138086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2025

Conversation

perlfu
Copy link
Contributor

@perlfu perlfu commented May 1, 2025

If ValueTypes.td contains conditional directives enabled by defs in LLVM_TABLEGEN_FLAGS then native build tblgen and min-tblgen must be built with matching flags.
This ensures the embedded types in TableGen are consistent with those used for building tables.

If ValueTypes.td contains conditional directives enabled by defs
in LLVM_TABLEGEN_FLAGS then native build tblgen and min-tblgen
must be built with matching flags.
This ensures the embedded types in TableGen are consistent with
those used for building tables.
@perlfu perlfu requested review from jayfoad, arsenm and dstutt May 1, 2025 05:58
@llvmbot llvmbot added the cmake Build system in general and CMake in particular label May 1, 2025
@perlfu perlfu added the tablegen label May 1, 2025
@llvmbot
Copy link
Member

llvmbot commented May 1, 2025

@llvm/pr-subscribers-tablegen

Author: Carl Ritson (perlfu)

Changes

If ValueTypes.td contains conditional directives enabled by defs in LLVM_TABLEGEN_FLAGS then native build tblgen and min-tblgen must be built with matching flags.
This ensures the embedded types in TableGen are consistent with those used for building tables.


Full diff: https://github.com/llvm/llvm-project/pull/138086.diff

1 Files Affected:

  • (modified) llvm/cmake/modules/CrossCompile.cmake (+1)
diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
index 3b31d3e218a37..8691e4c47e5b3 100644
--- a/llvm/cmake/modules/CrossCompile.cmake
+++ b/llvm/cmake/modules/CrossCompile.cmake
@@ -100,6 +100,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
         -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}"
         -DLLVM_INCLUDE_BENCHMARKS=OFF
         -DLLVM_INCLUDE_TESTS=OFF
+        -DLLVM_TABLEGEN_FLAGS="{LLVM_TABLEGEN_FLAGS}"
         ${build_type_flags} ${linker_flag} ${external_clang_dir} ${libc_flags}
         ${ARGN}
     WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD}

@perlfu
Copy link
Contributor Author

perlfu commented May 1, 2025

Not sure who the typical reviewers are for cmake / build? Please add more if appropriate.

Copy link
Collaborator

@dstutt dstutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this fixes the issues we were seeing.

@perlfu perlfu merged commit 3015edf into llvm:main May 1, 2025
9 of 11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented May 1, 2025

LLVM Buildbot has detected a new failure on builder lld-x86_64-win running on as-worker-93 while building llvm at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/146/builds/2825

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: Support/./SupportTests.exe/90/95' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:C:\a\lld-x86_64-win\build\unittests\Support\.\SupportTests.exe-LLVM-Unit-13436-90-95.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=95 GTEST_SHARD_INDEX=90 C:\a\lld-x86_64-win\build\unittests\Support\.\SupportTests.exe
--

Script:
--
C:\a\lld-x86_64-win\build\unittests\Support\.\SupportTests.exe --gtest_filter=ProgramEnvTest.CreateProcessLongPath
--
C:\a\lld-x86_64-win\llvm-project\llvm\unittests\Support\ProgramTest.cpp(160): error: Expected equality of these values:
  0
  RC
    Which is: -2

C:\a\lld-x86_64-win\llvm-project\llvm\unittests\Support\ProgramTest.cpp(163): error: fs::remove(Twine(LongPath)): did not return errc::success.
error number: 13
error message: permission denied



C:\a\lld-x86_64-win\llvm-project\llvm\unittests\Support\ProgramTest.cpp:160
Expected equality of these values:
  0
  RC
    Which is: -2

C:\a\lld-x86_64-win\llvm-project\llvm\unittests\Support\ProgramTest.cpp:163
fs::remove(Twine(LongPath)): did not return errc::success.
error number: 13
error message: permission denied




********************


IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
If ValueTypes.td contains conditional directives enabled by defs in
LLVM_TABLEGEN_FLAGS then native build tblgen and min-tblgen must be
built with matching flags.
This ensures the embedded types in TableGen are consistent with those
used for building tables.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
If ValueTypes.td contains conditional directives enabled by defs in
LLVM_TABLEGEN_FLAGS then native build tblgen and min-tblgen must be
built with matching flags.
This ensures the embedded types in TableGen are consistent with those
used for building tables.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
If ValueTypes.td contains conditional directives enabled by defs in
LLVM_TABLEGEN_FLAGS then native build tblgen and min-tblgen must be
built with matching flags.
This ensures the embedded types in TableGen are consistent with those
used for building tables.
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
If ValueTypes.td contains conditional directives enabled by defs in
LLVM_TABLEGEN_FLAGS then native build tblgen and min-tblgen must be
built with matching flags.
This ensures the embedded types in TableGen are consistent with those
used for building tables.
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
If ValueTypes.td contains conditional directives enabled by defs in
LLVM_TABLEGEN_FLAGS then native build tblgen and min-tblgen must be
built with matching flags.
This ensures the embedded types in TableGen are consistent with those
used for building tables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular tablegen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants