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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 19 Sep 2018 14:28:29 +0200
From:   Alexander Sverdlin <alexander.sverdlin@...ia.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
CC:     Arnaldo Carvalho de Melo <acme@...hat.com>,
        <linux-kernel@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] tools: Remove conflicting BITS_PER_LONG define

On 12/09/2018 21:21, Arnaldo Carvalho de Melo wrote:
> Em Wed, Sep 12, 2018 at 04:01:07PM -0300, Arnaldo Carvalho de Melo escreveu:
>> Em Wed, Sep 12, 2018 at 07:02:32PM +0200, Alexander Sverdlin escreveu:
>>>   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.
>>
>> Please try test building all tools in tools/
>>
>> This broke make -C tools/perf/
> 
> Also, where is the build of objtool failing?
I've prepared some examples for you with "-fdirectives-only -save-temps":

This is what happens ultimately:

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__)
 
In file included from .../tools/include/linux/hashtable.h:13:0,
                 from elf.h:24,
                 from check.h:22,
                 from builtin-check.c:30:
.../tools/include/linux/bitops.h:13:0: note: this is the location of the previous definition
 # define BITS_PER_LONG __WORDSIZE

And this are relevant parts from builtin-check.i file:

# 1 "builtin-check.c"
# 1 ".../tools/objtool//"
# 1 "<built-in>"

...

#define __SIZEOF_LONG__ 4

...

# 1 ".../sys-root/usr/include/bits/wordsize.h" 1 3 4

...

#define __WORDSIZE 32

...

# 1 ".../sys-root/usr/include/bits/wordsize.h" 1 3 4

...

#define __WORDSIZE 32

...

# 1 ".../sys-root/usr/include/bits/wordsize.h" 1 3 4

...

#define __WORDSIZE 32

...

# 1 ".../sys-root/usr/include/bits/wordsize.h" 1 3 4

...

#define __WORDSIZE 32

...

# 1 ".../tools/include/linux/bitops.h" 1

...

#define BITS_PER_LONG __WORDSIZE

...

# 6 ".../tools/include/asm-generic/bitsperlong.h" 2

...

#define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)

It could be that your compiler doesn't define __SIZEOF_LONG__, while my does.
It could be that it's caused by the fact that I'm using a "cross compiler"
(i686 compiler to build x86_64 kernel), maybe I'm just using a newer compiler
than you.

-- 
Best regards,
Alexander Sverdlin.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ