aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-04-05 13:31:17 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-04-24 11:00:52 +0200
commit2ba483aecc7e4430c9dd6491faf8881427332f43 (patch)
tree3dd7d3537764bb01b19065b82a3175be5c367a8f /meta-oe/recipes-support
parent47604c0409caedabc47f7bc7fe5be5c112b80c9c (diff)
downloadmeta-openembedded-2ba483aecc7e4430c9dd6491faf8881427332f43.tar.gz
pngcheck: Fix cross build and format string errors
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support')
-rw-r--r--meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch60
-rw-r--r--meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch36
-rw-r--r--meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch40
-rw-r--r--meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb12
4 files changed, 145 insertions, 3 deletions
diff --git a/meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch b/meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch
new file mode 100644
index 0000000000..2d0ea0252c
--- /dev/null
+++ b/meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch
@@ -0,0 +1,60 @@
+From 6245f18091cad11520c159248c1cf7a84f12857c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Apr 2017 13:15:43 -0700
+Subject: [PATCH] make: Respect variables from environement
+
+link with shared zlib
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.unx | 18 ++++++++----------
+ 1 file changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.unx b/Makefile.unx
+index 772da46..4ae7061 100644
+--- a/Makefile.unx
++++ b/Makefile.unx
+@@ -24,18 +24,16 @@ ZINC = -I$(ZPATH)
+ ZLIB = $(ZPATH)/libz.a
+
+ INCS = $(ZINC)
+-LIBS = $(ZLIB)
++LIBS = -lz
+
+-CC = gcc
+-LD = gcc
+-RM = rm
+-CFLAGS = -O -Wall $(INCS) -DUSE_ZLIB
++CC ?= gcc
++LD ?= gcc
++RM ?= rm
++CFLAGS += -O -Wall $(INCS) -DUSE_ZLIB
+ # [note that -Wall is a gcc-specific compilation flag ("all warnings on")]
+ O = .o
+ E =
+
+-LDFLAGS =
+-
+ PROG = pngcheck
+ PROG2 = pngsplit
+ PROG3 = png-fix-IDAT-windowsize
+@@ -57,13 +55,13 @@ EXES = $(PROG)$(E) $(PROG2)$(E) $(PROG3)$(E)
+ all: $(EXES)
+
+ $(PROG)$(E): $(PROG).c
+- $(CC) $(CFLAGS) -o $@ $(PROG).c $(LIBS)
++ $(CC) $(CFLAGS) -o $@ $(PROG).c $(LDFLAGS) $(LIBS)
+
+ $(PROG2)$(E): gpl/$(PROG2).c
+- $(CC) $(CFLAGS) -o $@ gpl/$(PROG2).c $(LIBS)
++ $(CC) $(CFLAGS) -o $@ gpl/$(PROG2).c $(LDFLAGS) $(LIBS)
+
+ $(PROG3)$(E): gpl/$(PROG3).c
+- $(CC) $(CFLAGS) -o $@ gpl/$(PROG3).c $(LIBS)
++ $(CC) $(CFLAGS) -o $@ gpl/$(PROG3).c $(LDFLAGS) $(LIBS)
+
+
+ # maintenance ---------------------------------------------------------------
+--
+2.12.2
+
diff --git a/meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch b/meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch
new file mode 100644
index 0000000000..6d4465fbed
--- /dev/null
+++ b/meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch
@@ -0,0 +1,36 @@
+From d4d8257953bd1e7be167aed24c0578362cc5f675 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Apr 2017 13:12:30 -0700
+Subject: [PATCH 1/2] png-fix-IDAT-windowsize: Fix format string errors in
+ fprintf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gpl/png-fix-IDAT-windowsize.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gpl/png-fix-IDAT-windowsize.c b/gpl/png-fix-IDAT-windowsize.c
+index 6d4ef9c..d212017 100644
+--- a/gpl/png-fix-IDAT-windowsize.c
++++ b/gpl/png-fix-IDAT-windowsize.c
+@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
+ fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n",
+ ZLIB_VERSION, zlib_version);
+ fprintf(stderr, "\n");
+- fprintf(stderr, png_fix_IDAT_windowsize_usage);
++ fprintf(stderr, "%s", png_fix_IDAT_windowsize_usage);
+ fflush(stderr);
+ return 1;
+ }
+@@ -143,7 +143,7 @@ int main(int argc, char *argv[])
+ fflush(stdout);
+
+ if ( argn == argc ) {
+- fprintf(stderr, png_fix_IDAT_windowsize_usage);
++ fprintf(stderr, "%s", png_fix_IDAT_windowsize_usage);
+ fflush(stderr);
+ return 5;
+ } else {
+--
+2.12.2
+
diff --git a/meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch b/meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch
new file mode 100644
index 0000000000..f2c86689ec
--- /dev/null
+++ b/meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch
@@ -0,0 +1,40 @@
+From: Jari Aalto <jari.aalto@cante.net>
+Subject: Correct fomat strings fro hardened build flags
+
+---
+ gpl/pngsplit.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/gpl/pngsplit.c
++++ b/gpl/pngsplit.c
+@@ -141,8 +141,8 @@
+ 0 == strncmp( argv[argn], "-quiet", 2 ) )
+ verbose = 0;
+ else {
+- fprintf(stderr, pngsplit_hdr);
+- fprintf(stderr, pngsplit_usage);
++ fprintf(stderr, "%s", pngsplit_hdr);
++ fprintf(stderr, "%s", pngsplit_usage);
+ fflush(stderr);
+ return 1;
+ }
+@@ -150,8 +150,8 @@
+ }
+
+ if ( argn == argc ) {
+- fprintf(stderr, pngsplit_hdr);
+- fprintf(stderr, pngsplit_usage);
++ fprintf(stderr, "%s", pngsplit_hdr);
++ fprintf(stderr, "%s", pngsplit_usage);
+ fflush(stderr);
+ return 5;
+ } else {
+@@ -162,7 +162,7 @@
+
+ /*============================= MAIN LOOP =============================*/
+
+- fprintf(stdout, pngsplit_hdr);
++ fprintf(stdout, "%s", pngsplit_hdr);
+ fflush(stdout);
+
+ while (argn <= argc) {
diff --git a/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb b/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb
index 6d0dfff930..9f617ecda5 100644
--- a/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb
+++ b/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb
@@ -4,15 +4,21 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://gpl/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
DEPENDS = "zlib libpng"
-SRC_URI = "${SOURCEFORGE_MIRROR}/project/png-mng/${BPN}/${PV}/${BPN}-${PV}.tar.gz"
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/png-mng/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+ file://10-pngsplit-format-strings.patch \
+ file://0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch \
+ file://0001-make-Respect-variables-from-environement.patch \
+ "
SRC_URI[md5sum] = "980bd6d9a3830fdce746d7fe3c9166ee"
SRC_URI[sha256sum] = "77f0a039ac64df55fbd06af6f872fdbad4f639d009bbb5cd5cbe4db25690f35f"
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+CFLAGS += "-DUSE_ZLIB"
+
+EXTRA_OEMAKE = "-f ${S}/Makefile.unx"
do_compile() {
- oe_runmake -f Makefile.unx INCS=-I${STAGING_DIR_HOST}${incdir} LIBS='${STAGING_DIR_HOST}${libdir}/libz.a ${LDFLAGS}'
+ oe_runmake
}
do_install() {