mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 15:33:28 +00:00
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: Ben Hutchings <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
14 lines
258 B
C
14 lines
258 B
C
#ifndef __ASM_X86_BITSPERLONG_H
|
|
#define __ASM_X86_BITSPERLONG_H
|
|
|
|
#if defined(__x86_64__) && !defined(__ILP32__)
|
|
# define __BITS_PER_LONG 64
|
|
#else
|
|
# define __BITS_PER_LONG 32
|
|
#endif
|
|
|
|
#include <asm-generic/bitsperlong.h>
|
|
|
|
#endif /* __ASM_X86_BITSPERLONG_H */
|
|
|