Skip to content

Fix Clang 19 C++ headers and LLVM tool version mismatches on AL2023#3157

Merged
justsmth merged 1 commit intoaws:mainfrom
justsmth:fix-docker-clang
Apr 9, 2026
Merged

Fix Clang 19 C++ headers and LLVM tool version mismatches on AL2023#3157
justsmth merged 1 commit intoaws:mainfrom
justsmth:fix-docker-clang

Conversation

@justsmth
Copy link
Copy Markdown
Contributor

@justsmth justsmth commented Apr 9, 2026

Issues:

Follow-up to #3152

Description of changes:

The setup-clang-19.sh script sets CC and CXX but doesn't update PATH, so CMake still picks up /usr/bin/llvm-ar and /usr/bin/llvm-ranlib from the dnf-installed LLVM 15. These can't read object files produced by Clang 19 (Unknown attribute kind (86) — Producer: 'LLVM19.1.7' Reader: 'LLVM 15.0.7'). This appends export PATH=/opt/clang-19/bin:$PATH to the generated setup script so the matching LLVM 19 tools are found first.

Testing:

Verified locally in the aarch64 Docker image that which llvm-ar resolves to /opt/clang-19/bin/llvm-ar after sourcing the updated script, and the ASAN build compiles and links successfully.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

# Ensure setup-clang-19.sh also prepends /opt/clang-19/bin to PATH so that
# matching versions of llvm-ar, llvm-ranlib, llvm-symbolizer, etc. are used
# instead of the system LLVM 15 versions.
echo 'export PATH=/opt/clang-19/bin:$PATH' >> /opt/compiler-env/setup-clang-19.sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is specific to AL2023. It's the only image where we installed a pre-built Clang 19 alongside a system LLVM 15 from dnf. The two LLVM versions provide conflicting tools at different paths (/opt/clang-19/bin/llvm-ar vs /usr/bin/llvm-ar).

On Ubuntu 24.04, for example, Clang 14–19 are all installed via apt and the LLVM tools come in versioned variants (llvm-ar-14, llvm-ar-19, etc.) that don't conflict. The create-compiler-env.sh pattern of just setting CC/CXX works fine there.

@justsmth justsmth merged commit 9ce727c into aws:main Apr 9, 2026
304 of 320 checks passed
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.95%. Comparing base (6a5bd61) to head (70e8a3a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3157      +/-   ##
==========================================
- Coverage   77.96%   77.95%   -0.02%     
==========================================
  Files         689      689              
  Lines      122535   122536       +1     
  Branches    17096    17070      -26     
==========================================
- Hits        95537    95519      -18     
- Misses      26100    26117      +17     
- Partials      898      900       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants