summaryrefslogtreecommitdiff
path: root/nss/nss.patch
blob: e2d7d7653308d3c64ee321fffd843c69ed0cb237 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
--- misc/nss-3.13.5/mozilla/nsprpub/configure	2010-02-08 19:41:35.000000000 +0100
+++ misc/build/nss-3.13.5/mozilla/nsprpub/configure	2010-06-11 16:35:54.960188991 +0200
@@ -3900,7 +3900,7 @@
     PR_MD_CSRCS=linux.c
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
     DSO_CFLAGS=-fPIC
-    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
+    DSO_LDOPTS='-shared -Wl,-z,origin -Wl,-rpath,\$$ORIGIN -Wl,-soname -Wl,$(notdir $@)'
     _OPTIMIZE_FLAGS=-O2
     _DEBUG_FLAGS="-g -fno-inline"  # most people on linux use gcc/gdb, and that
                                    # combo is not yet good at debugging inlined
--- misc/nss-3.13.5/mozilla/security/coreconf/Darwin.mk	2010-02-04 19:59:10.000000000 +0100
+++ misc/build/nss-3.13.5/mozilla/security/coreconf/Darwin.mk	2010-06-11 16:35:54.966185975 +0200
@@ -39,8 +39,12 @@
 
 DEFAULT_COMPILER = gcc
 
-CC		= gcc
-CCC		= g++
+# CC is taken from environment automatically.
+#CC		= cc
+# Use CCC from environment.
+#CCC		= c++
+CCC		= $(CXX)
+
 RANLIB		= ranlib
 
 ifndef CPU_ARCH
@@ -57,19 +57,25 @@
 
 ifeq (,$(filter-out i%86,$(CPU_ARCH)))
 ifdef USE_64
+ifeq (,$(findstring -arch ,$(CC)))
 CC              += -arch x86_64
+endif
 override CPU_ARCH	= x86_64
 else
 OS_REL_CFLAGS	= -Di386
+ifeq (,$(findstring -arch ,$(CC)))
 CC              += -arch i386
+endif
 override CPU_ARCH	= x86
 endif
 else
 ifeq (arm,$(CPU_ARCH))
 # Nothing set for arm currently.
 else
 OS_REL_CFLAGS	= -Dppc
+ifeq (,$(findstring -arch ,$(CC)))
 CC              += -arch ppc
+endif
 endif
 endif
 
--- misc/nss-3.13.5/mozilla/security/coreconf/FreeBSD.mk	2009-11-23 05:06:29.000000000 -0500
+++ misc/build/nss-3.13.5/mozilla/security/coreconf/FreeBSD.mk	2012-08-28 20:27:20.000000000 -0400
@@ -57,6 +57,7 @@
 
 DSO_CFLAGS		= -fPIC
 DSO_LDOPTS		= -shared -Wl,-soname -Wl,$(notdir $@)
+DSO_LDOPTS		+= -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
 
 #
 # The default implementation strategy for FreeBSD is pthreads.
--- misc/nss-3.13.5/mozilla/security/coreconf/Linux.mk	2010-01-15 23:19:00.000000000 +0100
+++ misc/build/nss-3.13.5/mozilla/security/coreconf/Linux.mk	2010-06-11 16:35:54.981151732 +0200
@@ -46,8 +46,11 @@
 	IMPL_STRATEGY = _PTH
 endif
 
-CC			= gcc
-CCC			= g++
+# CC is taken from environment automatically.
+#CC			= gcc
+# Use CCC from environment.
+#CCC			= g++
+CCC		= $(CXX)
 RANLIB			= ranlib
 
 DEFAULT_COMPILER = gcc
@@ -147,7 +150,7 @@
 # incorrectly reports undefined references in the libraries we link with, so
 # we don't use -z defs there.
 ZDEFS_FLAG		= -Wl,-z,defs
-DSO_LDOPTS		+= $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG))
+DSO_LDOPTS		+= $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
 LDFLAGS			+= $(ARCHFLAG)
 
 # On Maemo, we need to use the -rpath-link flag for even the standard system
@@ -158,8 +161,13 @@
 endif
 endif
 
+ifeq ($(SYSTEM_ZLIB),YES)  
+# Currently (3.12.4) only the tools modutil and signtool are linked with libz
+# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
+# is also build in nss.
 USE_SYSTEM_ZLIB = 1
 ZLIB_LIBS = -lz
+endif
 
 # The -rpath '$$ORIGIN' linker option instructs this library to search for its
 # dependencies in the same directory where it resides.
--- misc/nss-3.13.5/mozilla/security/coreconf/SunOS5.mk	2009-06-11 02:55:32.000000000 +0200
+++ misc/build/nss-3.13.5/mozilla/security/coreconf/SunOS5.mk	2010-06-11 16:35:54.985571182 +0200
@@ -89,8 +89,12 @@
 	    # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
 	endif
 else
-	CC         = cc
-	CCC        = CC
+# CC is taken from environment automatically.
+#	CC         = cc
+# Use CXX from environment.
+#	CCC        = CC
+        CCC       = $(CXX)
+
 	ASFLAGS   += -Wa,-P
 	OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
 	ifndef BUILD_OPT
--- misc/nss-3.13.5/mozilla/security/coreconf/arch.mk	2009-06-05 04:14:49.000000000 +0200
+++ misc/build/nss-3.13.5/mozilla/security/coreconf/arch.mk	2010-06-11 16:35:54.990913282 +0200
@@ -324,10 +324,15 @@
 # IMPL_STRATEGY may be defined too.
 #
 
-OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
+# OBJDIR_NAME is used to build the directory containing the built objects, for 
+# example mozilla/dist/Linux2.6_x86_glibc_PTH_DBG.OBJ
+# We need to deliver the contents of that folder into the solver. To make that easier
+# in the makefile we rename this directory to "out". 
+#OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
+OBJDIR_NAME = out
 
 ifeq (,$(filter-out WIN%,$(OS_TARGET)))
-ifndef BUILD_OPT
+ifdef THIS_HAS_BEEN_DISABLED_TO_GET_out
 #
 # Define USE_DEBUG_RTL if you want to use the debug runtime library
 # (RTL) in the debug build
--- misc/nss-3.13.5/mozilla/security/coreconf/rules.mk
+++ misc/build/nss-3.13.5/mozilla/security/coreconf/rules.mk
@@ -293,7 +293,7 @@
 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
 	$(AR) $(subst /,\\,$(OBJS))
 else
-	$(AR) $(OBJS)
+	$(AR) cr $@ $(OBJS)
 endif
 	$(RANLIB) $@
 
--- misc/nss-3.13.5/mozilla/security/nss/Makefile
+++ misc/build/nss-3.13.5/mozilla/security/nss/Makefile
@@ 1,0 +1,0 @@
+export AR
+export RANLIB
 #! gmake
 #
 # ***** BEGIN LICENSE BLOCK *****
--- misc/nss-3.13.5/mozilla/security/nss/cmd/platlibs.mk	2010-02-04 19:59:10.000000000 +0100
+++ misc/build/nss-3.13.5/mozilla/security/nss/cmd/platlibs.mk	2010-06-11 16:35:55.004869805 +0200
@@ -41,27 +41,32 @@
 ifeq ($(OS_ARCH), SunOS) 
 ifeq ($(BUILD_SUN_PKG), 1)
 ifeq ($(USE_64), 1)
-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
+#In OOo we would probable put the executables next to libs
+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
 else
-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
 endif
 else
-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib'
+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
 endif
 endif
 
+ifeq ($(OS_ARCH), FreeBSD)
+EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
+endif
+
 ifeq ($(OS_ARCH), Linux)
 ifeq ($(BUILD_SUN_PKG), 1)
 ifeq ($(USE_64), 1)
-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
+EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
 else
-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
+EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
 endif
 else
 ifeq ($(USE_64), 1)
-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:$$ORIGIN/../lib'
+EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
 else
-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib'
+EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
 endif
 endif
 endif
--- misc/nss-3.13.5/mozilla/security/nss/cmd/shlibsign/Makefile	2009-08-07 21:06:37.000000000 +0200
+++ misc/build/nss-3.13.5/mozilla/security/nss/cmd/shlibsign/Makefile	2010-06-11 16:35:55.009851148 +0200
@@ -78,10 +78,15 @@
 
 # sign any and all shared libraries that contain the word freebl
 
-CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
-CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
+# Signing causes loading of some system library which in turn loads
+# libsqlite3. Then it loads libsqulite3 from nss, which does not have the proper
+# version. Therefore signing fails.
+# We cannot build with the system sqlite3, because it is too old (SDK
+# 10.4). Otherwise one could set NSS_USE_SYSTEM_SQLITE=1 and use the system lib. 
+#CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
+#CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
 ifndef NSS_DISABLE_DBM
-CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
+#CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
 endif
 CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk)
 
--- misc/nss-3.13.5/mozilla/security/coreconf/Darwin.mk
+++ misc/build/nss-3.13.5/mozilla/security/coreconf/Darwin.mk
@@ -64,12 +64,16 @@
 endif
 
 ifneq (,$(MACOS_SDK_DIR))
+    CLANG_VERSION_FULL := $(shell $(CC) -v 2>&1 | grep "clang version" | sed -e "s/^.*clang version[  ]*//" | awk '{ print $$1 }')
     GCC_VERSION_FULL := $(shell $(CC) -dumpversion)
     GCC_VERSION_MAJOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$1 }')
     GCC_VERSION_MINOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$2 }')
     GCC_VERSION = $(GCC_VERSION_MAJOR).$(GCC_VERSION_MINOR)
+    ifneq (,$(CLANG_VERSION_FULL))
+        DARWIN_SDK_CFLAGS = -isysroot $(MACOS_SDK_DIR)
+        DARWIN_SDK_SHLIBFLAGS = -isysroot $(MACOS_SDK_DIR)
 
-    ifeq (,$(filter-out 2 3,$(GCC_VERSION_MAJOR)))
+    else ifeq (,$(filter-out 2 3,$(GCC_VERSION_MAJOR)))
         # GCC <= 3
         DARWIN_SDK_FRAMEWORKS = -F$(MACOS_SDK_DIR)/System/Library/Frameworks
         ifneq (,$(shell find $(MACOS_SDK_DIR)/Library/Frameworks -maxdepth 0))