Fix clang2whirl build with LLVM 11#45
Open
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
Open
Fix clang2whirl build with LLVM 11#45noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
Conversation
The clang2whirl frontend fails to build with LLVM 11 due to two issues: 1. Missing clang/LLVM static libraries at link time. The Makefile only listed a subset of the required clang static libraries, causing undefined reference errors for symbols in clangARCMigrate, clangStaticAnalyzer*, clangCrossTU, clangIndex, clangASTMatchers, and clangToolingCore. Also add -lz (zlib, required by LLVM bitcode reader) and -ltinfo (terminfo, required by LLVM Support). 2. BIstrlcpy and BIstrlcat builtin IDs do not exist in LLVM 11 (they were added in LLVM 14). Guard the case range with a version check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clangARCMigrate,clangStaticAnalyzerFrontend,clangStaticAnalyzerCheckers,clangStaticAnalyzerCore,clangCrossTU,clangIndex,clangASTMatchers,clangToolingCore) plus system libraries-lz(zlib) and-ltinfo(terminfo) that LLVM depends onBIstrlcpy/BIstrlcatbuiltin case range inc2w_builtin.cxxwith#if LLVM_VERSION_MAJOR >= 14, since these builtins were added in Clang 14 and do not exist in LLVM 11Motivation
Building with LLVM 11 (the version available on Ubuntu 20.04) produces undefined reference link errors in clang2whirl, and a compile error for the missing
BIstrlcpy/BIstrlcatidentifiers. These are straightforward compatibility fixes.Test plan
🤖 Generated with Claude Code