summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/elfutils/elfutils-0.148
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2017-09-26 09:20:52 +0200
committerRoss Burton <ross.burton@intel.com>2017-09-26 14:35:33 +0100
commit4bed302b143c4d869f83fcc34b0c1ad1dd143c2d (patch)
tree189cda273d074d11f461d9788c1962b7620b5595 /recipes-devtools/elfutils/elfutils-0.148
parent9b1d684d72f5a7d9b231cadbcaed4de7b0d73b21 (diff)
downloadmeta-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/elfutils/elfutils-0.148')
-rw-r--r--recipes-devtools/elfutils/elfutils-0.148/0001-Make-it-compile-with-GCC-7.patch43
-rw-r--r--recipes-devtools/elfutils/elfutils-0.148/0002-Make-it-build-with-GCC-7-and-compile-time-hardening-.patch32
2 files changed, 75 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 @@
1From 9529f012a1cfdae36aedeab8ccd790c875ae7f73 Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Sat, 16 Sep 2017 15:09:23 +0200
4Subject: [PATCH 1/2] Make it compile with GCC 7
5
6This 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
22Upstream-Status: Inappropriate [legacy version]
23Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
24---
25 src/readelf.c | 2 +-
26 1 file changed, 1 insertion(+), 1 deletion(-)
27
28diff --git a/src/readelf.c b/src/readelf.c
29index 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--
422.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 @@
1From 5dcd8e331af448e3adcb9ed15a38762a912a8267 Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Sat, 16 Sep 2017 15:12:37 +0200
4Subject: [PATCH 2/2] Make it build with GCC 7 and compile time hardening
5 enabled
6
7This avoids the following error:
8
9cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
10
11Upstream-Status: Inappropriate [legacy version]
12Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
13---
14 config/eu.am | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/config/eu.am b/config/eu.am
18index 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--
312.12.0
32