summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/nspr/nspr
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-support/nspr/nspr
downloadpoky-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/nspr')
-rw-r--r--meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch52
-rw-r--r--meta/recipes-support/nspr/nspr/nspr-CVE-2014-1545.patch67
-rw-r--r--meta/recipes-support/nspr/nspr/nspr.pc.in11
-rw-r--r--meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch26
-rw-r--r--meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch19
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 @@
1Fix build failure on x86_64
2
3When the target_cpu is x86_64, we should assume that the pkg uses 64bit,
4only if USE_N32 is set, we can assume that the pkg uses 32bit. It used a
5opposite logic before.
6
7Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
8
9Upstream-Status: Pending
10---
11 configure.in | 12 ++++++------
12 1 files changed, 6 insertions(+), 6 deletions(-)
13
14Index: 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 @@
1Fix for CVE-2014-1545
2
3Upstream-Status: Backport
4
5Backported 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 @@
1os_libs=-lpthread -ldl
2prefix=OEPREFIX
3exec_prefix=OEEXECPREFIX
4libdir=OELIBDIR
5includedir=OEINCDIR
6
7Name: NSPR
8Description: The Netscape Portable Runtime
9Version: 4.9.5
10Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 -lpthread -ldl
11Cflags:
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 @@
1Author: Andrei Gherzan <andrei@gherzan.ro>
2Date: Thu Feb 9 00:03:38 2012 +0200
3
4Avoid QA warnings by removing hardcoded rpath from binaries.
5
6[...]
7WARNING: 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
8in file {builddir}/tmp/work/armv5te-poky-linux-gnueabi/nspr-4.8.9-r1/packages-split/nspr/usr/lib/nspr/tests/multiwait
9[...]
10
11Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
12Upstream-Status: Pending
13
14Index: 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 @@
1the $srcdir is not defined at the time of gnu-configurize.
2
3Upstream-Status: Inappropriate [OE-Core specific]
4
5Signed-off-by: Saul Wold <sgw@linux.intel.com>
6
7Index: 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 ========================================================