aboutsummaryrefslogtreecommitdiff
path: root/libs/nss/patches/003-openwrt_fix.patch
blob: fd2bf43a66da7b849070034e7e23e65a0bb6e106 (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
--- a/nss/lib/dbm/src/dirent.h
+++ b/nss/lib/dbm/src/dirent.h
@@ -30,7 +30,7 @@
 #define MAXNAMLEN FILENAME_MAX
 
 #else
-#include <param.h>
+#include <sys/param.h>
 #endif
 #endif
 
--- a/nss/coreconf/rules.mk
+++ b/nss/coreconf/rules.mk
@@ -176,7 +176,7 @@ $(LIBRARY): $(OBJS) | $$(@D)/d
 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
 	$(AR) $(subst /,\\,$(OBJS))
 else
-	$(AR) $(OBJS)
+	$(AR) rcs $@ $(OBJS)
 endif
 	$(RANLIB) $@
 
--- a/nss/coreconf/arch.mk
+++ b/nss/coreconf/arch.mk
@@ -306,7 +306,7 @@ else
     OBJDIR_NAME_COMPILER = $(COMPILER_TAG)
 endif
 OBJDIR_NAME_BASE = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(OBJDIR_NAME_COMPILER)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG)
-OBJDIR_NAME = $(OBJDIR_NAME_BASE).OBJ
+OBJDIR_NAME = build_dir
 
 
 ifeq (,$(filter-out WIN%,$(OS_TARGET)))
--- a/nss/coreconf/Linux.mk
+++ b/nss/coreconf/Linux.mk
@@ -108,11 +108,6 @@ LIBC_TAG		= _glibc
 endif
 
 ifdef BUILD_OPT
-ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
-	OPTIMIZER = -Os
-else
-	OPTIMIZER = -O2
-endif
 ifdef MOZ_DEBUG_SYMBOLS
 	ifdef MOZ_DEBUG_FLAGS
 		OPTIMIZER += $(MOZ_DEBUG_FLAGS)
@@ -144,7 +139,8 @@ ifdef USE_PTHREADS
 	DEFINES		+= -D_REENTRANT
 endif
 
-DSO_CFLAGS		= -fPIC
+ifndef USE_NATIVE
+DSO_CFLAGS		= $(fpic)
 DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--gc-sections
 # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
 # incorrectly reports undefined references in the libraries we link with, so
@@ -154,6 +150,7 @@ DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--
 ZDEFS_FLAG		= -Wl,-z,defs
 DSO_LDOPTS		+= $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG))
 LDFLAGS			+= $(ARCHFLAG) -z noexecstack
+endif
 
 # On Maemo, we need to use the -rpath-link flag for even the standard system
 # library directories.
@@ -195,7 +192,7 @@ RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/pr
 endif
 endif
 
-MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
+MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) $(fpic) -Wl,--gc-sections,--as-needed
 
 ifdef MAPFILE
 	MKSHLIB += -Wl,--version-script,$(MAPFILE)
--- a/nss/coreconf/UNIX.mk
+++ b/nss/coreconf/UNIX.mk
@@ -10,7 +10,6 @@ AR          = ar cr $@
 LDOPTS     += -L$(SOURCE_LIB_DIR)
 
 ifdef BUILD_OPT
-	OPTIMIZER  += -O
 	DEFINES    += -UDEBUG -DNDEBUG
 else
 	OPTIMIZER  += -g