diff options
Diffstat (limited to 'meta/recipes-support/nspr/nspr')
5 files changed, 175 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 ======================================================== | ||