Conversation
| * Format: llvm<LLVM_VERSION>-swig<SWIG_VERSION>-<BUILD_DATE> | ||
| * Update this when rebuilding with a new LLVM, SWIG, or JNI code change. | ||
| */ | ||
| public static final String VERSION = "llvm21.1.8-swig4.4.1-20260327"; |
There was a problem hiding this comment.
This ensures that crash log files contain the exact version of the jar file that crashed.
src/eu/cqse/clang/Main.java
Outdated
| try { | ||
| SWIGTYPE_p_CXTranslationUnitImpl translationUnit = Clang.clang_parseTranslationUnit(index, | ||
| files[0].getFilename(), null, 0, files, files.length, ClangJNI.CXTranslationUnit_KeepGoing_get()); | ||
| files[0].getFilename(), null, files, files.length, ClangJNI.CXTranslationUnit_KeepGoing_get()); |
There was a problem hiding this comment.
The null here is for the String[] command_line_args parameter. In the new SWIG binding, when you pass null for a String[], the typemap generates a
NULL pointer and sets the length to 0 automatically on the C side. So there's no need to pass the count separately — the SWIG typemap handles both
the pointer and length from the single String[] argument.
84de9ca to
9ff9676
Compare
Major upgrade of the clang JNI bindings from LLVM 9.0.1 (2019) to LLVM 21.1.8 (2025). This fixes a SIGSEGV crash in libclang that occurred when analyzing certain C++ files in Teamscale (TS-44325). Changes to the JNI bindings: - Regenerated SWIG bindings for LLVM 21.1.8 (generated/) - Added String[] typemap for clang_parseTranslationUnit, allowing compiler flags (e.g., -x c++) to be passed from Java - Added clang_parseTranslationUnit2_wrap for better error reporting - Removed clang-tidy support (unused by Teamscale) - Fixed NULL file crash in getSpellingLocationPropertiesImpl and getExpansionLocationPropertiesImpl for built-in/synthesized locations - Fixed visitor callback exception safety: use CXChildVisit_Break instead of C++ exceptions to avoid corrupting clang's internal state - Applied -fexceptions only to JNI source files, not globally - Embedded version string in native library temp directory name Build infrastructure: - Rewrote BUILD.md with full cross-platform build workflow - Added BUILD-TIMES.md for tracking build durations - build-linux.sh now supports both Linux and macOS (auto-detects) - build-linux.sh prints build time after compilation - Native libraries are transferred between machines via git LFS during the build, then removed in a squash commit to keep LFS storage small - Removed build-mac.md and build-windows.md (superseded by BUILD.md) Testing: - Added ClangJniTest with 25 integration tests covering parsing, type resolution, typedef chains, operator detection, templates, lambdas, OpenMP pragmas, and repeated parse/dispose cycles - Moved test classes to test/ directory (not included in JAR) - Added Main.java as JAR entry point for standalone AST debugging Native libraries included in clang-jni.jar: - libclang-linux.so (x86_64) - libclang-mac.dylib (arm64) - libclang-win.dll (x86_64)
c975770 to
639266b
Compare
| |----------|--------|-------------|-------------------------------------|------| | ||
| | Windows | Intel Xeon @ 2.20 GHz, 2 cores / 4 threads, 16 GB RAM, Windows Server 2022 Datacenter | 20.1.8 | ~2h 45m (full build with `--parallel`) | 2026-03-19 | | ||
| | Linux | *(please fill in after building)* | | | | | ||
| | macOS | *(please fill in after building)* | | | | |
There was a problem hiding this comment.
The linux and mac sessions did not see that they should track the timing info.
Afterwards, I made this more visible and explicit.
But the windows build (win2) was the slowest one anyway, so that is the most important information.
No description provided.