lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Sep 2018 19:02:32 +0200
From:   Alexander Sverdlin <alexander.sverdlin@...ia.com>
To:     linux-kernel@...r.kernel.org
Cc:     Alexander Sverdlin <alexander.sverdlin@...ia.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>
Subject: [PATCH] tools: Remove conflicting BITS_PER_LONG define

  CC       .../tools/objtool/builtin-check.o
  ...
In file included from .../tools/arch/x86/include/uapi/asm/bitsperlong.h:11:0,
                 from .../tools/include/asm-generic/bitops/__ffs.h:6,
                 from .../tools/include/asm-generic/bitops.h:16,
                 from .../tools/include/linux/bitops.h:35,
                 from .../tools/include/linux/hashtable.h:13,
                 from elf.h:24,
                 from check.h:22,
                 from builtin-check.c:30:
.../tools/include/asm-generic/bitsperlong.h:8:0: error: "BITS_PER_LONG" redefined [-Werror]
 #define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)

Include <asm/bitsperlong.h> instead as other headers do.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@...ia.com>
---

Seen during x86_64 build. Seems that most of the compilers do not define
__SIZEOF_LONG__, but my does.

 tools/include/linux/bitops.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h
index acc704b..4ae5232 100644
--- a/tools/include/linux/bitops.h
+++ b/tools/include/linux/bitops.h
@@ -3,16 +3,13 @@
 #define _TOOLS_LINUX_BITOPS_H_
 
 #include <asm/types.h>
+#include <asm/bitsperlong.h>
 #include <linux/compiler.h>
 
 #ifndef __WORDSIZE
 #define __WORDSIZE (__SIZEOF_LONG__ * 8)
 #endif
 
-#ifndef BITS_PER_LONG
-# define BITS_PER_LONG __WORDSIZE
-#endif
-
 #define BIT_MASK(nr)		(1UL << ((nr) % BITS_PER_LONG))
 #define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
 #define BITS_PER_BYTE		8
-- 
2.4.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ