tools lib: Fix builds when glibc contains strlcpy()
Vitaly Chikunov authored
commit 6c4798d3 upstream.

Disable a couple of compilation warnings (which are treated as errors)
on strlcpy() definition and declaration, allowing users to compile perf
and kernel (objtool) when:

1. glibc have strlcpy() (such as in ALT Linux since 2004) objtool and
   perf build fails with this (in gcc):

  In file included from exec-cmd.c:3:
  tools/include/linux/string.h:20:15: error: redundant redeclaration of ‘strlcpy’ [-Werror=redundant-decls]
     20 | extern size_t strlcpy(char *dest, const char *src, size_t size);

2. clang ignores `-Wredundant-decls', but produces another warning when
   building perf:

    CC       util/string.o
  ../lib/string.c:99:8: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
  size_t __weak strlcpy(char *dest, const char *src, size_t size)
  ../../tools/include/linux/compiler.h:66:34: note: expanded from macro '__weak'
  # define __weak           ...
44d87037
Name Last commit Last update
..
accounting License cleanup: add SPDX GPL-2.0 license identifier to files with no license
arch tools headers: Synchronise x86 cpufeatures.h for L1TF additions
build tools: build: Use HOSTLDFLAGS with fixdep
cgroup tools: fix cross-compile var clobbering
firewire License cleanup: add SPDX GPL-2.0 license identifier to files with no license
gpio tools: gpio: Correctly add make dependencies for gpio_utils
hv Tools: hv: kvp: eliminate 'may be used uninitialized' warning
iio iio: iio-utils: Fix possible incorrect mask calculation
include tools lib: Fix builds when glibc contains strlcpy()
kvm/kvm_stat tools/kvm_stat: fix handling of invalid paths in debugfs provider
laptop tools: fix cross-compile var clobbering
leds tools: fix cross-compile var clobbering
lib tools lib: Fix builds when glibc contains strlcpy()
net bpf: fix uninitialized variable in bpf tools
nfsd License cleanup: add SPDX GPL-2.0 license identifier to files with no license
objtool x86/insn: Add some Intel instructions to the opcode map
pci tools: PCI: Fix broken pcitest compilation
pcmcia License cleanup: add SPDX GPL-2.0 license identifier to files with no license
perf perf c2c: Fix return type for histogram sorting comparision functions
power tools/power/cpupower: Fix initializer override in hsw_ext_cstates
scripts tools: fix cross-compile var clobbering
spi tools: fix cross-compile var clobbering
testing selftests/ipc: Fix msgque compiler warnings
thermal/tmon tools/thermal: tmon: fix for segfault
time tools: add script to test udelay
usb usbip: tools: fix fd leakage in the function of read_attr_usbip_status
virtio virtio: fix test build after uio.h change
vm tools: fix cross-compile var clobbering
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license