Follow up to breakages reported in D77422
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
You shouldn't be checking the running kernel but the version of the kernel headers. Think of build hosts building LLVM for an entirely different system altogether.
To add to that, you shouldn't hardcode version, but instead check that the problematic field is present or not.
And, i'm not sure this is a good idea. If the kernel is too old, i'd suggest only disabling the functionality
that wants that new field, not the entire libpfm
Good point! I've updated the cmake file to look for the field and set a new flag accordingly
Thanks!
No, actually. The patch that uses it is D77422
I was planning on letting this one go in first, then rebase the other one.
CheckStructHasMember didn't work (because cycles is a bit field) so updated it to just compile a small program that accesses .cycles.
llvm/cmake/modules/FindLibpfm.cmake | ||
---|---|---|
20 | the field 'cycles'. | |
21 | I'd finish the sentence with something like '...because 'cycles' is a bit field which is not supported by CheckStructHasMember.' | |
23 | In https://reviews.llvm.org/D77422, we're including perfmon/perf_event.h, we should use the same header in both places. | |
29 | Nit: Consider indenting the C++ source (two spaces more than CHECK_CXX_SOURCE_COMPILES), or moving it into a variable so that it doesn't break the indentation of the CMake code. | |
llvm/include/llvm/Config/config.h.cmake | ||
100 |
|
llvm/cmake/modules/FindLibpfm.cmake | ||
---|---|---|
20 | Nit: cycles (the field name is in plural) |
the field 'cycles'.