summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-06-18 18:05:14 -0700
committerJoe MacDonald <joe_macdonald@mentor.com>2017-06-28 10:29:07 -0400
commitcf9a6a2bbc85649a589c432330ad8308ab9a6ce6 (patch)
tree05f9cd6910c1a825612df1ea0cce890eb92aa4f2
parent487481d48f8fd6c9cce77711e92d3bc9786a8fe1 (diff)
downloadmeta-openembedded-cf9a6a2bbc85649a589c432330ad8308ab9a6ce6.tar.gz
linux-atm: Fix build with hardening flags
Port to build on musl while here Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch34
-rw-r--r--meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch30
-rw-r--r--meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch37
-rw-r--r--meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb3
4 files changed, 104 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch b/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch
new file mode 100644
index 000000000..87e7dc3c6
--- /dev/null
+++ b/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch
@@ -0,0 +1,34 @@
1From b83fd54584fabd5d24f6645b4a3cf345c9d2020d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 17 Jun 2017 16:11:59 -0700
4Subject: [PATCH 1/3] ttcp: Add printf format string
5
6Fixes compiler warnings when format security is enabled
7
8| ../../../linux-atm-2.5.2/src/test/ttcp.c:666:21: error: format not a string literal and no format arguments [-Werror=format-security]
9| fprintf(stderr, Usage);
10| ^~~~~
11
12Upstream-Status: Pending
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 src/test/ttcp.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/src/test/ttcp.c b/src/test/ttcp.c
20index acb9185..337cee5 100644
21--- a/src/test/ttcp.c
22+++ b/src/test/ttcp.c
23@@ -663,7 +663,7 @@ int no_check = 0;
24 exit(0);
25
26 usage:
27- fprintf(stderr, Usage);
28+ fprintf(stderr, "%s", Usage);
29 exit(1);
30 }
31
32--
332.13.1
34
diff --git a/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch b/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch
new file mode 100644
index 000000000..ce061231c
--- /dev/null
+++ b/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch
@@ -0,0 +1,30 @@
1From 27fa80dc8045e71c30dd2abea835206d5c8f6c71 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 17 Jun 2017 16:18:56 -0700
4Subject: [PATCH 2/3] sigd: Replace on_exit() API with atexit()
5
6on_exit is not universally available
7
8Upstream-Status: Pending
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/sigd/atmsigd.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/src/sigd/atmsigd.c b/src/sigd/atmsigd.c
16index 52e41c7..b766606 100644
17--- a/src/sigd/atmsigd.c
18+++ b/src/sigd/atmsigd.c
19@@ -517,7 +517,7 @@ int main(int argc,char **argv)
20 exit(0);
21 }
22 }
23- (void) on_exit(trace_on_exit,NULL);
24+ atexit(trace_on_exit);
25 poll_loop();
26 close_all();
27 for (sig = entities; sig; sig = sig->next) stop_saal(&sig->saal);
28--
292.13.1
30
diff --git a/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch b/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch
new file mode 100644
index 000000000..0302286dc
--- /dev/null
+++ b/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch
@@ -0,0 +1,37 @@
1From fe954b2fb17d813aaab3e926cee76144314a115a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 17 Jun 2017 16:22:55 -0700
4Subject: [PATCH 3/3] mpoad: Drop old hack to compile with very old glibc
5
6Use poll.h instead of sys/poll.h
7
8Upstream-Status: Pending
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/mpoad/io.c | 9 +--------
13 1 file changed, 1 insertion(+), 8 deletions(-)
14
15diff --git a/src/mpoad/io.c b/src/mpoad/io.c
16index 69900c2..8d1433f 100644
17--- a/src/mpoad/io.c
18+++ b/src/mpoad/io.c
19@@ -10,14 +10,7 @@
20 #include <errno.h>
21 #include <sys/ioctl.h>
22 #include <sys/param.h> /* for OPEN_MAX */
23-#if __GLIBC__ >= 2
24-#include <sys/poll.h>
25-#else /* ugly hack to make it compile on RH 4.2 - WA */
26-#include <syscall.h>
27-#include <linux/poll.h>
28-#define SYS_poll 168
29-_syscall3(int,poll,struct pollfd *,ufds,unsigned int,nfds,int,timeout);
30-#endif
31+#include <poll.h>
32 #include <atm.h>
33 #include <linux/types.h>
34 #include <linux/atmioc.h>
35--
362.13.1
37
diff --git a/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb b/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb
index 6ab8b07d0..9fce4fba6 100644
--- a/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb
+++ b/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb
@@ -11,6 +11,9 @@ SRC_URI = "http://nchc.dl.sourceforge.net/project/${BPN}/${BPN}/${PV}/${BPN}-${P
11 file://link-with-ldflags.patch \ 11 file://link-with-ldflags.patch \
12 file://install-from-buildir.patch \ 12 file://install-from-buildir.patch \
13 file://0001-fix-compile-error-with-linux-kernel-v4.8.patch \ 13 file://0001-fix-compile-error-with-linux-kernel-v4.8.patch \
14 file://0001-ttcp-Add-printf-format-string.patch \
15 file://0002-sigd-Replace-on_exit-API-with-atexit.patch \
16 file://0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch \
14" 17"
15 18
16SRC_URI[md5sum] = "d49499368c3cf15f73a05d9bce8824a8" 19SRC_URI[md5sum] = "d49499368c3cf15f73a05d9bce8824a8"