void-packages/srcpkgs/pahole/patches/fix_sysconf.patch

17 lines
465 B
Diff

--- a/dwarves_fprintf.c
+++ b/dwarves_fprintf.c
@@ -1683,11 +1683,13 @@
void dwarves__fprintf_init(uint16_t user_cacheline_size)
{
if (user_cacheline_size == 0) {
+#ifdef _SC_LEVEL1_DCACHE_LINESIZE
long sys_cacheline_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
if (sys_cacheline_size > 0)
cacheline_size = sys_cacheline_size;
else
+#endif
cacheline_size = 64; /* Fall back to a sane value */
} else
cacheline_size = user_cacheline_size;