Skip to content

fix: removes invalid token from LLVM_VERSION_SUFFIX in LIBC namespace #126193

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

Conversation

samvangysegem
Copy link
Contributor

Resolves #125831

Copy link

github-actions bot commented Feb 7, 2025

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the libc label Feb 7, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 7, 2025

@llvm/pr-subscribers-libc

Author: s.vgys (samvangysegem)

Changes

Resolves #125831


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

1 Files Affected:

  • (modified) libc/CMakeLists.txt (+2-1)
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index c061e2a05ebd8f..1c4c0cd5aa22ba 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -51,7 +51,8 @@ set(LIBC_KERNEL_HEADERS "/usr/include" CACHE STRING "Path to Linux kernel header
 # Defining a global namespace to enclose all libc functions.
 set(default_namespace "__llvm_libc")
 if(LLVM_VERSION_MAJOR)
-  set(default_namespace "__llvm_libc_${LLVM_VERSION_MAJOR}_${LLVM_VERSION_MINOR}_${LLVM_VERSION_PATCH}_${LLVM_VERSION_SUFFIX}")
+  string(REPLACE "-" "" NS_LLVM_VERSION_SUFFIX ${LLVM_VERSION_SUFFIX})
+  set(default_namespace "__llvm_libc_${LLVM_VERSION_MAJOR}_${LLVM_VERSION_MINOR}_${LLVM_VERSION_PATCH}_${NS_LLVM_VERSION_SUFFIX}")
 endif()
 set(LIBC_NAMESPACE ${default_namespace}
   CACHE STRING "The namespace to use to enclose internal implementations. Must start with '__llvm_libc'."

Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

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

Is this a backport? I don't see one for the main branch. Normally you land it on main and follow https://llvm.org/docs/GitHub.html#backporting-fixes-to-the-release-branches for the backport.

@samvangysegem
Copy link
Contributor Author

Is this a backport? I don't see one for the main branch. Normally you land it on main and follow https://llvm.org/docs/GitHub.html#backporting-fixes-to-the-release-branches for the backport.

I looked over that! Will redirect to main and add the comment as per the docs.

@jhuber6 jhuber6 requested review from nickdesaulniers and removed request for lanza, daniel-grumberg, yota9 and ayermolo February 7, 2025 15:02
Copy link
Member

@nickdesaulniers nickdesaulniers left a comment

Choose a reason for hiding this comment

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

Thanks for the patch!

@jhuber6 jhuber6 merged commit 51759ff into llvm:main Feb 7, 2025
22 checks passed
Copy link

github-actions bot commented Feb 7, 2025

@samvangysegem Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@jhuber6 jhuber6 added this to the LLVM 20.X Release milestone Feb 7, 2025
@jhuber6
Copy link
Contributor

jhuber6 commented Feb 7, 2025

/cherry-pick 51759ff

@llvmbot
Copy link
Member

llvmbot commented Feb 7, 2025

/pull-request #126284

swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Feb 7, 2025
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

[LIBC] Invalid token in LIBC_NAMESPACE macro expansion
4 participants