1 --- a/nss.orig/nspr/pr/src/misc/prnetdb.c 2016-02-12 14:51:25.000000000 +0100
2 +++ b/nss/nspr/pr/src/misc/prnetdb.c 2016-03-04 19:23:00.462892600 +0100
5 PRIntn buflen = *buflenp;
7 - if (align && ((long)buf & (align - 1))) {
8 + if (align && ((ptrdiff_t)buf & (align - 1))) {
9 PRIntn skip = align - ((ptrdiff_t)buf & (align - 1));
12 diff -ru a/nspr/configure b/nspr/configure
13 --- a/a/nspr/configure 2014-09-29 16:46:38.427423757 +0100
14 +++ b/b/nspr/configure 2014-09-29 16:47:42.984012225 +0100
17 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
19 - DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
20 + DSO_LDOPTS='-shared -Wl,-z,origin -Wl,-rpath,\$$ORIGIN -Wl,-soname -Wl,$(notdir $@)'
22 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
23 # combo is not yet good at debugging inlined
24 diff -ru a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk
25 --- a/a/nss/cmd/platlibs.mk 2014-09-29 16:46:38.306422654 +0100
26 +++ b/b/nss/cmd/platlibs.mk 2014-09-29 16:47:42.987012253 +0100
29 ifeq ($(OS_ARCH), SunOS)
31 -EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
32 +#In OOo we would probable put the executables next to libs
33 +EXTRA_SHARED_LIBS += -R '$$ORIGIN'
35 -EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
36 +EXTRA_SHARED_LIBS += -R '$$ORIGIN'
40 +ifeq ($(OS_ARCH), FreeBSD)
41 +EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
44 ifeq ($(OS_ARCH), Linux)
46 -EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
47 +EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
49 -EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
50 +EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
54 diff -ru nss.orig/nss/coreconf/arch.mk nss/nss/coreconf/arch.mk
55 --- a/nss.orig/nss/coreconf/arch.mk 2016-02-12 15:36:18.000000000 +0100
56 +++ b/nss/nss/coreconf/arch.mk 2016-02-23 20:48:31.595941079 +0100
58 OBJDIR_NAME_COMPILER = $(COMPILER_TAG)
60 OBJDIR_NAME_BASE = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(OBJDIR_NAME_COMPILER)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG)
61 -OBJDIR_NAME = $(OBJDIR_NAME_BASE).OBJ
62 +# OBJDIR_NAME is used to build the directory containing the built objects, for
63 +# example mozilla/dist/Linux2.6_x86_glibc_PTH_DBG.OBJ
64 +# We need to deliver the contents of that folder into instdir. To make that
65 +# easier in the makefile we rename this directory to "out".
66 +#OBJDIR_NAME = $(OBJDIR_NAME_BASE).OBJ
70 ifeq (,$(filter-out WIN%,$(OS_TARGET)))
72 +ifdef THIS_HAS_BEEN_DISABLED_TO_GET_out
75 # Define USE_DEBUG_RTL if you want to use the debug runtime library
76 # (RTL) in the debug build
77 diff -ru a/nss/coreconf/FreeBSD.mk b/nss/coreconf/FreeBSD.mk
78 --- a/a/nss/coreconf/FreeBSD.mk 2014-09-29 16:46:38.189421588 +0100
79 +++ b/b/nss/coreconf/FreeBSD.mk 2014-09-29 16:47:42.984012225 +0100
83 DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@)
84 +DSO_LDOPTS += -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
87 # The default implementation strategy for FreeBSD is pthreads.
88 diff -ru a/nss/coreconf/Linux.mk b/nss/coreconf/Linux.mk
89 --- a/a/nss/coreconf/Linux.mk 2014-09-29 16:46:38.189421588 +0100
90 +++ b/b/nss/coreconf/Linux.mk 2014-09-29 16:47:42.985012235 +0100
92 # against the libsanitizer runtime built into the main executable.
93 ZDEFS_FLAG = -Wl,-z,defs
95 -DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG))
96 +DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
98 LDFLAGS += $(ARCHFLAG)
104 +ifneq ($(SYSTEM_ZLIB),)
105 +# Currently (3.12.4) only the tools modutil and signtool are linked with libz
106 +# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
107 +# is also built in nss.
112 # The -rpath '$$ORIGIN' linker option instructs this library to search for its
113 # dependencies in the same directory where it resides.
114 diff -ru a/nss/coreconf/rules.mk b/nss/coreconf/rules.mk
115 --- a/a/nss/coreconf/rules.mk 2014-09-29 16:46:38.188421578 +0100
116 +++ b/b/nss/coreconf/rules.mk 2014-09-29 16:47:42.986012244 +0100
118 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
119 $(AR) $(subst /,\\,$(OBJS))
122 + $(AR) cr $@ $(OBJS)
126 diff -ru a/nss/coreconf/SunOS5.mk b/nss/coreconf/SunOS5.mk
127 --- a/a/nss/coreconf/SunOS5.mk 2014-09-29 16:46:38.175421471 +0100
128 +++ b/b/nss/coreconf/SunOS5.mk 2014-09-29 16:47:42.985012235 +0100
130 # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
135 +# CC is taken from environment automatically.
137 +# Use CXX from environment.
142 OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
144 diff -ru a/nss/Makefile b/nss/Makefile
145 --- a/a/nss/Makefile 2014-09-29 16:46:38.171421425 +0100
146 +++ b/b/nss/Makefile 2014-09-29 16:47:42.987012253 +0100
152 # This Source Code Form is subject to the terms of the Mozilla Public
154 NSPR_CONFIGURE_ENV = CC=gcc CXX=g++
157 -NSPR_CONFIGURE_ENV = CC=$(CC)
158 +NSPR_CONFIGURE_ENV = CC="$(CC) "
161 -NSPR_CONFIGURE_ENV += CXX=$(CCC)
162 +NSPR_CONFIGURE_ENV += CXX="$(CCC) "
164 # Remove -arch definitions. NSPR can't handle that.
165 NSPR_CONFIGURE_ENV := $(filter-out -arch x86_64,$(NSPR_CONFIGURE_ENV))
166 diff -ru nss.orig/nss/coreconf/Werror.mk nss/nss/coreconf/Werror.mk
167 --- a/nss.orig/nss/coreconf/Werror.mk 2016-02-12 15:36:18.000000000 +0100
168 +++ b/nss/nss/coreconf/Werror.mk 2016-02-23 23:58:15.119584046 +0100
170 endif #ndef NSS_ENABLE_WERROR
172 ifeq ($(NSS_ENABLE_WERROR),1)
173 - WARNING_CFLAGS += -Werror
174 +# We do not treat warnings as errors.
175 +# WARNING_CFLAGS += -Werror
177 # Old versions of gcc (< 4.8) don't support #pragma diagnostic in functions.
178 # Use this to disable use of that #pragma and the warnings it suppresses.