mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Ben Hutchings <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, torvalds@linux-foundation.org, efault@gmx.de,
	linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com,
	ben@decadent.org.uk, peterz@infradead.org
Subject: [tip:x86/urgent] x86/headers/uapi: Fix __BITS_PER_LONG value for x32 builds
Date: Fri, 2 Oct 2015 00:45:55 -0700	[thread overview]
Message-ID: <tip-f4b4aae1828855db761bf998ce37d3062b1d6446@git.kernel.org> (raw)
In-Reply-To: <1443660043.2730.15.camel@decadent.org.uk>

Commit-ID:  f4b4aae1828855db761bf998ce37d3062b1d6446
Gitweb:     http://git.kernel.org/tip/f4b4aae1828855db761bf998ce37d3062b1d6446
Author:     Ben Hutchings <ben@decadent.org.uk>
AuthorDate: Thu, 1 Oct 2015 01:40:43 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 2 Oct 2015 09:43:21 +0200

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: Ben Hutchings <ben@decadent.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/1443660043.2730.15.camel@decadent.org.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/uapi/asm/bitsperlong.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/uapi/asm/bitsperlong.h b/arch/x86/include/uapi/asm/bitsperlong.h
index b0ae1c4..217909b 100644
--- a/arch/x86/include/uapi/asm/bitsperlong.h
+++ b/arch/x86/include/uapi/asm/bitsperlong.h
@@ -1,7 +1,7 @@
 #ifndef __ASM_X86_BITSPERLONG_H
 #define __ASM_X86_BITSPERLONG_H
 
-#ifdef __x86_64__
+#if defined(__x86_64__) && !defined(__ILP32__)
 # define __BITS_PER_LONG 64
 #else
 # define __BITS_PER_LONG 32

      parent reply	other threads:[~2015-10-02  7:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01  0:40 [PATCH] x86: uapi: Fix __BITS_PER_LONG for x32 Ben Hutchings
2015-10-01  8:23 ` Ingo Molnar
2015-10-01 13:02   ` Brian Gerst
2015-10-01 20:54     ` Ben Hutchings
2015-10-02  1:52       ` Ben Hutchings
2015-10-02  7:45 ` tip-bot for Ben Hutchings [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-f4b4aae1828855db761bf998ce37d3062b1d6446@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=ben@decadent.org.uk \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome