Commit f4b4aae1 authored by Ben Hutchings's avatar Ben Hutchings Committed by Ingo Molnar

x86/headers/uapi: Fix __BITS_PER_LONG value for x32 builds

On x32, gcc predefines __x86_64__ but long is only 32-bit.  Use
__ILP32__ to distinguish x32.

Fixes this compiler error in perf:

	tools/include/asm-generic/bitops/__ffs.h: In function '__ffs':
	tools/include/asm-generic/bitops/__ffs.h:19:8: error: right shift count >= width of type [-Werror=shift-count-overflow]
	  word >>= 32;

This isn't sufficient to build perf for x32, though.
Signed-off-by: default avatarBen Hutchings <>
Cc: Linus Torvalds <>
Cc: Mike Galbraith <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Link: default avatarIngo Molnar <>
parent ab76f7b4
#ifdef __x86_64__
#if defined(__x86_64__) && !defined(__ILP32__)
# define __BITS_PER_LONG 64
# define __BITS_PER_LONG 32
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment