diff options
| author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2017-09-26 09:20:52 +0200 |
|---|---|---|
| committer | Ross Burton <ross.burton@intel.com> | 2017-09-26 14:35:33 +0100 |
| commit | 4bed302b143c4d869f83fcc34b0c1ad1dd143c2d (patch) | |
| tree | 189cda273d074d11f461d9788c1962b7620b5595 /recipes-devtools | |
| parent | 9b1d684d72f5a7d9b231cadbcaed4de7b0d73b21 (diff) | |
| download | meta-gplv2-4bed302b143c4d869f83fcc34b0c1ad1dd143c2d.tar.gz | |
elfutils: Make it build with GCC 7 and compile time hardening enabled
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'recipes-devtools')
3 files changed, 77 insertions, 0 deletions
diff --git a/recipes-devtools/elfutils/elfutils-0.148/0001-Make-it-compile-with-GCC-7.patch b/recipes-devtools/elfutils/elfutils-0.148/0001-Make-it-compile-with-GCC-7.patch new file mode 100644 index 0000000..a43508f --- /dev/null +++ b/recipes-devtools/elfutils/elfutils-0.148/0001-Make-it-compile-with-GCC-7.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 9529f012a1cfdae36aedeab8ccd790c875ae7f73 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Peter Kjellerstedt <pkj@axis.com> | ||
| 3 | Date: Sat, 16 Sep 2017 15:09:23 +0200 | ||
| 4 | Subject: [PATCH 1/2] Make it compile with GCC 7 | ||
| 5 | |||
| 6 | This avoids the following errors: | ||
| 7 | |||
| 8 | src/readelf.c: In function 'register_info': | ||
| 9 | src/readelf.c:4481:30: warning: 'sizeof' on array function parameter | ||
| 10 | 'name' will return size of 'char *' [-Wsizeof-array-argument] | ||
| 11 | snprintf (name, sizeof name, "reg%u", loc->regno); | ||
| 12 | ^~~~ | ||
| 13 | src/readelf.c:4472:14: note: declared here | ||
| 14 | char name[REGNAMESZ], int *bits, int *type) | ||
| 15 | ^~~~ | ||
| 16 | rc/readelf.c:4481:30: warning: argument to 'sizeof' in 'snprintf' call | ||
| 17 | is the same expression as the destination; did you mean to provide an | ||
| 18 | explicit length? [-Wsizeof-pointer-memaccess] | ||
| 19 | snprintf (name, sizeof name, "reg%u", loc->regno); | ||
| 20 | ^~~~ | ||
| 21 | |||
| 22 | Upstream-Status: Inappropriate [legacy version] | ||
| 23 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> | ||
| 24 | --- | ||
| 25 | src/readelf.c | 2 +- | ||
| 26 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 27 | |||
| 28 | diff --git a/src/readelf.c b/src/readelf.c | ||
| 29 | index bf622a6..ba0607b 100644 | ||
| 30 | --- a/src/readelf.c | ||
| 31 | +++ b/src/readelf.c | ||
| 32 | @@ -4478,7 +4478,7 @@ register_info (Ebl *ebl, unsigned int regno, const Ebl_Register_Location *loc, | ||
| 33 | bits ?: &ignore, type ?: &ignore); | ||
| 34 | if (n <= 0) | ||
| 35 | { | ||
| 36 | - snprintf (name, sizeof name, "reg%u", loc->regno); | ||
| 37 | + snprintf (name, REGNAMESZ, "reg%u", loc->regno); | ||
| 38 | if (bits != NULL) | ||
| 39 | *bits = loc->bits; | ||
| 40 | if (type != NULL) | ||
| 41 | -- | ||
| 42 | 2.12.0 | ||
| 43 | |||
diff --git a/recipes-devtools/elfutils/elfutils-0.148/0002-Make-it-build-with-GCC-7-and-compile-time-hardening-.patch b/recipes-devtools/elfutils/elfutils-0.148/0002-Make-it-build-with-GCC-7-and-compile-time-hardening-.patch new file mode 100644 index 0000000..68d14b6 --- /dev/null +++ b/recipes-devtools/elfutils/elfutils-0.148/0002-Make-it-build-with-GCC-7-and-compile-time-hardening-.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From 5dcd8e331af448e3adcb9ed15a38762a912a8267 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Peter Kjellerstedt <pkj@axis.com> | ||
| 3 | Date: Sat, 16 Sep 2017 15:12:37 +0200 | ||
| 4 | Subject: [PATCH 2/2] Make it build with GCC 7 and compile time hardening | ||
| 5 | enabled | ||
| 6 | |||
| 7 | This avoids the following error: | ||
| 8 | |||
| 9 | cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security] | ||
| 10 | |||
| 11 | Upstream-Status: Inappropriate [legacy version] | ||
| 12 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> | ||
| 13 | --- | ||
| 14 | config/eu.am | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/config/eu.am b/config/eu.am | ||
| 18 | index 8066d7f..7de66b0 100644 | ||
| 19 | --- a/config/eu.am | ||
| 20 | +++ b/config/eu.am | ||
| 21 | @@ -33,7 +33,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. | ||
| 22 | AM_CFLAGS = -std=gnu99 -Wall -Wshadow \ | ||
| 23 | $(if $($(*F)_no_Werror),,-Werror) \ | ||
| 24 | $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \ | ||
| 25 | - $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \ | ||
| 26 | + $(if $($(*F)_no_Wformat),-Wno-format -Wno-format-security,-Wformat=2) \ | ||
| 27 | $($(*F)_CFLAGS) | ||
| 28 | |||
| 29 | if MUDFLAP | ||
| 30 | -- | ||
| 31 | 2.12.0 | ||
| 32 | |||
diff --git a/recipes-devtools/elfutils/elfutils_0.148.bb b/recipes-devtools/elfutils/elfutils_0.148.bb index 29d109a..892a523 100644 --- a/recipes-devtools/elfutils/elfutils_0.148.bb +++ b/recipes-devtools/elfutils/elfutils_0.148.bb | |||
| @@ -37,6 +37,8 @@ SRC_URI += "\ | |||
| 37 | file://gcc6.patch \ | 37 | file://gcc6.patch \ |
| 38 | file://0001-Fix-fallthrough-warnings.patch \ | 38 | file://0001-Fix-fallthrough-warnings.patch \ |
| 39 | file://0002-Fix-printf-overflow-warnings.patch \ | 39 | file://0002-Fix-printf-overflow-warnings.patch \ |
| 40 | file://0001-Make-it-compile-with-GCC-7.patch \ | ||
| 41 | file://0002-Make-it-build-with-GCC-7-and-compile-time-hardening-.patch \ | ||
| 40 | " | 42 | " |
| 41 | # Only apply when building uclibc based target recipe | 43 | # Only apply when building uclibc based target recipe |
| 42 | SRC_URI_append_libc-uclibc = " file://uclibc-support-for-elfutils-0.148.patch" | 44 | SRC_URI_append_libc-uclibc = " file://uclibc-support-for-elfutils-0.148.patch" |
