tools/power turbostat: Build with _FILE_OFFSET_BITS=64
authorAlexander Monakov <amonakov@ispras.ru>
Sun, 23 Aug 2020 20:27:02 +0000 (23:27 +0300)
committerLen Brown <len.brown@intel.com>
Thu, 3 Sep 2020 17:59:10 +0000 (13:59 -0400)
For compatibility reasons, Glibc off_t is a 32-bit type on 32-bit x86
unless _FILE_OFFSET_BITS=64 is defined. Add this define, as otherwise
reading MSRs with index 0x80000000 and above attempts a pread with a
negative offset, which fails.

Signed-off-by: Alexander Monakov <amonakov@ispras.ru>
Tested-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/Makefile

index d08765531bcb9e5b6a47cd8f233c05bb2aa0352f..f3e3c94ab9bd56f88a6ed03ad888d48ba4b3eab5 100644 (file)
@@ -12,6 +12,7 @@ turbostat : turbostat.c
 override CFLAGS +=     -O2 -Wall -I../../../include
 override CFLAGS +=     -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
 override CFLAGS +=     -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"'
+override CFLAGS +=     -D_FILE_OFFSET_BITS=64
 override CFLAGS +=     -D_FORTIFY_SOURCE=2
 
 %: %.c