diff options
author | Joel Stanley <joel@jms.id.au> | 2021-07-29 17:24:38 +0930 |
---|---|---|
committer | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2021-08-04 15:16:08 +0530 |
commit | 8246de86360666d81e71785c1c8be03a72563d17 (patch) | |
tree | f3c4f5177453051b5f5873413bfd822f5139650d /Makefile.main | |
parent | fcc828cdc9616457a643389387f0ca9fba12b867 (diff) | |
download | skiboot-8246de86360666d81e71785c1c8be03a72563d17.zip skiboot-8246de86360666d81e71785c1c8be03a72563d17.tar.gz skiboot-8246de86360666d81e71785c1c8be03a72563d17.tar.bz2 |
Makefile: Avoid errors with GCC 11
GCC's string and memory functions blow up as the compiler thinks the
objects have no size:
core/opal-dump.c: In function ‘opal_mpipl_update’:
libc/include/string.h:34:16: warning: ‘__builtin_memset’ offset [0, 32767] is out of the bounds [0, 0] [-Warray-bounds]
34 | #define memset __builtin_memset
core/opal-dump.c:333:17: note: in expansion of macro ‘memset’
333 | memset((void *)MDRT_TABLE_BASE, 0, MDRT_TABLE_SIZE);
| ^~~~~~
core/opal-dump.c: In function ‘opal_mpipl_init’:
libc/include/string.h:34:16: warning: ‘__builtin_memset’ offset [0, 1023] is out of the bounds [0, 0] [-Warray-bounds]
34 | #define memset __builtin_memset
core/opal-dump.c:565:9: note: in expansion of macro ‘memset’
565 | memset(mdst_base, 0, MDST_TABLE_SIZE);
| ^~~~~~
libc/include/string.h:34:16: warning: ‘__builtin_memset’ offset [0, 1023] is out of the bounds [0, 0] [-Warray-bounds]
34 | #define memset __builtin_memset
core/opal-dump.c:567:9: note: in expansion of macro ‘memset’
567 | memset(mddt_base, 0, MDDT_TABLE_SIZE);
| ^~~~~~
In function ‘HDIF_check’,
inlined from ‘fixup_spira’ at hdata/spira.c:1679:7,
inlined from ‘parse_hdat’ at hdata/spira.c:1732:2:
libc/include/string.h:38:16: warning: ‘__builtin_memcmp’ specified bound 6 exceeds source size 0 [-Wstringop-overread]
38 | #define memcmp __builtin_memcmp
hdata/hdif.h:71:17: note: in expansion of macro ‘memcmp’
71 | memcmp(hdr->id, id, sizeof(hdr->id)) == 0;
| ^~~~~~
This turns the errors into warnings so the build can complete.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Diffstat (limited to 'Makefile.main')
-rw-r--r-- | Makefile.main | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Makefile.main b/Makefile.main index 189b4ae..c8a63e8 100644 --- a/Makefile.main +++ b/Makefile.main @@ -163,6 +163,8 @@ CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \ $(call try-cflag,$(CC),-Wno-error=suggest-attribute=const) \ $(call try-cflag,$(CC),-Wno-error=suggest-attribute=noreturn) \ $(call try-cflag,$(CC),-Wstack-usage=1024) \ + $(call try-cflag,$(CC),-Wno-error=array-bounds) \ + $(call try-cflag,$(CC),-Wno-error=stringop-overread) \ $(call try-cflag,$(CC),-Wno-error=address-of-packed-member) CFLAGS += $(CWARNS) $(OPTS) $(DBG) |