Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wincompatible-library-redeclaration #1856

Closed
nickdesaulniers opened this issue May 30, 2023 · 2 comments
Closed

-Wincompatible-library-redeclaration #1856

nickdesaulniers opened this issue May 30, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@nickdesaulniers
Copy link
Member

Testing ARCH=arm allyesconfig on stable 6.3 and linux-next with ToT LLVM, after running into #1855 I then hit:

CC      scripts/mod/devicetable-offsets.s
In file included from scripts/mod/devicetable-offsets.c:3:
In file included from ./include/linux/mod_devicetable.h:14:
In file included from ./include/linux/uuid.h:11:
In file included from ./include/linux/string.h:20:
./arch/arm/include/asm/string.h:20:15: error: incompatible redeclaration of library function 'memcpy' [-Werror,-Wincompatible-library-redeclaration]
extern void * memcpy(void *, const void *, __kernel_size_t);
              ^
./arch/arm/include/asm/string.h:20:15: note: 'memcpy' is a builtin with type 'void *(void *, const void *, unsigned long)'
./arch/arm/include/asm/string.h:24:15: error: incompatible redeclaration of library function 'memmove' [-Werror,-Wincompatible-library-redeclaration]
extern void * memmove(void *, const void *, __kernel_size_t);
              ^
./arch/arm/include/asm/string.h:24:15: note: 'memmove' is a builtin with type 'void *(void *, const void *, unsigned long)'
./arch/arm/include/asm/string.h:28:15: error: incompatible redeclaration of library function 'memchr' [-Werror,-Wincompatible-library-redeclaration]
extern void * memchr(const void *, int, __kernel_size_t);
              ^
./arch/arm/include/asm/string.h:28:15: note: 'memchr' is a builtin with type 'void *(const void *, int, unsigned long)'
./arch/arm/include/asm/string.h:31:15: error: incompatible redeclaration of library function 'memset' [-Werror,-Wincompatible-library-redeclaration]
extern void * memset(void *, int, __kernel_size_t);
              ^
./arch/arm/include/asm/string.h:31:15: note: 'memset' is a builtin with type 'void *(void *, int, unsigned long)'
In file included from scripts/mod/devicetable-offsets.c:3:
In file included from ./include/linux/mod_devicetable.h:14:
In file included from ./include/linux/uuid.h:11:
./include/linux/string.h:26:15: error: incompatible redeclaration of library function 'strncpy' [-Werror,-Wincompatible-library-redeclaration]
extern char * strncpy(char *,const char *, __kernel_size_t);
              ^
./include/linux/string.h:26:15: note: 'strncpy' is a builtin with type 'char *(char *, const char *, unsigned long)'
./include/linux/string.h:29:8: error: incompatible redeclaration of library function 'strlcpy' [-Werror,-Wincompatible-library-redeclaration]
size_t strlcpy(char *, const char *, size_t);
       ^
./include/linux/string.h:29:8: note: 'strlcpy' is a builtin with type 'unsigned long (char *, const char *, unsigned long)'
./include/linux/string.h:42:15: error: incompatible redeclaration of library function 'strncat' [-Werror,-Wincompatible-library-redeclaration]
extern char * strncat(char *, const char *, __kernel_size_t);
              ^
./include/linux/string.h:42:15: note: 'strncat' is a builtin with type 'char *(char *, const char *, unsigned long)'
./include/linux/string.h:45:15: error: incompatible redeclaration of library function 'strlcat' [-Werror,-Wincompatible-library-redeclaration]
extern size_t strlcat(char *, const char *, __kernel_size_t);
              ^
./include/linux/string.h:45:15: note: 'strlcat' is a builtin with type 'unsigned long (char *, const char *, unsigned long)'
./include/linux/string.h:51:12: error: incompatible redeclaration of library function 'strncmp' [-Werror,-Wincompatible-library-redeclaration]
extern int strncmp(const char *,const char *,__kernel_size_t);
           ^
./include/linux/string.h:51:12: note: 'strncmp' is a builtin with type 'int (const char *, const char *, unsigned long)'
./include/linux/string.h:57:12: error: incompatible redeclaration of library function 'strncasecmp' [-Werror,-Wincompatible-library-redeclaration]
extern int strncasecmp(const char *s1, const char *s2, size_t n);
           ^
./include/linux/string.h:57:12: note: 'strncasecmp' is a builtin with type 'int (const char *, const char *, unsigned long)'
./include/linux/string.h:88:24: error: incompatible redeclaration of library function 'strlen' [-Werror,-Wincompatible-library-redeclaration]
extern __kernel_size_t strlen(const char *);
                       ^
./include/linux/string.h:88:24: note: 'strlen' is a builtin with type 'unsigned long (const char *)'
./include/linux/string.h:100:24: error: incompatible redeclaration of library function 'strspn' [-Werror,-Wincompatible-library-redeclaration]
extern __kernel_size_t strspn(const char *,const char *);
                       ^
./include/linux/string.h:100:24: note: 'strspn' is a builtin with type 'unsigned long (const char *, const char *)'
./include/linux/string.h:103:24: error: incompatible redeclaration of library function 'strcspn' [-Werror,-Wincompatible-library-redeclaration]
extern __kernel_size_t strcspn(const char *,const char *);
                       ^
./include/linux/string.h:103:24: note: 'strcspn' is a builtin with type 'unsigned long (const char *, const char *)'
./include/linux/string.h:156:12: error: incompatible redeclaration of library function 'memcmp' [-Werror,-Wincompatible-library-redeclaration]
extern int memcmp(const void *,const void *,__kernel_size_t);
           ^
./include/linux/string.h:156:12: note: 'memcmp' is a builtin with type 'int (const void *, const void *, unsigned long)'
./include/linux/string.h:159:12: error: incompatible redeclaration of library function 'bcmp' [-Werror,-Wincompatible-library-redeclaration]
extern int bcmp(const void *,const void *,__kernel_size_t);
           ^
./include/linux/string.h:159:12: note: 'bcmp' is a builtin with type 'int (const void *, const void *, unsigned long)'
15 errors generated.
@nathanchance
Copy link
Member

I cannot reproduce this or #1857 with LLVM at llvm/llvm-project@99a1aee + D151741 and Linux 6.3.5:

$ curl -LSs https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.3.5.tar.xz | tar -xJf -

$ make -C linux-6.3.5 -skj"$(nproc)" ARCH=arm LLVM=1 O=build mrproper allyesconfig all
...

$ echo $status
0

@nickdesaulniers
Copy link
Member Author

Strange, https://reviews.llvm.org/D151741 does indeed prevent these further warnings.

@nickdesaulniers nickdesaulniers added duplicate This issue or pull request already exists and removed [BUG] Untriaged Something isn't working labels May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants