diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-support/nspr | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-support/nspr')
6 files changed, 347 insertions, 0 deletions
diff --git a/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch b/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch new file mode 100644 index 0000000000..c2b7258e50 --- /dev/null +++ b/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | Fix build failure on x86_64 | ||
2 | |||
3 | When the target_cpu is x86_64, we should assume that the pkg uses 64bit, | ||
4 | only if USE_N32 is set, we can assume that the pkg uses 32bit. It used a | ||
5 | opposite logic before. | ||
6 | |||
7 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | --- | ||
11 | configure.in | 12 ++++++------ | ||
12 | 1 files changed, 6 insertions(+), 6 deletions(-) | ||
13 | |||
14 | Index: nspr/configure.in | ||
15 | =================================================================== | ||
16 | --- nspr.orig/configure.in | ||
17 | +++ nspr/configure.in | ||
18 | @@ -1875,28 +1875,24 @@ tools are selected during the Xcode/Deve | ||
19 | PR_MD_ASFILES=os_Linux_ia64.s | ||
20 | ;; | ||
21 | x86_64) | ||
22 | - if test -n "$USE_64"; then | ||
23 | - PR_MD_ASFILES=os_Linux_x86_64.s | ||
24 | - elif test -n "$USE_X32"; then | ||
25 | + if test -n "$USE_X32"; then | ||
26 | + AC_DEFINE(i386) | ||
27 | PR_MD_ASFILES=os_Linux_x86_64.s | ||
28 | CC="$CC -mx32" | ||
29 | CXX="$CXX -mx32" | ||
30 | else | ||
31 | - AC_DEFINE(i386) | ||
32 | - PR_MD_ASFILES=os_Linux_x86.s | ||
33 | - CC="$CC -m32" | ||
34 | - CXX="$CXX -m32" | ||
35 | + PR_MD_ASFILES=os_Linux_x86_64.s | ||
36 | fi | ||
37 | ;; | ||
38 | ppc|powerpc) | ||
39 | PR_MD_ASFILES=os_Linux_ppc.s | ||
40 | ;; | ||
41 | powerpc64) | ||
42 | - if test -n "$USE_64"; then | ||
43 | + if test -n "$USE_N32"; then | ||
44 | + PR_MD_ASFILES=os_Linux_ppc.s | ||
45 | + else | ||
46 | CC="$CC -m64" | ||
47 | CXX="$CXX -m64" | ||
48 | - else | ||
49 | - PR_MD_ASFILES=os_Linux_ppc.s | ||
50 | fi | ||
51 | ;; | ||
52 | m68k) | ||
diff --git a/meta/recipes-support/nspr/nspr/nspr-CVE-2014-1545.patch b/meta/recipes-support/nspr/nspr/nspr-CVE-2014-1545.patch new file mode 100644 index 0000000000..565ff168e0 --- /dev/null +++ b/meta/recipes-support/nspr/nspr/nspr-CVE-2014-1545.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | Fix for CVE-2014-1545 | ||
2 | |||
3 | Upstream-Status: Backport | ||
4 | |||
5 | Backported from nspr-4.10.6.tar.gz. | ||
6 | --- | ||
7 | --- a/pr/src/io/prprf.c | ||
8 | +++ b/pr/src/io/prprf.c | ||
9 | @@ -50,6 +50,10 @@ | ||
10 | #include "prlog.h" | ||
11 | #include "prmem.h" | ||
12 | |||
13 | +#ifdef _MSC_VER | ||
14 | +#define snprintf _snprintf | ||
15 | +#endif | ||
16 | + | ||
17 | /* | ||
18 | ** WARNING: This code may *NOT* call PR_LOG (because PR_LOG calls it) | ||
19 | */ | ||
20 | @@ -330,7 +334,7 @@ | ||
21 | ** Convert a double precision floating point number into its printable | ||
22 | ** form. | ||
23 | ** | ||
24 | -** XXX stop using sprintf to convert floating point | ||
25 | +** XXX stop using snprintf to convert floating point | ||
26 | */ | ||
27 | static int cvt_f(SprintfState *ss, double d, const char *fmt0, const char *fmt1) | ||
28 | { | ||
29 | @@ -338,15 +342,14 @@ | ||
30 | char fout[300]; | ||
31 | int amount = fmt1 - fmt0; | ||
32 | |||
33 | - PR_ASSERT((amount > 0) && (amount < sizeof(fin))); | ||
34 | - if (amount >= sizeof(fin)) { | ||
35 | - /* Totally bogus % command to sprintf. Just ignore it */ | ||
36 | + if (amount <= 0 || amount >= sizeof(fin)) { | ||
37 | + /* Totally bogus % command to snprintf. Just ignore it */ | ||
38 | return 0; | ||
39 | } | ||
40 | memcpy(fin, fmt0, amount); | ||
41 | fin[amount] = 0; | ||
42 | |||
43 | - /* Convert floating point using the native sprintf code */ | ||
44 | + /* Convert floating point using the native snprintf code */ | ||
45 | #ifdef DEBUG | ||
46 | { | ||
47 | const char *p = fin; | ||
48 | @@ -356,14 +359,11 @@ | ||
49 | } | ||
50 | } | ||
51 | #endif | ||
52 | - sprintf(fout, fin, d); | ||
53 | - | ||
54 | - /* | ||
55 | - ** This assert will catch overflow's of fout, when building with | ||
56 | - ** debugging on. At least this way we can track down the evil piece | ||
57 | - ** of calling code and fix it! | ||
58 | - */ | ||
59 | - PR_ASSERT(strlen(fout) < sizeof(fout)); | ||
60 | + memset(fout, 0, sizeof(fout)); | ||
61 | + snprintf(fout, sizeof(fout), fin, d); | ||
62 | + /* Explicitly null-terminate fout because on Windows snprintf doesn't | ||
63 | + * append a null-terminator if the buffer is too small. */ | ||
64 | + fout[sizeof(fout) - 1] = '\0'; | ||
65 | |||
66 | return (*ss->stuff)(ss, fout, strlen(fout)); | ||
67 | } | ||
diff --git a/meta/recipes-support/nspr/nspr/nspr.pc.in b/meta/recipes-support/nspr/nspr/nspr.pc.in new file mode 100644 index 0000000000..c37d0bcbd7 --- /dev/null +++ b/meta/recipes-support/nspr/nspr/nspr.pc.in | |||
@@ -0,0 +1,11 @@ | |||
1 | os_libs=-lpthread -ldl | ||
2 | prefix=OEPREFIX | ||
3 | exec_prefix=OEEXECPREFIX | ||
4 | libdir=OELIBDIR | ||
5 | includedir=OEINCDIR | ||
6 | |||
7 | Name: NSPR | ||
8 | Description: The Netscape Portable Runtime | ||
9 | Version: 4.9.5 | ||
10 | Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 -lpthread -ldl | ||
11 | Cflags: | ||
diff --git a/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch b/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch new file mode 100644 index 0000000000..a7e7853de1 --- /dev/null +++ b/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Author: Andrei Gherzan <andrei@gherzan.ro> | ||
2 | Date: Thu Feb 9 00:03:38 2012 +0200 | ||
3 | |||
4 | Avoid QA warnings by removing hardcoded rpath from binaries. | ||
5 | |||
6 | [...] | ||
7 | WARNING: QA Issue: package nspr contains bad RPATH {builddir}/tmp/work/armv5te-poky-linux-gnueabi/nspr-4.8.9-r1/nspr-4.8.9/mozilla/nsprpub/pr/tests/../../dist/lib | ||
8 | in file {builddir}/tmp/work/armv5te-poky-linux-gnueabi/nspr-4.8.9-r1/packages-split/nspr/usr/lib/nspr/tests/multiwait | ||
9 | [...] | ||
10 | |||
11 | Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> | ||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Index: nspr-4.8.9/mozilla/nsprpub/pr/tests/Makefile.in | ||
15 | =================================================================== | ||
16 | --- nsprpub.orig/pr/tests/Makefile.in 2012-02-11 00:01:10.476220505 +0200 | ||
17 | +++ nsprpub/pr/tests/Makefile.in 2012-02-10 23:57:40.000000000 +0200 | ||
18 | @@ -379,7 +379,7 @@ | ||
19 | endif | ||
20 | |||
21 | ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH))) | ||
22 | - LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR) | ||
23 | + LDOPTS += -Xlinker | ||
24 | ifeq ($(USE_PTHREADS),1) | ||
25 | EXTRA_LIBS = -lpthread | ||
26 | endif | ||
diff --git a/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch b/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch new file mode 100644 index 0000000000..bde715c5dc --- /dev/null +++ b/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | the $srcdir is not defined at the time of gnu-configurize. | ||
2 | |||
3 | Upstream-Status: Inappropriate [OE-Core specific] | ||
4 | |||
5 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
6 | |||
7 | Index: nspr/configure.in | ||
8 | =================================================================== | ||
9 | --- nspr.orig/configure.in | ||
10 | +++ nspr/configure.in | ||
11 | @@ -8,7 +8,7 @@ AC_PREREQ(2.61) | ||
12 | AC_INIT | ||
13 | AC_CONFIG_SRCDIR([pr/include/nspr.h]) | ||
14 | |||
15 | -AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf) | ||
16 | +AC_CONFIG_AUX_DIR(build/autoconf) | ||
17 | AC_CANONICAL_TARGET | ||
18 | |||
19 | dnl ======================================================== | ||
diff --git a/meta/recipes-support/nspr/nspr_4.10.7.bb b/meta/recipes-support/nspr/nspr_4.10.7.bb new file mode 100644 index 0000000000..69e9dfa6a3 --- /dev/null +++ b/meta/recipes-support/nspr/nspr_4.10.7.bb | |||
@@ -0,0 +1,172 @@ | |||
1 | SUMMARY = "Netscape Portable Runtime Library" | ||
2 | HOMEPAGE = "http://www.mozilla.org/projects/nspr/" | ||
3 | LICENSE = "GPL-2.0 | MPL-2.0 | LGPL-2.1" | ||
4 | LIC_FILES_CHKSUM = "file://configure.in;beginline=3;endline=6;md5=90c2fdee38e45d6302abcfe475c8b5c5 \ | ||
5 | file://Makefile.in;beginline=4;endline=38;md5=beda1dbb98a515f557d3e58ef06bca99" | ||
6 | SECTION = "libs/network" | ||
7 | |||
8 | SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \ | ||
9 | file://remove-rpath-from-tests.patch \ | ||
10 | file://fix-build-on-x86_64.patch \ | ||
11 | file://remove-srcdir-from-configure-in.patch \ | ||
12 | " | ||
13 | |||
14 | SRC_URI += "file://nspr.pc.in" | ||
15 | |||
16 | SRC_URI[md5sum] = "6e06919e4b56efed501e05d8b45ec10e" | ||
17 | SRC_URI[sha256sum] = "389af5cfa863ea9bc6de7b30c15f8a4f9bddd8002f8c6fdc8b33caef43893938" | ||
18 | |||
19 | S = "${WORKDIR}/nspr-${PV}/nspr" | ||
20 | |||
21 | RDEPENDS_${PN}-dev += "perl" | ||
22 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
23 | |||
24 | TESTS = "runtests.pl \ | ||
25 | runtests.sh \ | ||
26 | accept \ | ||
27 | acceptread \ | ||
28 | acceptreademu \ | ||
29 | affinity \ | ||
30 | alarm \ | ||
31 | anonfm \ | ||
32 | atomic \ | ||
33 | attach \ | ||
34 | bigfile \ | ||
35 | cleanup \ | ||
36 | cltsrv \ | ||
37 | concur \ | ||
38 | cvar \ | ||
39 | cvar2 \ | ||
40 | dlltest \ | ||
41 | dtoa \ | ||
42 | errcodes \ | ||
43 | exit \ | ||
44 | fdcach \ | ||
45 | fileio \ | ||
46 | foreign \ | ||
47 | formattm \ | ||
48 | fsync \ | ||
49 | gethost \ | ||
50 | getproto \ | ||
51 | i2l \ | ||
52 | initclk \ | ||
53 | inrval \ | ||
54 | instrumt \ | ||
55 | intrio \ | ||
56 | intrupt \ | ||
57 | io_timeout \ | ||
58 | ioconthr \ | ||
59 | join \ | ||
60 | joinkk \ | ||
61 | joinku \ | ||
62 | joinuk \ | ||
63 | joinuu \ | ||
64 | layer \ | ||
65 | lazyinit \ | ||
66 | libfilename \ | ||
67 | lltest \ | ||
68 | lock \ | ||
69 | lockfile \ | ||
70 | logfile \ | ||
71 | logger \ | ||
72 | many_cv \ | ||
73 | multiwait \ | ||
74 | nameshm1 \ | ||
75 | nblayer \ | ||
76 | nonblock \ | ||
77 | ntioto \ | ||
78 | ntoh \ | ||
79 | op_2long \ | ||
80 | op_excl \ | ||
81 | op_filnf \ | ||
82 | op_filok \ | ||
83 | op_nofil \ | ||
84 | parent \ | ||
85 | parsetm \ | ||
86 | peek \ | ||
87 | perf \ | ||
88 | pipeping \ | ||
89 | pipeping2 \ | ||
90 | pipeself \ | ||
91 | poll_nm \ | ||
92 | poll_to \ | ||
93 | pollable \ | ||
94 | prftest \ | ||
95 | primblok \ | ||
96 | provider \ | ||
97 | prpollml \ | ||
98 | ranfile \ | ||
99 | randseed \ | ||
100 | reinit \ | ||
101 | rwlocktest \ | ||
102 | sel_spd \ | ||
103 | selct_er \ | ||
104 | selct_nm \ | ||
105 | selct_to \ | ||
106 | selintr \ | ||
107 | sema \ | ||
108 | semaerr \ | ||
109 | semaping \ | ||
110 | sendzlf \ | ||
111 | server_test \ | ||
112 | servr_kk \ | ||
113 | servr_uk \ | ||
114 | servr_ku \ | ||
115 | servr_uu \ | ||
116 | short_thread \ | ||
117 | sigpipe \ | ||
118 | socket \ | ||
119 | sockopt \ | ||
120 | sockping \ | ||
121 | sprintf \ | ||
122 | stack \ | ||
123 | stdio \ | ||
124 | str2addr \ | ||
125 | strod \ | ||
126 | switch \ | ||
127 | system \ | ||
128 | testbit \ | ||
129 | testfile \ | ||
130 | threads \ | ||
131 | timemac \ | ||
132 | timetest \ | ||
133 | tpd \ | ||
134 | udpsrv \ | ||
135 | vercheck \ | ||
136 | version \ | ||
137 | writev \ | ||
138 | xnotify \ | ||
139 | zerolen" | ||
140 | |||
141 | inherit autotools-brokensep | ||
142 | |||
143 | do_compile_prepend() { | ||
144 | oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX" LDFLAGS="" CC=gcc -C config export | ||
145 | } | ||
146 | |||
147 | do_compile_append() { | ||
148 | oe_runmake -C pr/tests | ||
149 | } | ||
150 | |||
151 | do_install_append() { | ||
152 | install -D ${WORKDIR}/nspr.pc.in ${D}${libdir}/pkgconfig/nspr.pc | ||
153 | sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nspr.pc | ||
154 | sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nspr.pc | ||
155 | sed -i s:OEINCDIR:${includedir}:g ${D}${libdir}/pkgconfig/nspr.pc | ||
156 | sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nspr.pc | ||
157 | cd ${S}/pr/tests | ||
158 | mkdir -p ${D}${libdir}/nspr/tests | ||
159 | install -m 0755 ${TESTS} ${D}${libdir}/nspr/tests | ||
160 | |||
161 | # delete compile-et.pl and perr.properties from ${bindir} because these are | ||
162 | # only used to generate prerr.c and prerr.h files from prerr.et at compile | ||
163 | # time | ||
164 | rm ${D}${bindir}/compile-et.pl ${D}${bindir}/prerr.properties | ||
165 | } | ||
166 | |||
167 | FILES_${PN} = "${libdir}/lib*.so" | ||
168 | FILES_${PN}-dev = "${bindir}/* ${libdir}/nspr/tests/* ${libdir}/pkgconfig \ | ||
169 | ${includedir}/* ${datadir}/aclocal/* " | ||
170 | FILES_${PN}-dbg += "${libdir}/nspr/tests/.debug/*" | ||
171 | |||
172 | BBCLASSEXTEND = "native nativesdk" | ||