tools: Remove conflicting BITS_PER_LONG define
PATCH 1/1 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.
---
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(-)
tools/include/linux/bitops.h +1 -4
@@ -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
Signature · 1 line
2.4.6
Em Wed, Sep 12, 2018 at 07:02:32PM +0200, Alexander Sverdlin escreveu:
Quoted 10 lines
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:
Quoted 4 lines
.../tools/include/asm-generic/bitsperlong.h:8:0: error: "BITS_PER_LONG" redefined [-Werror]
#defineBITS_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/
- Arnaldo
Em Wed, Sep 12, 2018 at 04:01:07PM -0300, Arnaldo Carvalho de Melo escreveu:
Quoted 14 lines
Em Wed, Sep 12, 2018 at 07:02:32PM +0200, Alexander Sverdlin escreveu:
Quoted 13 lines
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]
#defineBITS_PER_LONG(__CHAR_BIT__*__SIZEOF_LONG__)
Quoted 5 lines
Quoted 1 line
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?
[acme@jouet linux]$ git log --oneline -396eddb810b14 (HEAD -> master, torvalds/master) Merge tag 'riscv-for-linus-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linuxaeb5427218a7 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi5e335542de83 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[acme@jouet linux]$ make -C tools/objtool/
make: Entering directory '/home/acme/git/linux/tools/objtool'
make -C /home/acme/git/linux/tools/build CFLAGS= LDFLAGS= fixdep
make[1]: Entering directory '/home/acme/git/linux/tools/build'
HOSTCC fixdep.o HOSTLD fixdep-in.o LINK fixdep
make[1]: Leaving directory '/home/acme/git/linux/tools/build'
make -C /home/acme/git/linux/tools/lib/subcmd/ OUTPUT=/home/acme/git/linux/tools/objtool/ make[1]: Entering directory '/home/acme/git/linux/tools/lib/subcmd'
make -C /home/acme/git/linux/tools/build CFLAGS= LDFLAGS= /home/acme/git/linux/tools/objtool/fixdep
HOSTCC /home/acme/git/linux/tools/objtool/fixdep.o HOSTLD /home/acme/git/linux/tools/objtool/fixdep-in.o LINK /home/acme/git/linux/tools/objtool/fixdep CC /home/acme/git/linux/tools/objtool/exec-cmd.o CC /home/acme/git/linux/tools/objtool/help.o CC /home/acme/git/linux/tools/objtool/pager.o CC /home/acme/git/linux/tools/objtool/parse-options.o CC /home/acme/git/linux/tools/objtool/run-command.o CC /home/acme/git/linux/tools/objtool/sigchain.o CC /home/acme/git/linux/tools/objtool/subcmd-config.o LD /home/acme/git/linux/tools/objtool/libsubcmd-in.o AR /home/acme/git/linux/tools/objtool/libsubcmd.a make[1]: Leaving directory '/home/acme/git/linux/tools/lib/subcmd' make[1]: Entering directory '/home/acme/git/linux/tools/objtool' make[2]: Entering directory '/home/acme/git/linux/tools/objtool' GEN arch/x86/lib/inat-tables.c CC arch/x86/decode.o LD arch/x86/objtool-in.o make[2]: Leaving directory '/home/acme/git/linux/tools/objtool' CC builtin-check.o CC builtin-orc.o CC check.o CC orc_gen.o CC orc_dump.o CC elf.o CC special.o CC objtool.o CC libstring.o CC str_error_r.o LD objtool-in.o
make[1]: Leaving directory '/home/acme/git/linux/tools/objtool'
LINK objtool
make: Leaving directory '/home/acme/git/linux/tools/objtool' [acme@jouet linux]$
Now building it without -C:
$ make -C tools/clean [acme@jouet objtool]$ make make -C /home/acme/git/linux/tools/build CFLAGS= LDFLAGS= fixdep make[1]: Entering directory '/home/acme/git/linux/tools/build' HOSTCC fixdep.o HOSTLD fixdep-in.o LINK fixdep make[1]: Leaving directory '/home/acme/git/linux/tools/build' make -C /home/acme/git/linux/tools/lib/subcmd/ OUTPUT=/home/acme/git/linux/tools/objtool/ make[1]: Entering directory '/home/acme/git/linux/tools/lib/subcmd' make -C /home/acme/git/linux/tools/build CFLAGS= LDFLAGS= /home/acme/git/linux/tools/objtool/fixdep HOSTCC /home/acme/git/linux/tools/objtool/fixdep.o HOSTLD /home/acme/git/linux/tools/objtool/fixdep-in.o LINK /home/acme/git/linux/tools/objtool/fixdep CC /home/acme/git/linux/tools/objtool/exec-cmd.o CC /home/acme/git/linux/tools/objtool/help.o CC /home/acme/git/linux/tools/objtool/pager.o CC /home/acme/git/linux/tools/objtool/parse-options.o CC /home/acme/git/linux/tools/objtool/run-command.o CC /home/acme/git/linux/tools/objtool/sigchain.o CC /home/acme/git/linux/tools/objtool/subcmd-config.o LD /home/acme/git/linux/tools/objtool/libsubcmd-in.o AR /home/acme/git/linux/tools/objtool/libsubcmd.a make[1]: Leaving directory '/home/acme/git/linux/tools/lib/subcmd' make[1]: Entering directory '/home/acme/git/linux/tools/objtool' make[2]: Entering directory '/home/acme/git/linux/tools/objtool' GEN arch/x86/lib/inat-tables.c CC arch/x86/decode.o LD arch/x86/objtool-in.o make[2]: Leaving directory '/home/acme/git/linux/tools/objtool' CC builtin-check.o CC builtin-orc.o CC check.o CC orc_gen.o CC orc_dump.o CC elf.o CC special.o CC objtool.o CC libstring.o CC str_error_r.o LD objtool-in.o make[1]: Leaving directory '/home/acme/git/linux/tools/objtool' LINK objtool [acme@jouet objtool]$
So where is the failure?
- Arnaldo
Quoted 15 lines · Arnaldo Carvalho de Melo
Em Wed, Sep 12, 2018 at 04:01:07PM -0300, Arnaldo Carvalho de Melo escreveu:
Quoted 14 lines
Em Wed, Sep 12, 2018 at 07:02:32PM +0200, Alexander Sverdlin escreveu:
Quoted 13 lines
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]
#defineBITS_PER_LONG(__CHAR_BIT__*__SIZEOF_LONG__)
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
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 __WORDSIZEAnd 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.
Signature · 2 lines
Best regards, Alexander Sverdlin.
Em Wed, Sep 19, 2018 at 02:28:29PM +0200, Alexander Sverdlin escreveu:
Quoted 99 lines · Arnaldo Carvalho de Melo
Quoted 15 lines
Em Wed, Sep 12, 2018 at 04:01:07PM -0300, Arnaldo Carvalho de Melo escreveu:
Quoted 14 lines
Em Wed, Sep 12, 2018 at 07:02:32PM +0200, Alexander Sverdlin escreveu:
Quoted 13 lines
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]
#defineBITS_PER_LONG(__CHAR_BIT__*__SIZEOF_LONG__)Quoted 7 lines
Quoted 5 lines
Quoted 1 line
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]
#defineBITS_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 __WORDSIZEAnd 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
__WORDSIZE32...
# 1 "
.../sys-root/usr/include/bits/wordsize.h" 1 3 4...
#define
__WORDSIZE32...
# 1 "
.../sys-root/usr/include/bits/wordsize.h" 1 3 4...
#define
__WORDSIZE32...
# 1 "
.../sys-root/usr/include/bits/wordsize.h" 1 3 4...
#define
__WORDSIZE32...
# 1 "
.../tools/include/linux/bitops.h" 1...
#define
BITS_PER_LONG__WORDSIZE...
# 6 "
.../tools/include/asm-generic/bitsperlong.h" 2
Quoted 8 lines
...
#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 buildx86_64kernel), maybe I'm just using a newer compiler than you.
That is indeed a cross build environment I'm not regularly testing, I'm trying these cross builds:
9 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 10 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 19 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.2.0-4) 8.2.0 20 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.1.0-12) 8.1.0 21 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.1.0-12) 8.1.0 22 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.1.0-12) 8.1.0 28 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 46 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.5-2017.10) 5.5.0 48 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 49 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 50 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 51 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 52 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 53 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.3.0-16ubuntu3) 7.3.0 58 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.3.0-16ubuntu3) 7.3.0 59 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 60 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 61 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 62 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 63 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 64 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 65 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 66 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
I'll try and get one for building a x86_64 tools/perf, tools/lib/{api,bpf,traceevent} to see if I manage to reproduce the problem you're reporting.
- Arnaldo
Hi!
Quoted 2 lines · Arnaldo Carvalho de Melo
That is indeed a cross build environment I'm not regularly testing, I'm trying these cross builds:
Probably my assumption was wrong about cross compiler.
HOST tool fails (objtool) and it's being build by separate i686->i686 compiler.
Quoted 16 lines
9 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 10 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 19 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.2.0-4) 8.2.0 20 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.1.0-12) 8.1.0 21 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.1.0-12) 8.1.0 22 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.1.0-12) 8.1.0 28 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 46 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.5-2017.10) 5.5.0 48 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 49 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 50 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 51 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 52 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 53 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.3.0-16ubuntu3) 7.3.0 58 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.3.0-16ubuntu3) 7.3.0
Quoted 8 lines
59 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 60 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 61 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 62 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 63 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 64 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 65 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 66 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
I think the big list is mostly irrelevant. I was wondering why only x86 fails from my list of different targets (ARM, ARM64, MIPS64, x86, x86_64, PPC), but it turns out that objtool is only built for HAVE_STACK_VALIDATION targets (means, x86 only?).
I've tried to build it for MIPS64 with make tools/objtool and it fails in the same way.
One special thing about my compiler is really old glibc it's being built against (hello RHEL :) maybe this causes reverse order of includes.
Nevertheless two conflicting defines of BITS_PER_LONG will only work with one particular order of includes but not opposite.
Quoted 3 lines
I'll try and get one for building a
x86_64tools/perf,tools/lib/{api,bpf,traceevent}to see if I manage to reproduce the problem you're reporting.
Signature · 2 lines
Best regards, Alexander Sverdlin.
Hello Arnaldo,
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Em Wed, Sep 12, 2018 at 07:02:32PM +0200, Alexander Sverdlin escreveu:
Quoted 12 lines
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]
#defineBITS_PER_LONG(__CHAR_BIT__*__SIZEOF_LONG__)
[...]
finally I more or less know what happens here. In the actual Linux we have two files defining the same define:
Quoted 1 line
Quoted 1 line
# 1 "
.../tools/include/linux/bitops.h" 1
#ifndef BITS_PER_LONG
# define BITS_PER_LONG __WORDSIZE #endif
Quoted 1 line
Quoted 1 line
# 6 "
.../tools/include/asm-generic/bitsperlong.h" 2
#ifdef __SIZEOF_LONG__
#define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__) #else
#define BITS_PER_LONG __WORDSIZE
#endif
So the two defines only work together if bitsperlong.h is included first. In objtool both files are included and for most people bitsperlong.h is indeed included first.
Quoted 3 lines
I'll try and get one for building a
x86_64tools/perf,tools/lib/{api,bpf,traceevent}to see if I manage to reproduce the problem you're reporting.
One way to reproduce the reverted include order is to take a HOST compiler built against old Linux headers, namely 2.6.30 and older.
This is because of the changes in asm/types.h.
It would be possible to put a guard into bitsperlong.h (#ifndef BITS_PER_LONG), but it just doesn't look correct to me that we have two files defining the same thing once quite simple, in the second case even more tricky.
Signature · 2 lines
Best regards, Alexander Sverdlin.
Quoted 13 lines · Arnaldo Carvalho de Melo
Quoted 13 lines
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]
#defineBITS_PER_LONG(__CHAR_BIT__*__SIZEOF_LONG__)
Quoted 4 lines
Quoted 1 line
Include <
asm/bitsperlong.h> instead as other headers do.Please try test building all tools in
tools/This broke make -C
tools/perf/
I agree, this brakes perf, so we need to work further on that...
Signature · 2 lines
Best regards, Alexander Sverdlin.