From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-oe][PATCH 13/14] iptraf: Fix build with clang
Date: Mon, 6 Mar 2017 23:13:48 -0800 [thread overview]
Message-ID: <20170307071349.16444-13-raj.khem@gmail.com> (raw)
In-Reply-To: <20170307071349.16444-1-raj.khem@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../iptraf/iptraf/format_string.patch | 31 +++++++++++++++++++
.../recipes-devtools/iptraf/iptraf/ldopts.patch | 35 ++++++++++++++++++++++
meta-oe/recipes-devtools/iptraf/iptraf_3.0.0.bb | 7 +++--
3 files changed, 71 insertions(+), 2 deletions(-)
create mode 100644 meta-oe/recipes-devtools/iptraf/iptraf/format_string.patch
create mode 100644 meta-oe/recipes-devtools/iptraf/iptraf/ldopts.patch
diff --git a/meta-oe/recipes-devtools/iptraf/iptraf/format_string.patch b/meta-oe/recipes-devtools/iptraf/iptraf/format_string.patch
new file mode 100644
index 000000000..5f96f0f4c
--- /dev/null
+++ b/meta-oe/recipes-devtools/iptraf/iptraf/format_string.patch
@@ -0,0 +1,31 @@
+Index: iptraf-3.0.0/src/othptab.c
+===================================================================
+--- iptraf-3.0.0.orig/src/othptab.c
++++ iptraf-3.0.0/src/othptab.c
+@@ -335,7 +335,7 @@ void printothpentry(struct othptable *ta
+ break;
+ }
+
+- sprintf(scratchpad, inet_ntoa(saddr));
++ sprintf(scratchpad, "%s", inet_ntoa(saddr));
+ strcat(msgstring, scratchpad);
+ wattrset(table->othpwin, ARPATTR);
+ break;
+@@ -354,7 +354,7 @@ void printothpentry(struct othptable *ta
+ break;
+ }
+
+- sprintf(scratchpad, rarp_mac_addr);
++ sprintf(scratchpad, "%s", rarp_mac_addr);
+ strcat(msgstring, scratchpad);
+ wattrset(table->othpwin, ARPATTR);
+ break;
+@@ -421,7 +421,7 @@ void printothpentry(struct othptable *ta
+ wattrset(table->othpwin, UNKNIPATTR);
+ protptr = getprotobynumber(entry->protocol);
+ if (protptr != NULL) {
+- sprintf(protname, protptr->p_aliases[0]);
++ sprintf(protname, "%s", protptr->p_aliases[0]);
+ } else {
+ sprintf(protname, "IP protocol");
+ unknown = 1;
diff --git a/meta-oe/recipes-devtools/iptraf/iptraf/ldopts.patch b/meta-oe/recipes-devtools/iptraf/iptraf/ldopts.patch
new file mode 100644
index 000000000..c84a0a0ad
--- /dev/null
+++ b/meta-oe/recipes-devtools/iptraf/iptraf/ldopts.patch
@@ -0,0 +1,35 @@
+Index: iptraf-3.0.0/src/Makefile
+===================================================================
+--- iptraf-3.0.0.orig/src/Makefile
++++ iptraf-3.0.0/src/Makefile
+@@ -5,7 +5,7 @@
+ #
+ # Architecture determination string borrowed from the kernel makefile.
+ #
+-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
++ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+ -e s/arm.*/arm/ -e s/sa110/arm/)
+ PLATFORM = -DPLATFORM=\"$(shell uname -s)/$(ARCH)\"
+ VERNUMBER := $(shell cat version)
+@@ -17,7 +17,7 @@ VERSION = -DVERSION=\"$(VERNUMBER)\"
+ #
+ BINDIR = ../../iptraf-$(VERNUMBER).bin.$(ARCH)
+
+-CC = gcc
++CC = $(CC)
+ LIBS = -L../support -ltextbox -lpanel -lncurses # in this order!
+
+ # comment this one out to omit debug code when done.
+@@ -31,10 +31,10 @@ PROF = #-pg
+ # options to be passed to the compiler. I don't believe they need to be
+ # modified (except for -m486 on non-Intel x86 platforms).
+
+-CFLAGS = -Wall #-O2 #-m486
++CFLAGS ?= -Wall #-O2 #-m486
+ DIRS = -DWORKDIR=\"$(WORKDIR)\" \
+ -DLOGDIR=\"$(LOGDIR)\" -DEXECDIR=\"$(TARGET)\"
+-LDOPTS = #-static
++LDOPTS ?= #-static
+
+ # you may want to change this to point to your ncurses include directory
+ # if the ncurses include files are not in the default location.
diff --git a/meta-oe/recipes-devtools/iptraf/iptraf_3.0.0.bb b/meta-oe/recipes-devtools/iptraf/iptraf_3.0.0.bb
index e7a406fc5..abfab02e0 100644
--- a/meta-oe/recipes-devtools/iptraf/iptraf_3.0.0.bb
+++ b/meta-oe/recipes-devtools/iptraf/iptraf_3.0.0.bb
@@ -12,12 +12,15 @@ DEPENDS = "ncurses"
SRC_URI = " \
ftp://iptraf.seul.org/pub/iptraf/iptraf-3.0.0.tar.gz \
- file://0001-src-Fix-error-in-cross-compile.patch"
+ file://0001-src-Fix-error-in-cross-compile.patch \
+ file://format_string.patch \
+ file://ldopts.patch \
+"
SRC_URI[md5sum] = "377371c28ee3c21a76f7024920649ea8"
SRC_URI[sha256sum] = "9ee433d95573d612539da4b452e6cdcbca6ab6674a88bfbf6eaf12d4902b5163"
RDEPENDS_${PN} = "ncurses"
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+EXTRA_OEMAKE = "-e MAKEFLAGS= LDOPTS='${LDFLAGS}' ARCH='${TARGET_ARCH}'"
do_compile() {
oe_runmake -C src all
--
2.12.0
next prev parent reply other threads:[~2017-03-07 7:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-07 7:13 [meta-oe][PATCH 01/14] t1lib: Fix printf format string errors Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 02/14] fftw: Update to 3.3.6 release Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 03/14] libxml++: Update to 2.40.1 Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 04/14] gpm: Update to use git src uri Khem Raj
2017-03-08 10:16 ` Martin Jansa
2017-03-08 10:18 ` Martin Jansa
2017-03-29 11:05 ` Martin Jansa
2017-03-29 14:06 ` Khem Raj
2017-03-29 14:21 ` Martin Jansa
2017-03-29 14:30 ` Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 05/14] grail: Disable elision warnings for clang Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 06/14] gperftools: Fix build with clang Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 07/14] tbb: Update to 2017 release Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 08/14] irssi: Upgrade to 1.0.1 Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 09/14] a2jmidid: Fix build on aarch64 Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 10/14] log4c: Backport patch to fix security format errors with clang Khem Raj
2017-03-07 7:13 ` [meta-oe][PATCH 11/14] rapidjson: Update to 1.1.0 + git Khem Raj
2017-03-08 10:19 ` Martin Jansa
2017-03-07 7:13 ` [meta-oe][PATCH 12/14] ltrace: Fix build with aarch64 and bump to latest Khem Raj
2017-03-07 7:13 ` Khem Raj [this message]
2017-03-07 7:13 ` [meta-oe][PATCH 14/14] libtorrent, rtorrent: Update to 0.13.6+git Khem Raj
2017-03-08 10:17 ` Martin Jansa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170307071349.16444-13-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox