Fixes PR51331. On FreeBSD, the elf headers don't (yet) provide the
ElfW(type) macro. However, there is a similar set of macros in the
<sys/elf-generic.h> header, of which __ElfN(type) exactly matches the
indended purpose.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
compiler-rt/lib/profile/InstrProfilingPlatformLinux.c | ||
---|---|---|
21 | If FreeBSD will have the macro, add a comment so that this chunk can be removed in the future. |
compiler-rt/lib/profile/InstrProfilingPlatformLinux.c | ||
---|---|---|
21 | Newer versions might have it, but older released versions won't. That's what the !defined(ElfW) is for. But you're right that a comment is appropriate. |
compiler-rt/lib/profile/InstrProfilingPlatformLinux.c | ||
---|---|---|
23 | (I expected an exact version, instead of a vague "If this is added to all supported FreeBSD versions in the future") Without the comment, a reader may remember to clean up this as well. |
compiler-rt/lib/profile/InstrProfilingPlatformLinux.c | ||
---|---|---|
23 | Well, predictions are hard, especially about the future. :) That said, if we add this macro to FreeBSD 14.0-CURRENT, it can be merged back to the existing stable branches, which are currently:
This type of addition is usually not added to existing releases, which typically only provide security fixes, and bug fixes that affect a large number of users. |
If FreeBSD will have the macro, add a comment so that this chunk can be removed in the future.