nspr
Andrew Cagney <[email protected]> Fri, 11 Dec 2015 12:50:20 -0500
| Newsgroups | gmane.linux.uclinux.devel |
|---|---|
| Message-ID | <CAJeAr6s2Z0Cui2YQVOW4OS=8m-eCb5BFth3Zq+hHQzLF0WTXpg@mail.gmail.com> |
The patch "nspr.diff" adds a standalone and up-to-date NSPR library. It is always built statically. For the patches: nspr-00--done--nspr-configure-in--m68k-is-not-m68020-60.patch I believe it's been accepted nspr-02--hold--ifdef-have-dlfcn-h.patch: it's been submitted and hopefully accepted nspr-03--todo--barf-fork-call.patch: hack: I don't think s/fork/vfork/ would work here, and since I don't need it to work I took the easy way out I should point out that while Mozilla thinks NSPR and NSS should go hand-in-hand (per the current lib/nss directory which tries to build both) I found things became much easier when I split those two and built them separately (NSPR uses autoconf, abet incorrectly; NSS uses GNU make; NSS+NSPR uses GNU make to invoke autoconf ....). The patch "wip-nss.diff" (do not apply) hints at how I'm getting lib/nss to use the previously built NSPR Andrew _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
nspr.diff
(text/plain, 5.1 KB)
diff --git a/lib/nspr/.gitignore b/lib/nspr/.gitignore
new file mode 100644
index 0000000..dc3f997
--- /dev/null
+++ b/lib/nspr/.gitignore
@@ -0,0 +1,2 @@
+/build
+/downloads
diff --git a/lib/nspr/makefile b/lib/nspr/makefile
new file mode 100644
index 0000000..e195237
--- /dev/null
+++ b/lib/nspr/makefile
@@ -0,0 +1,20 @@
+URL = https://ftp.mozilla.org/pub/nspr/releases/v4.11/src/nspr-4.11.tar.gz
+
+NVR = $(subst -, , $(patsubst %.tar.gz,%,$(notdir $(URL))))
+PKG = $(word 1,$(NVR))
+VERSION = $(word 2,$(NVR))
+SRCDIR = $(PKG)-$(VERSION)
+BUILDDIR = $(SRCDIR)/nspr
+
+# $(AUTORECONF) is run from $(SRCDIR), not $(BUILDDIR)
+AUTORECONF = cd nspr ; autoconf
+
+include $(ROOTDIR)/tools/automake.inc
+
+# Disable build of shared library. Should this be controled by
+# automake.mk somehow?
+MAKEVARS = 'SHARED_LIBRARY='
+
+# When it comes to the definition of build, host, and target, Mozilla
+# are still living in the 90's: target->[] build->host host->target.
+CONFIGURE_OPTS:=$(patsubst --build=%,--host=%,$(patsubst --host=%,--target=%,$(patsubst --target=%,,$(CONFIGURE_OPTS))))
diff --git a/lib/nspr/patches/nspr-00--done--nspr-configure-in--m68k-is-not-m68020-60.patch b/lib/nspr/patches/nspr-00--done--nspr-configure-in--m68k-is-not-m68020-60.patch
new file mode 100644
index 0000000..bbdced2
--- /dev/null
+++ b/lib/nspr/patches/nspr-00--done--nspr-configure-in--m68k-is-not-m68020-60.patch
@@ -0,0 +1,11 @@
+--- nspr-4.10.9/nspr/configure.in.orig 2015-11-25 15:17:14.732725317 -0500
++++ nspr-4.10.9/nspr/configure.in 2015-11-25 20:09:38.299725384 -0500
+@@ -1857,8 +1865,4 @@
+ fi
+ ;;
+- m68k)
+- CFLAGS="$CFLAGS -m68020-60"
+- CXXFLAGS="$CXXFLAGS -m68020-60"
+- ;;
+ esac
+ ;;
diff --git a/lib/nspr/patches/nspr-02--hold--ifdef-have-dlfcn-h.patch b/lib/nspr/patches/nspr-02--hold--ifdef-have-dlfcn-h.patch
new file mode 100644
index 0000000..7f80842
--- /dev/null
+++ b/lib/nspr/patches/nspr-02--hold--ifdef-have-dlfcn-h.patch
@@ -0,0 +1,57 @@
+--- nspr-4.11/nspr/configure.in.orig 2015-12-02 12:38:53.626997958 -0500
++++ nspr-4.11/nspr/configure.in 2015-12-02 13:55:03.438024691 -0500
+@@ -2518,8 +2518,9 @@
+ *-darwin*|*-beos*|*-os2*)
+ ;;
+ *)
++ dnl define HAVE_DLFCN_H when present
+ AC_CHECK_LIB(dl, dlopen,
+- [AC_CHECK_HEADER(dlfcn.h,
++ [AC_CHECK_HEADERS(dlfcn.h,
+ OS_LIBS="-ldl $OS_LIBS")])
+ ;;
+ esac
+--- nspr-4.11/nspr/pr/include/md/_linux.h.orig 2015-12-02 14:06:23.694020882 -0500
++++ nspr-4.11/nspr/pr/include/md/_linux.h 2015-12-02 14:07:37.706046831 -0500
+@@ -74,10 +74,12 @@
+ #undef HAVE_STACK_GROWING_UP
+
+ /*
+- * Elf linux supports dl* functions
++ * Elf linux supports dl* functions but uClinux may not.
+ */
++#if defined(HAVE_DLFCN_H)
+ #define HAVE_DLL
+ #define USE_DLFCN
++#endif
+ #if defined(ANDROID)
+ #define NO_DLOPEN_NULL
+ #endif
+--- nspr-4.11/nspr/pr/src/pthreads/ptthread.c.orig 2015-11-18 07:36:52.000000000 -0500
++++ nspr-4.11/nspr/pr/src/pthreads/ptthread.c 2015-12-02 14:15:10.850057366 -0500
+@@ -19,7 +19,9 @@
+ #include <unistd.h>
+ #include <string.h>
+ #include <signal.h>
++#ifdef HAVE_DLFCN_H
+ #include <dlfcn.h>
++#endif
+
+ #ifdef SYMBIAN
+ /* In Open C sched_get_priority_min/max do not work properly, so we undefine
+@@ -1764,6 +1766,7 @@
+ int (*dynamic_pthread_setname_np)(pthread_t, const char*);
+ #endif
+
++#if defined(HAVE_DLL)
+ *(void**)(&dynamic_pthread_setname_np) =
+ dlsym(RTLD_DEFAULT, "pthread_setname_np");
+ if (!dynamic_pthread_setname_np)
+@@ -1801,6 +1804,7 @@
+ PR_SetError(PR_UNKNOWN_ERROR, result);
+ return PR_FAILURE;
+ }
++#endif /* HAVE_DLL */
+ return PR_SUCCESS;
+ }
+
diff --git a/lib/nspr/patches/nspr-03--todo--barf-fork-call.patch b/lib/nspr/patches/nspr-03--todo--barf-fork-call.patch
new file mode 100644
index 0000000..5c17255
--- /dev/null
+++ b/lib/nspr/patches/nspr-03--todo--barf-fork-call.patch
@@ -0,0 +1,31 @@
+For moment, when no fork() replace the call with a barf.
+Should, perhaps, eventually look at changing the code to
+be vfork proof.
+
+--- nspr-4.11/nspr/configure.in.LSW 2015-12-04 12:22:02.942504176 -0500
++++ nspr-4.11/nspr/configure.in 2015-12-04 12:23:32.594522058 -0500
+@@ -2540,7 +2540,7 @@
+ AC_PROG_GCC_TRADITIONAL
+ _SAVE_LIBS="$LIBS"
+ LIBS="$LIBS $OS_LIBS"
+-AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall)
++AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall fork)
+ LIBS="$_SAVE_LIBS"
+
+ dnl ========================================================
+--- nspr-4.11/nspr/pr/src/md/unix/uxproces.c.LSW 2015-12-04 12:21:59.453465794 -0500
++++ nspr-4.11/nspr/pr/src/md/unix/uxproces.c 2015-12-04 12:25:52.282503511 -0500
+@@ -237,8 +237,12 @@
+ if (fd_map[2] != 2)
+ close(fd_map[2]);
+ }
+-#else
++#elif defined(HAVE_FORK)
+ process->md.pid = fork();
++#else
++ /* XXX: code that follows isn't exactly vfork() proof so just fail. */
++ fprintf(stderr, "XXX: barfing fork() call\n");
++ process->md.pid = -1;
+ #endif
+ if ((pid_t) -1 == process->md.pid) {
+ PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, errno);
wip-nss.diff
(text/plain, 1.1 KB)
diff --git a/lib/nss/makefile b/lib/nss/makefile index 95ad618..7db8f8a 100644 --- a/lib/nss/makefile +++ b/lib/nss/makefile @@ -1,8 +1,32 @@ - URL := ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_17_4_RTM/src/nss-3.17.4-with-nspr-4.10.7.tar.gz -BUILDDIR = nss-3.17.4 -CONFIGURE = : +# pluck out the nss version +NVR = $(subst -, , $(patsubst %.tar.gz,%,$(notdir $(URL)))) +PKG = $(word 1,$(NVR)) +VERSION = $(word 2,$(NVR)) +# Building happens within the NSS sub-directory +SRCDIR = $(PKG)-$(VERSION) +BUILDDIR = $(SRCDIR)/nss + +# skip NSPR +BUILD = all + +# Copies stuff from dist to where it should be. +INSTALLTARGET = install-dist + +MAKEVARS = \ + OS_TARGET=uClinux-dist OS_RELEASE= \ + NSPR_INCLUDE_DIR=$(STAGEDIR)/include/nspr \ + NSPR_LIB_DIR=$(STAGEDIR)/lib include $(ROOTDIR)/tools/automake.inc +build/%-$(INSTALLTARGET): build/%-$(BUILDTARGET) + rm -rf build/$*-install + mkdir -p build/$*-install + : include + cp -v -r build/$(SRCDIR)/dist/public build/$*-install/include + : lib + cp -v -r build/$(SRCDIR)/dist/uClinux-dist/lib build/$*-install/lib + : bin + cp -v build/$(SRCDIR)/dist/uClinux-dist/bin build/$*-install/bin