Skip to content

[Polly][CMake] Fix exports #122123

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
Jan 20, 2025
Merged

[Polly][CMake] Fix exports #122123

merged 2 commits into from
Jan 20, 2025

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Jan 8, 2025

If Polly is built with LLVM_POLLY_LINK_INTO_TOOLS=ON (the default for monorepo builds), then Polly will become a dependency of the LLVMExtensions component, which is part of LLVMExports. As such, all the Polly libraries also have to be part of LLVMExports.

However, if Polly is built with LLVM_POLLY_LINK_INTO_TOOLS=OFF, we also end up adding Polly libraries to LLVMExports. This is undesirable, as it adds a hard dependency from llvm on polly.

Fix this by only exporting polly libraries from LLVMExports if LLVM_POLLY_LINK_INTO_TOOLS is enabled.

If Polly is built with LLVM_POLLY_LINK_INTO_TOOLS=ON (the default for
monorepo builds), then Polly will become a dependency of the
LLVMExtensions component, which is part of LLVMExports. As such,
all the Polly library also have to be part of LLVMExports.

However, if Polly is built with LLVM_POLLY_LINK_INTO_TOOLS=OFF,
we also end up adding Polly libraries to LLVMExports. This is
undesirable, as the whole point of the option is that we don't
add a hard dependency from llvm on polly.

Fix this by only exporting polly libraries from LLVMExports if
LLVM_POLLY_LINK_INTO_TOOLS is enabled.
@nikic nikic requested a review from Meinersbur January 8, 2025 15:02
@llvmbot llvmbot added the cmake Build system in general and CMake in particular label Jan 8, 2025
@nikic
Copy link
Contributor Author

nikic commented Jan 8, 2025

Also have to declare LLVM_POLLY_LINK_INTO_TOOLS earlier, because we use it before llvm_add_pass_plugin is called. Didn't notice this during testing because I was passing it explicitly...

@nikic
Copy link
Contributor Author

nikic commented Jan 15, 2025

Ping :)

@sebpop
Copy link
Contributor

sebpop commented Jan 16, 2025

The change looks good to me.

@nikic nikic merged commit 2d6d476 into llvm:main Jan 20, 2025
6 of 8 checks passed
@nikic nikic deleted the polly-exports-2 branch January 20, 2025 11:33
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 20, 2025

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

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

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/38/87' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:C:\a\lld-x86_64-win\build\unittests\Support\.\SupportTests.exe-LLVM-Unit-18384-38-87.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=87 GTEST_SHARD_INDEX=38 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




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


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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants