6d6c4c1bb5
commit 6c4798d3f08b81c2c52936b10e0fa872590c96ae 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 __attribute__((weak)) /usr/include/bits/string_fortified.h:151:8: note: previous definition is here __NTH (strlcpy (char *__restrict __dest, const char *__restrict __src, Committer notes: The #pragma GCC diagnostic directive was introduced in gcc 4.6, so check for that as well. Fixes: |
||
---|---|---|
.. | ||
sched | ||
unaligned | ||
atomic.h | ||
bitmap.h | ||
bitops.h | ||
bits.h | ||
bug.h | ||
compiler-gcc.h | ||
compiler.h | ||
coresight-pmu.h | ||
debug_locks.h | ||
delay.h | ||
err.h | ||
export.h | ||
filter.h | ||
ftrace.h | ||
gfp.h | ||
hardirq.h | ||
hash.h | ||
hashtable.h | ||
interrupt.h | ||
irqflags.h | ||
jhash.h | ||
kallsyms.h | ||
kern_levels.h | ||
kernel.h | ||
linkage.h | ||
list.h | ||
lockdep.h | ||
log2.h | ||
module.h | ||
mutex.h | ||
nmi.h | ||
overflow.h | ||
poison.h | ||
proc_fs.h | ||
rbtree.h | ||
rbtree_augmented.h | ||
rcu.h | ||
refcount.h | ||
seq_file.h | ||
spinlock.h | ||
stacktrace.h | ||
string.h | ||
stringify.h | ||
time64.h | ||
types.h |