diff options
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 @@ | |||
1 | From 6245f18091cad11520c159248c1cf7a84f12857c Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 5 Apr 2017 13:15:43 -0700 | ||
4 | Subject: [PATCH] make: Respect variables from environement | ||
5 | |||
6 | link with shared zlib | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | Makefile.unx | 18 ++++++++---------- | ||
11 | 1 file changed, 8 insertions(+), 10 deletions(-) | ||
12 | |||
13 | diff --git a/Makefile.unx b/Makefile.unx | ||
14 | index 772da46..4ae7061 100644 | ||
15 | --- a/Makefile.unx | ||
16 | +++ b/Makefile.unx | ||
17 | @@ -24,18 +24,16 @@ ZINC = -I$(ZPATH) | ||
18 | ZLIB = $(ZPATH)/libz.a | ||
19 | |||
20 | INCS = $(ZINC) | ||
21 | -LIBS = $(ZLIB) | ||
22 | +LIBS = -lz | ||
23 | |||
24 | -CC = gcc | ||
25 | -LD = gcc | ||
26 | -RM = rm | ||
27 | -CFLAGS = -O -Wall $(INCS) -DUSE_ZLIB | ||
28 | +CC ?= gcc | ||
29 | +LD ?= gcc | ||
30 | +RM ?= rm | ||
31 | +CFLAGS += -O -Wall $(INCS) -DUSE_ZLIB | ||
32 | # [note that -Wall is a gcc-specific compilation flag ("all warnings on")] | ||
33 | O = .o | ||
34 | E = | ||
35 | |||
36 | -LDFLAGS = | ||
37 | - | ||
38 | PROG = pngcheck | ||
39 | PROG2 = pngsplit | ||
40 | PROG3 = png-fix-IDAT-windowsize | ||
41 | @@ -57,13 +55,13 @@ EXES = $(PROG)$(E) $(PROG2)$(E) $(PROG3)$(E) | ||
42 | all: $(EXES) | ||
43 | |||
44 | $(PROG)$(E): $(PROG).c | ||
45 | - $(CC) $(CFLAGS) -o $@ $(PROG).c $(LIBS) | ||
46 | + $(CC) $(CFLAGS) -o $@ $(PROG).c $(LDFLAGS) $(LIBS) | ||
47 | |||
48 | $(PROG2)$(E): gpl/$(PROG2).c | ||
49 | - $(CC) $(CFLAGS) -o $@ gpl/$(PROG2).c $(LIBS) | ||
50 | + $(CC) $(CFLAGS) -o $@ gpl/$(PROG2).c $(LDFLAGS) $(LIBS) | ||
51 | |||
52 | $(PROG3)$(E): gpl/$(PROG3).c | ||
53 | - $(CC) $(CFLAGS) -o $@ gpl/$(PROG3).c $(LIBS) | ||
54 | + $(CC) $(CFLAGS) -o $@ gpl/$(PROG3).c $(LDFLAGS) $(LIBS) | ||
55 | |||
56 | |||
57 | # maintenance --------------------------------------------------------------- | ||
58 | -- | ||
59 | 2.12.2 | ||
60 | |||
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 @@ | |||
1 | From d4d8257953bd1e7be167aed24c0578362cc5f675 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 5 Apr 2017 13:12:30 -0700 | ||
4 | Subject: [PATCH 1/2] png-fix-IDAT-windowsize: Fix format string errors in | ||
5 | fprintf | ||
6 | |||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | gpl/png-fix-IDAT-windowsize.c | 4 ++-- | ||
10 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/gpl/png-fix-IDAT-windowsize.c b/gpl/png-fix-IDAT-windowsize.c | ||
13 | index 6d4ef9c..d212017 100644 | ||
14 | --- a/gpl/png-fix-IDAT-windowsize.c | ||
15 | +++ b/gpl/png-fix-IDAT-windowsize.c | ||
16 | @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) | ||
17 | fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n", | ||
18 | ZLIB_VERSION, zlib_version); | ||
19 | fprintf(stderr, "\n"); | ||
20 | - fprintf(stderr, png_fix_IDAT_windowsize_usage); | ||
21 | + fprintf(stderr, "%s", png_fix_IDAT_windowsize_usage); | ||
22 | fflush(stderr); | ||
23 | return 1; | ||
24 | } | ||
25 | @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) | ||
26 | fflush(stdout); | ||
27 | |||
28 | if ( argn == argc ) { | ||
29 | - fprintf(stderr, png_fix_IDAT_windowsize_usage); | ||
30 | + fprintf(stderr, "%s", png_fix_IDAT_windowsize_usage); | ||
31 | fflush(stderr); | ||
32 | return 5; | ||
33 | } else { | ||
34 | -- | ||
35 | 2.12.2 | ||
36 | |||
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 @@ | |||
1 | From: Jari Aalto <jari.aalto@cante.net> | ||
2 | Subject: Correct fomat strings fro hardened build flags | ||
3 | |||
4 | --- | ||
5 | gpl/pngsplit.c | 10 +++++----- | ||
6 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
7 | |||
8 | --- a/gpl/pngsplit.c | ||
9 | +++ b/gpl/pngsplit.c | ||
10 | @@ -141,8 +141,8 @@ | ||
11 | 0 == strncmp( argv[argn], "-quiet", 2 ) ) | ||
12 | verbose = 0; | ||
13 | else { | ||
14 | - fprintf(stderr, pngsplit_hdr); | ||
15 | - fprintf(stderr, pngsplit_usage); | ||
16 | + fprintf(stderr, "%s", pngsplit_hdr); | ||
17 | + fprintf(stderr, "%s", pngsplit_usage); | ||
18 | fflush(stderr); | ||
19 | return 1; | ||
20 | } | ||
21 | @@ -150,8 +150,8 @@ | ||
22 | } | ||
23 | |||
24 | if ( argn == argc ) { | ||
25 | - fprintf(stderr, pngsplit_hdr); | ||
26 | - fprintf(stderr, pngsplit_usage); | ||
27 | + fprintf(stderr, "%s", pngsplit_hdr); | ||
28 | + fprintf(stderr, "%s", pngsplit_usage); | ||
29 | fflush(stderr); | ||
30 | return 5; | ||
31 | } else { | ||
32 | @@ -162,7 +162,7 @@ | ||
33 | |||
34 | /*============================= MAIN LOOP =============================*/ | ||
35 | |||
36 | - fprintf(stdout, pngsplit_hdr); | ||
37 | + fprintf(stdout, "%s", pngsplit_hdr); | ||
38 | fflush(stdout); | ||
39 | |||
40 | 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" | |||
4 | LIC_FILES_CHKSUM = "file://gpl/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | 4 | LIC_FILES_CHKSUM = "file://gpl/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" |
5 | DEPENDS = "zlib libpng" | 5 | DEPENDS = "zlib libpng" |
6 | 6 | ||
7 | SRC_URI = "${SOURCEFORGE_MIRROR}/project/png-mng/${BPN}/${PV}/${BPN}-${PV}.tar.gz" | 7 | SRC_URI = "${SOURCEFORGE_MIRROR}/project/png-mng/${BPN}/${PV}/${BPN}-${PV}.tar.gz \ |
8 | file://10-pngsplit-format-strings.patch \ | ||
9 | file://0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch \ | ||
10 | file://0001-make-Respect-variables-from-environement.patch \ | ||
11 | " | ||
8 | 12 | ||
9 | SRC_URI[md5sum] = "980bd6d9a3830fdce746d7fe3c9166ee" | 13 | SRC_URI[md5sum] = "980bd6d9a3830fdce746d7fe3c9166ee" |
10 | SRC_URI[sha256sum] = "77f0a039ac64df55fbd06af6f872fdbad4f639d009bbb5cd5cbe4db25690f35f" | 14 | SRC_URI[sha256sum] = "77f0a039ac64df55fbd06af6f872fdbad4f639d009bbb5cd5cbe4db25690f35f" |
11 | 15 | ||
12 | EXTRA_OEMAKE = "-e MAKEFLAGS=" | 16 | CFLAGS += "-DUSE_ZLIB" |
17 | |||
18 | EXTRA_OEMAKE = "-f ${S}/Makefile.unx" | ||
13 | 19 | ||
14 | do_compile() { | 20 | do_compile() { |
15 | oe_runmake -f Makefile.unx INCS=-I${STAGING_DIR_HOST}${incdir} LIBS='${STAGING_DIR_HOST}${libdir}/libz.a ${LDFLAGS}' | 21 | oe_runmake |
16 | } | 22 | } |
17 | 23 | ||
18 | do_install() { | 24 | do_install() { |