Re: [PATCH] tools: Remove conflicting BITS_PER_LONG define

From: Arnaldo Carvalho de Melo
Date: Wed Sep 12 2018 - 15:21:35 EST


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?

[acme@jouet linux]$ git log --oneline -3
96eddb810b14 (HEAD -> master, torvalds/master) Merge tag 'riscv-for-linus-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux
aeb5427218a7 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
5e335542de83 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