Re: [GIT PULL 00/66] perf/core improvements and fixes

From: Peter Zijlstra
Date: Wed Jul 13 2016 - 16:55:14 EST


On Wed, Jul 13, 2016 at 03:49:14PM -0500, Josh Poimboeuf wrote:
> That '#define BITS_PER_LONG 32' comes from the following code in
> tools/include/asm-generic/bitsperlong.h:
>
> #ifdef CONFIG_64BIT
> #define BITS_PER_LONG 64
> #else
> #define BITS_PER_LONG 32
> #endif /* CONFIG_64BIT */
>
> Because objtool doesn't have CONFIG_64BIT defined, it falls through to
> the '#else' condition. I think tools code shouldn't be relying on
> kernel config options.

Right.. __LP64__ would work in general I think, or __SIZEOF_LONG__ *
__CHAR_BIT__.