1 diff -ru a/nspr/configure b/nspr/configure
2 --- a/a/nspr/configure 2014-09-29 16:46:38.427423757 +0100
3 +++ b/b/nspr/configure 2014-09-29 16:47:42.984012225 +0100
6 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
8 - DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
9 + DSO_LDOPTS='-shared -Wl,-z,origin -Wl,-rpath,\$$ORIGIN -Wl,-soname -Wl,$(notdir $@)'
11 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
12 # combo is not yet good at debugging inlined
13 diff -ru a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk
14 --- a/a/nss/cmd/platlibs.mk 2014-09-29 16:46:38.306422654 +0100
15 +++ b/b/nss/cmd/platlibs.mk 2014-09-29 16:47:42.987012253 +0100
18 ifeq ($(OS_ARCH), SunOS)
20 -EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
21 +#In OOo we would probable put the executables next to libs
22 +EXTRA_SHARED_LIBS += -R '$$ORIGIN'
24 -EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
25 +EXTRA_SHARED_LIBS += -R '$$ORIGIN'
29 +ifeq ($(OS_ARCH), FreeBSD)
30 +EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
33 ifeq ($(OS_ARCH), Linux)
35 -EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
36 +EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
38 -EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
39 +EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
43 diff -ru a/nss/coreconf/arch.mk b/nss/coreconf/arch.mk
44 --- a/a/nss/coreconf/arch.mk 2014-09-29 16:46:38.175421471 +0100
45 +++ b/b/nss/coreconf/arch.mk 2014-09-29 16:47:42.986012244 +0100
47 # IMPL_STRATEGY may be defined too.
50 -OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
51 +# OBJDIR_NAME is used to build the directory containing the built objects, for
52 +# example mozilla/dist/Linux2.6_x86_glibc_PTH_DBG.OBJ
53 +# We need to deliver the contents of that folder into instdir. To make that
54 +# easier in the makefile we rename this directory to "out".
55 +#OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
58 ifeq (,$(filter-out WIN%,$(OS_TARGET)))
60 +ifdef THIS_HAS_BEEN_DISABLED_TO_GET_out
62 # Define USE_DEBUG_RTL if you want to use the debug runtime library
63 # (RTL) in the debug build
64 diff -ru a/nss/coreconf/FreeBSD.mk b/nss/coreconf/FreeBSD.mk
65 --- a/a/nss/coreconf/FreeBSD.mk 2014-09-29 16:46:38.189421588 +0100
66 +++ b/b/nss/coreconf/FreeBSD.mk 2014-09-29 16:47:42.984012225 +0100
70 DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@)
71 +DSO_LDOPTS += -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
74 # The default implementation strategy for FreeBSD is pthreads.
75 diff -ru a/nss/coreconf/Linux.mk b/nss/coreconf/Linux.mk
76 --- a/a/nss/coreconf/Linux.mk 2014-09-29 16:46:38.189421588 +0100
77 +++ b/b/nss/coreconf/Linux.mk 2014-09-29 16:47:42.985012235 +0100
84 +# CC is taken from environment automatically.
86 +# Use CCC from environment.
91 DEFAULT_COMPILER = gcc
93 # incorrectly reports undefined references in the libraries we link with, so
94 # we don't use -z defs there.
95 ZDEFS_FLAG = -Wl,-z,defs
96 -DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG))
97 +DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
98 LDFLAGS += $(ARCHFLAG)
100 # On Maemo, we need to use the -rpath-link flag for even the standard system
105 +ifneq ($(SYSTEM_ZLIB),)
106 +# Currently (3.12.4) only the tools modutil and signtool are linked with libz
107 +# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
108 +# is also built in nss.
113 # The -rpath '$$ORIGIN' linker option instructs this library to search for its
114 # dependencies in the same directory where it resides.
115 diff -ru a/nss/coreconf/rules.mk b/nss/coreconf/rules.mk
116 --- a/a/nss/coreconf/rules.mk 2014-09-29 16:46:38.188421578 +0100
117 +++ b/b/nss/coreconf/rules.mk 2014-09-29 16:47:42.986012244 +0100
119 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
120 $(AR) $(subst /,\\,$(OBJS))
123 + $(AR) cr $@ $(OBJS)
127 diff -ru a/nss/coreconf/SunOS5.mk b/nss/coreconf/SunOS5.mk
128 --- a/a/nss/coreconf/SunOS5.mk 2014-09-29 16:46:38.175421471 +0100
129 +++ b/b/nss/coreconf/SunOS5.mk 2014-09-29 16:47:42.985012235 +0100
131 # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
136 +# CC is taken from environment automatically.
138 +# Use CXX from environment.
143 OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
145 diff -ru a/nss/Makefile b/nss/Makefile
146 --- a/a/nss/Makefile 2014-09-29 16:46:38.171421425 +0100
147 +++ b/b/nss/Makefile 2014-09-29 16:47:42.987012253 +0100
153 # This Source Code Form is subject to the terms of the Mozilla Public