
From: Simon Glass sjg@chromium.org Date: Tue, 2 Nov 2021 08:56:50 -0600
Hi Takahiro,
- can we just build the tool always?
This is one of my questions. Why do you want to do so while there are bunch of tools that are not always built.
Because I think all tools should be built always. It is fine if that happens due to CONFIG options but we should try to avoid making it complicated.
Well, unless this patchset fixes things, we can't, because mkeficapsule doesn't build on OpenBSD. I tried looking into it, but I can't figure out how this is even supposed to compile as a host tool:
In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:15:24: error: conflicting types for 'strspn' extern __kernel_size_t strspn(const char *,const char *); ^ /usr/include/string.h:88:9: note: previous declaration is here size_t strspn(const char *, const char *); ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: In file included from include/linux/string.h:21: ./arch/arm/include/asm/string.h:20:15: error: conflicting types for 'memcpy' extern void * memcpy(void *, const void *, __kernel_size_t); ^ /usr/include/string.h:65:7: note: previous declaration is here void *memcpy(void *__restrict, const void *__restrict, size_t) ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: In file included from include/linux/string.h:21: ./arch/arm/include/asm/string.h:27:15: error: conflicting types for 'memmove' extern void * memmove(void *, const void *, __kernel_size_t); ^ /usr/include/string.h:68:7: note: previous declaration is here void *memmove(void *, const void *, size_t) ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: In file included from include/linux/string.h:21: ./arch/arm/include/asm/string.h:30:15: error: conflicting types for 'memchr' extern void * memchr(const void *, int, __kernel_size_t); ^ /usr/include/string.h:63:7: note: previous declaration is here void *memchr(const void *, int, size_t); ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: In file included from include/linux/string.h:21: ./arch/arm/include/asm/string.h:36:15: error: conflicting types for 'memset' extern void * memset(void *, int, __kernel_size_t); ^ /usr/include/string.h:71:7: note: previous declaration is here void *memset(void *, int, size_t) ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:27:15: error: conflicting types for 'strncpy' extern char * strncpy(char *,const char *, __kernel_size_t); ^ /usr/include/string.h:84:7: note: previous declaration is here char *strncpy(char *__restrict, const char *__restrict, size_t) ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:36:15: error: conflicting types for 'strncat' extern char * strncat(char *, const char *, __kernel_size_t); ^ /usr/include/string.h:81:7: note: previous declaration is here char *strncat(char *__restrict, const char *__restrict, size_t) ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:45:12: error: conflicting types for 'strncmp' extern int strncmp(const char *,const char *,__kernel_size_t); ^ /usr/include/string.h:83:6: note: previous declaration is here int strncmp(const char *, const char *, size_t); ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:51:12: error: conflicting types for 'strncasecmp' extern int strncasecmp(const char *s1, const char *s2, __kernel_size_t len); ^ /usr/include/strings.h:75:6: note: previous declaration is here int strncasecmp(const char *, const char *, size_t); ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:77:24: error: conflicting types for 'strlen' extern __kernel_size_t strlen(const char *); ^ /usr/include/string.h:80:9: note: previous declaration is here size_t strlen(const char *); ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:80:24: error: conflicting types for 'strnlen' extern __kernel_size_t strnlen(const char *,__kernel_size_t); ^ /usr/include/string.h:115:9: note: previous declaration is here size_t strnlen(const char *, size_t); ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:111:15: error: conflicting types for 'memset' extern void * memset(void *,int,__kernel_size_t); ^ /usr/include/string.h:71:7: note: previous declaration is here void *memset(void *, int, size_t) ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:114:15: error: conflicting types for 'memcpy' extern void * memcpy(void *,const void *,__kernel_size_t); ^ /usr/include/string.h:65:7: note: previous declaration is here void *memcpy(void *__restrict, const void *__restrict, size_t) ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:117:15: error: conflicting types for 'memmove' extern void * memmove(void *,const void *,__kernel_size_t); ^ /usr/include/string.h:68:7: note: previous declaration is here void *memmove(void *, const void *, size_t) ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:123:12: error: conflicting types for 'memcmp' extern int memcmp(const void *,const void *,__kernel_size_t); ^ /usr/include/string.h:64:6: note: previous declaration is here int memcmp(const void *, const void *, size_t); ^ In file included from tools/mkeficapsule.c:8: In file included from include/malloc.h:369: include/linux/string.h:126:15: error: conflicting types for 'memchr' extern void * memchr(const void *,int,__kernel_size_t); ^ /usr/include/string.h:63:7: note: previous declaration is here void *memchr(const void *, int, size_t); ^ tools/mkeficapsule.c:25:9: warning: 'aligned_u64' macro redefined [-Wmacro-redefined] #define aligned_u64 __aligned_u64 ^ include/linux/types.h:118:9: note: previous definition is here #define aligned_u64 __u64 __aligned(8) ^ In file included from tools/mkeficapsule.c:32: In file included from include/efi_api.h:20: In file included from include/charset.h:11: In file included from include/linux/kernel.h:5: In file included from include/linux/printk.h:4: include/log.h:382:24: error: expression is not an integer constant expression LOGRECF_FORCE_DEBUG = BIT(0), ^~~~~~ include/log.h:384:18: error: expression is not an integer constant expression LOGRECF_CONT = BIT(1), ^~~~~~ include/log.h:421:18: error: expression is not an integer constant expression LOGDF_ENABLE = BIT(0), /* Device is enabled */ ^~~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=] 1 warning and 20 errors generated.