summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/tftp-hpa
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-08-28 23:32:18 -0700
committerJoe MacDonald <joe_macdonald@mentor.com>2017-09-12 10:55:06 -0400
commitc8850edbbffbc6eb9fbf70a885b65eb33a12468b (patch)
treeee7a235f2dc37bcedf5361a1a5612c5cf78cfa2a /meta-networking/recipes-daemons/tftp-hpa
parent80ab79da53a55ff0a742017957a62596d1cc21c5 (diff)
downloadmeta-openembedded-c8850edbbffbc6eb9fbf70a885b65eb33a12468b.tar.gz
tftp-hpa: Fix PIE build with clang
clang finds a name clash with libc and linker errors out like below tftpd.o: relocation R_ARM_REL32 against external or undefined symbol `__progname@@GLIBC_2.4' can not be used when making a PIE executable; recompile with -fPIC 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>
Diffstat (limited to 'meta-networking/recipes-daemons/tftp-hpa')
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch62
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb1
2 files changed, 63 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch b/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch
new file mode 100644
index 000000000..cead977e2
--- /dev/null
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch
@@ -0,0 +1,62 @@
1From 941038fc05be21202cab7a7a9434097fb55ecbe0 Mon Sep 17 00:00:00 2001
2From: Thorsten Glaser <tg@mirbsd.de>
3Date: Thu, 31 Jul 2014 16:29:41 +0930
4Subject: [PATCH] __progname[] is provided by libc
5
6Rename local variable to tftpd_progname to avoid a clash with glibc
7global symbols and work around Debian bug #519006 (Closes: #564052).
8
9[ hpa: specifically, double-underscore symbols in C are reserved for
10 the implementation, i.e. compiler/libc. ]
11
12Signed-off-by: Ron Lee <ron@debian.org>
13Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14---
15 tftpd/tftpd.c | 10 +++++-----
16 1 file changed, 5 insertions(+), 5 deletions(-)
17
18diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
19index e247b97..5fec7bf 100644
20--- a/tftpd/tftpd.c
21+++ b/tftpd/tftpd.c
22@@ -76,7 +76,7 @@ static int ai_fam = AF_INET;
23 #define TRIES 6 /* Number of attempts to send each packet */
24 #define TIMEOUT_LIMIT ((1 << TRIES)-1)
25
26-const char *__progname;
27+const char *tftpd_progname;
28 static int peer;
29 static unsigned long timeout = TIMEOUT; /* Current timeout value */
30 static unsigned long rexmtval = TIMEOUT; /* Basic timeout value */
31@@ -395,9 +395,9 @@ int main(int argc, char **argv)
32 /* basename() is way too much of a pain from a portability standpoint */
33
34 p = strrchr(argv[0], '/');
35- __progname = (p && p[1]) ? p + 1 : argv[0];
36+ tftpd_progname = (p && p[1]) ? p + 1 : argv[0];
37
38- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
39+ openlog(tftpd_progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
40
41 srand(time(NULL) ^ getpid());
42
43@@ -946,14 +946,14 @@ int main(int argc, char **argv)
44 syslog daemon gets restarted by the time we get here. */
45 if (secure && standalone) {
46 closelog();
47- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
48+ openlog(tftpd_progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
49 }
50
51 #ifdef HAVE_TCPWRAPPERS
52 /* Verify if this was a legal request for us. This has to be
53 done before the chroot, while /etc is still accessible. */
54 request_init(&wrap_request,
55- RQ_DAEMON, __progname,
56+ RQ_DAEMON, tftpd_progname,
57 RQ_FILE, fd,
58 RQ_CLIENT_SIN, &from, RQ_SERVER_SIN, &myaddr, 0);
59 sock_methods(&wrap_request);
60--
612.14.1
62
diff --git a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
index 0a418b97f..fe8a32e7d 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
+++ b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
@@ -26,6 +26,7 @@ SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.t
26 file://add-error-check-for-disk-filled-up.patch \ 26 file://add-error-check-for-disk-filled-up.patch \
27 file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \ 27 file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \
28 file://fix-writing-emtpy-file.patch \ 28 file://fix-writing-emtpy-file.patch \
29 file://0001-__progname-is-provided-by-libc.patch \
29 file://tftpd-hpa.socket \ 30 file://tftpd-hpa.socket \
30 file://tftpd-hpa.service \ 31 file://tftpd-hpa.service \
31" 32"