Skip to content
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

Hotfix for K LLVM backend update #869

Merged
merged 3 commits into from
Oct 19, 2023
Merged

Hotfix for K LLVM backend update #869

merged 3 commits into from
Oct 19, 2023

Conversation

Baltoli
Copy link
Contributor

@Baltoli Baltoli commented Oct 19, 2023

This PR is a hotfix for a broken backend update job.

When using the new inlined version of llvm-kompile, we were incorrectly using the result of sys::getDefaultTargetTriple() as our target for machine code emission, rather than the consistent value selected by running Clang on an empty input file.

On newer versions of macOS, this produces warnings like:

ld: warning: object file (tmp.1YutNb2k5B.o) was built for newer macOS version (14.0) than being linked (10.12)

when running llvm-kompile. These warnings were silently absorbed by CI as they are just warnings, but they are a) noisy and b) break the K test suite when grepping for error messages in failed compilations (kompile ... 2>&1 | grep ...).

The fix is just to use our existing technique for target triple selection in the one place we weren't previously.

Additionally, the PR makes two small related changes:

  • Add conditional compilation guards for some LLVM headers that give deprecation warnings in LLVM 17
  • Catch future errors of this kind in the backend CI by ensuring that llvm-kompile is silent and doesn't pollute stderr with extra output when it runs successfully

Copy link
Collaborator

@dwightguth dwightguth left a comment

Choose a reason for hiding this comment

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

@Baltoli agreed to address my comment in a follow-up pr

@rv-jenkins rv-jenkins merged commit 42e1168 into master Oct 19, 2023
5 checks passed
@rv-jenkins rv-jenkins deleted the hotfix-target-triple branch October 19, 2023 10:27
rv-jenkins pushed a commit that referenced this pull request Oct 19, 2023
This PR follows up on #869 to refactor our use of CMake to configure C++
code with build-specific information. Instead of configuring individual
files, we push all `@...@` stanzas into `config/macros.h` and use that
file as the single source of configured literals.

There is a small change to the implementation of the LLVM header in
`CreateTerm.h` to support this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants