-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
compactsnoop fails to compile on Fedora36/LLVM14 #4182
Comments
yonghong-song
added a commit
that referenced
this issue
Aug 26, 2022
Fix issue #4182. llvm doesn't support signed division and an assertion error will happen when the IR contains sdiv. The reason is due to code zone - zone_pgdat->node_zones where zone and zone_pgdat->node_zones are pointers to struct zone (with size 1664). So effectively the above is equivalent to ((void *)zone - (void *)zone_pgdat->node_zones)/sizeof(struct zone) which is converted to sdiv insn. llvm11 seems okay and I didn't investigate why. But llvm14 and latest llvm16 failed with compiler fatal error. To fix the issue let us replace the above '(void *)' as '(u64)' and then the udiv will be used for the division. Signed-off-by: Yonghong Song <[email protected]>
#4196 should fix the issue. |
yonghong-song
added a commit
that referenced
this issue
Aug 27, 2022
Fix issue #4182. llvm doesn't support signed division and an assertion error will happen when the IR contains sdiv. The reason is due to code zone - zone_pgdat->node_zones where zone and zone_pgdat->node_zones are pointers to struct zone (with size 1664). So effectively the above is equivalent to ((void *)zone - (void *)zone_pgdat->node_zones)/sizeof(struct zone) which is converted to sdiv insn. llvm11 seems okay and I didn't investigate why. But llvm14 and latest llvm16 failed with compiler fatal error. To fix the issue let us replace the above '(void *)' as '(u64)' and then the udiv will be used for the division. Signed-off-by: Yonghong Song <[email protected]>
confirmed! Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When trying to run the compactsnoop test on Fedora, it fails with:
LLVM/Clang:
The error message seems to be related to: https://bugs.llvm.org/show_bug.cgi?id=26976
The BPF program generated by:
is
https://gist.github.com/chantra/af0c77d97faa4e4c59c5a19b079527a4
It is not clear to me where such division/modulo happens.
cc @yonghong-song
The text was updated successfully, but these errors were encountered: