From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- .../nspr/nspr/fix-build-on-x86_64.patch | 52 +++++++ .../nspr/nspr/nspr-CVE-2014-1545.patch | 67 ++++++++ meta/recipes-support/nspr/nspr/nspr.pc.in | 11 ++ .../nspr/nspr/remove-rpath-from-tests.patch | 26 ++++ .../nspr/remove-srcdir-from-configure-in.patch | 19 +++ meta/recipes-support/nspr/nspr_4.10.7.bb | 172 +++++++++++++++++++++ 6 files changed, 347 insertions(+) create mode 100644 meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch create mode 100644 meta/recipes-support/nspr/nspr/nspr-CVE-2014-1545.patch create mode 100644 meta/recipes-support/nspr/nspr/nspr.pc.in create mode 100644 meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch create mode 100644 meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch create mode 100644 meta/recipes-support/nspr/nspr_4.10.7.bb (limited to 'meta/recipes-support/nspr') 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 @@ +Fix build failure on x86_64 + +When the target_cpu is x86_64, we should assume that the pkg uses 64bit, +only if USE_N32 is set, we can assume that the pkg uses 32bit. It used a +opposite logic before. + +Signed-off-by: Robert Yang + +Upstream-Status: Pending +--- + configure.in | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +Index: nspr/configure.in +=================================================================== +--- nspr.orig/configure.in ++++ nspr/configure.in +@@ -1875,28 +1875,24 @@ tools are selected during the Xcode/Deve + PR_MD_ASFILES=os_Linux_ia64.s + ;; + x86_64) +- if test -n "$USE_64"; then +- PR_MD_ASFILES=os_Linux_x86_64.s +- elif test -n "$USE_X32"; then ++ if test -n "$USE_X32"; then ++ AC_DEFINE(i386) + PR_MD_ASFILES=os_Linux_x86_64.s + CC="$CC -mx32" + CXX="$CXX -mx32" + else +- AC_DEFINE(i386) +- PR_MD_ASFILES=os_Linux_x86.s +- CC="$CC -m32" +- CXX="$CXX -m32" ++ PR_MD_ASFILES=os_Linux_x86_64.s + fi + ;; + ppc|powerpc) + PR_MD_ASFILES=os_Linux_ppc.s + ;; + powerpc64) +- if test -n "$USE_64"; then ++ if test -n "$USE_N32"; then ++ PR_MD_ASFILES=os_Linux_ppc.s ++ else + CC="$CC -m64" + CXX="$CXX -m64" +- else +- PR_MD_ASFILES=os_Linux_ppc.s + fi + ;; + 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 @@ +Fix for CVE-2014-1545 + +Upstream-Status: Backport + +Backported from nspr-4.10.6.tar.gz. +--- +--- a/pr/src/io/prprf.c ++++ b/pr/src/io/prprf.c +@@ -50,6 +50,10 @@ + #include "prlog.h" + #include "prmem.h" + ++#ifdef _MSC_VER ++#define snprintf _snprintf ++#endif ++ + /* + ** WARNING: This code may *NOT* call PR_LOG (because PR_LOG calls it) + */ +@@ -330,7 +334,7 @@ + ** Convert a double precision floating point number into its printable + ** form. + ** +-** XXX stop using sprintf to convert floating point ++** XXX stop using snprintf to convert floating point + */ + static int cvt_f(SprintfState *ss, double d, const char *fmt0, const char *fmt1) + { +@@ -338,15 +342,14 @@ + char fout[300]; + int amount = fmt1 - fmt0; + +- PR_ASSERT((amount > 0) && (amount < sizeof(fin))); +- if (amount >= sizeof(fin)) { +- /* Totally bogus % command to sprintf. Just ignore it */ ++ if (amount <= 0 || amount >= sizeof(fin)) { ++ /* Totally bogus % command to snprintf. Just ignore it */ + return 0; + } + memcpy(fin, fmt0, amount); + fin[amount] = 0; + +- /* Convert floating point using the native sprintf code */ ++ /* Convert floating point using the native snprintf code */ + #ifdef DEBUG + { + const char *p = fin; +@@ -356,14 +359,11 @@ + } + } + #endif +- sprintf(fout, fin, d); +- +- /* +- ** This assert will catch overflow's of fout, when building with +- ** debugging on. At least this way we can track down the evil piece +- ** of calling code and fix it! +- */ +- PR_ASSERT(strlen(fout) < sizeof(fout)); ++ memset(fout, 0, sizeof(fout)); ++ snprintf(fout, sizeof(fout), fin, d); ++ /* Explicitly null-terminate fout because on Windows snprintf doesn't ++ * append a null-terminator if the buffer is too small. */ ++ fout[sizeof(fout) - 1] = '\0'; + + return (*ss->stuff)(ss, fout, strlen(fout)); + } 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 @@ +os_libs=-lpthread -ldl +prefix=OEPREFIX +exec_prefix=OEEXECPREFIX +libdir=OELIBDIR +includedir=OEINCDIR + +Name: NSPR +Description: The Netscape Portable Runtime +Version: 4.9.5 +Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 -lpthread -ldl +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 @@ +Author: Andrei Gherzan +Date: Thu Feb 9 00:03:38 2012 +0200 + +Avoid QA warnings by removing hardcoded rpath from binaries. + +[...] +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 +in file {builddir}/tmp/work/armv5te-poky-linux-gnueabi/nspr-4.8.9-r1/packages-split/nspr/usr/lib/nspr/tests/multiwait +[...] + +Signed-off-by: Andrei Gherzan +Upstream-Status: Pending + +Index: nspr-4.8.9/mozilla/nsprpub/pr/tests/Makefile.in +=================================================================== +--- nsprpub.orig/pr/tests/Makefile.in 2012-02-11 00:01:10.476220505 +0200 ++++ nsprpub/pr/tests/Makefile.in 2012-02-10 23:57:40.000000000 +0200 +@@ -379,7 +379,7 @@ + endif + + ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH))) +- LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR) ++ LDOPTS += -Xlinker + ifeq ($(USE_PTHREADS),1) + EXTRA_LIBS = -lpthread + 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 @@ +the $srcdir is not defined at the time of gnu-configurize. + +Upstream-Status: Inappropriate [OE-Core specific] + +Signed-off-by: Saul Wold + +Index: nspr/configure.in +=================================================================== +--- nspr.orig/configure.in ++++ nspr/configure.in +@@ -8,7 +8,7 @@ AC_PREREQ(2.61) + AC_INIT + AC_CONFIG_SRCDIR([pr/include/nspr.h]) + +-AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf) ++AC_CONFIG_AUX_DIR(build/autoconf) + AC_CANONICAL_TARGET + + 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 @@ +SUMMARY = "Netscape Portable Runtime Library" +HOMEPAGE = "http://www.mozilla.org/projects/nspr/" +LICENSE = "GPL-2.0 | MPL-2.0 | LGPL-2.1" +LIC_FILES_CHKSUM = "file://configure.in;beginline=3;endline=6;md5=90c2fdee38e45d6302abcfe475c8b5c5 \ + file://Makefile.in;beginline=4;endline=38;md5=beda1dbb98a515f557d3e58ef06bca99" +SECTION = "libs/network" + +SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \ + file://remove-rpath-from-tests.patch \ + file://fix-build-on-x86_64.patch \ + file://remove-srcdir-from-configure-in.patch \ + " + +SRC_URI += "file://nspr.pc.in" + +SRC_URI[md5sum] = "6e06919e4b56efed501e05d8b45ec10e" +SRC_URI[sha256sum] = "389af5cfa863ea9bc6de7b30c15f8a4f9bddd8002f8c6fdc8b33caef43893938" + +S = "${WORKDIR}/nspr-${PV}/nspr" + +RDEPENDS_${PN}-dev += "perl" +TARGET_CC_ARCH += "${LDFLAGS}" + +TESTS = "runtests.pl \ + runtests.sh \ + accept \ + acceptread \ + acceptreademu \ + affinity \ + alarm \ + anonfm \ + atomic \ + attach \ + bigfile \ + cleanup \ + cltsrv \ + concur \ + cvar \ + cvar2 \ + dlltest \ + dtoa \ + errcodes \ + exit \ + fdcach \ + fileio \ + foreign \ + formattm \ + fsync \ + gethost \ + getproto \ + i2l \ + initclk \ + inrval \ + instrumt \ + intrio \ + intrupt \ + io_timeout \ + ioconthr \ + join \ + joinkk \ + joinku \ + joinuk \ + joinuu \ + layer \ + lazyinit \ + libfilename \ + lltest \ + lock \ + lockfile \ + logfile \ + logger \ + many_cv \ + multiwait \ + nameshm1 \ + nblayer \ + nonblock \ + ntioto \ + ntoh \ + op_2long \ + op_excl \ + op_filnf \ + op_filok \ + op_nofil \ + parent \ + parsetm \ + peek \ + perf \ + pipeping \ + pipeping2 \ + pipeself \ + poll_nm \ + poll_to \ + pollable \ + prftest \ + primblok \ + provider \ + prpollml \ + ranfile \ + randseed \ + reinit \ + rwlocktest \ + sel_spd \ + selct_er \ + selct_nm \ + selct_to \ + selintr \ + sema \ + semaerr \ + semaping \ + sendzlf \ + server_test \ + servr_kk \ + servr_uk \ + servr_ku \ + servr_uu \ + short_thread \ + sigpipe \ + socket \ + sockopt \ + sockping \ + sprintf \ + stack \ + stdio \ + str2addr \ + strod \ + switch \ + system \ + testbit \ + testfile \ + threads \ + timemac \ + timetest \ + tpd \ + udpsrv \ + vercheck \ + version \ + writev \ + xnotify \ + zerolen" + +inherit autotools-brokensep + +do_compile_prepend() { + oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX" LDFLAGS="" CC=gcc -C config export +} + +do_compile_append() { + oe_runmake -C pr/tests +} + +do_install_append() { + install -D ${WORKDIR}/nspr.pc.in ${D}${libdir}/pkgconfig/nspr.pc + sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nspr.pc + sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nspr.pc + sed -i s:OEINCDIR:${includedir}:g ${D}${libdir}/pkgconfig/nspr.pc + sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nspr.pc + cd ${S}/pr/tests + mkdir -p ${D}${libdir}/nspr/tests + install -m 0755 ${TESTS} ${D}${libdir}/nspr/tests + + # delete compile-et.pl and perr.properties from ${bindir} because these are + # only used to generate prerr.c and prerr.h files from prerr.et at compile + # time + rm ${D}${bindir}/compile-et.pl ${D}${bindir}/prerr.properties +} + +FILES_${PN} = "${libdir}/lib*.so" +FILES_${PN}-dev = "${bindir}/* ${libdir}/nspr/tests/* ${libdir}/pkgconfig \ + ${includedir}/* ${datadir}/aclocal/* " +FILES_${PN}-dbg += "${libdir}/nspr/tests/.debug/*" + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf