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

clang: Set -DLLVM_APPEND_VC_REV=OFF #993

Merged
merged 1 commit into from
Aug 9, 2024
Merged

clang: Set -DLLVM_APPEND_VC_REV=OFF #993

merged 1 commit into from
Aug 9, 2024

Conversation

kraj
Copy link
Owner

@kraj kraj commented Aug 8, 2024

Fixes Issue #991

If this is not disabled, the build tries to use CMake magic to compute repository and sha1 its building, however in case of OE it gets it completely wrong when building from tarball, because its building under TMPDIR which maybe a directory under main repo checkout e.g. poky tree so it traverses up and finds the sha of poky and assumes that its building from a git tree instead of tarball and emits the version control info into clang -v output e.g.

❯ ../image/mnt/b/yoe/master/build/tmp/work/x86_64-linux/clang-native/20.0.0/recipe-sysroot-native/usr/bin/clang -v clang version 20.0.0 (/home/kraj/work/llvm-project f133c59b33a749dc6d5fa8fb9a2366b95ea45068)

This can contain buildpaths since work-shared is where llvm sources will be and they will appear here.

Therefore, avoid cmake trying to do this and we get good clean version info

../recipe-sysroot-native/usr/bin/aarch64-yoe-linux/aarch64-yoe-linux-clang
clang version 20.0.0

This will also avoid emitting buildpaths into debuginfo in some cases where compiler version is emitted into build.id info


Contributor checklist

Reviewer Guidelines

  • When submitting a review, please pick:
    • 'Approve' if this change would be acceptable in the codebase (even if there are minor or cosmetic tweaks that could be improved).
    • 'Request Changes' if this change would not be acceptable in our codebase (e.g. bugs, changes that will make development harder in future, security/performance issues, etc).
    • 'Comment' if you don't feel you have enough information to decide either way (e.g. if you have major questions, or you don't understand the context of the change sufficiently to fully review yourself, but want to make a comment)

Fixes Issue kraj#991

If this is not disabled, the build tries to use CMake magic to compute
repository and sha1 its building, however in case of OE it gets it
completely wrong when building from tarball, because its building under
TMPDIR which maybe a directory under main repo checkout e.g. poky tree
so it traverses up and finds the sha of poky and assumes that its building
from a git tree instead of tarball and emits the version control info into
clang -v output e.g.

❯ ../image/mnt/b/yoe/master/build/tmp/work/x86_64-linux/clang-native/20.0.0/recipe-sysroot-native/usr/bin/clang -v
clang version 20.0.0 (/home/kraj/work/llvm-project f133c59b33a749dc6d5fa8fb9a2366b95ea45068)

This can contain buildpaths since work-shared is where llvm sources will be and they
will appear here.

Therefore, avoid cmake trying to do this and we get good clean version info

> ../recipe-sysroot-native/usr/bin/aarch64-yoe-linux/aarch64-yoe-linux-clang
clang version 20.0.0

This will also avoid emitting buildpaths into debuginfo in some cases where
compiler version is emitted into build.id info

Signed-off-by: Khem Raj <[email protected]>
@kraj kraj merged commit a5ebfbe into kraj:master Aug 9, 2024
1 check passed
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.

1 participant