Browse Source

nss: add -flto and makefile cleanup

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
lilik-openwrt-22.03
Lucian Cristian 5 years ago
parent
commit
47570b4cf5
2 changed files with 32 additions and 26 deletions
  1. +23
    -26
      libs/nss/Makefile
  2. +9
    -0
      libs/nss/patches/003-openwrt_fix.patch

+ 23
- 26
libs/nss/Makefile View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=nss
PKG_VERSION:=3.52
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= \
@ -62,37 +62,34 @@ ifeq ($(CONFIG_CPU_TYPE),"xscale")
TARGET_CFLAGS+= -mfloat-abi=softfp
endif
TARGET_CFLAGS += -D_GNU_SOURCE
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
export CROSS_COMPILE=1
export BUILD_OPT=1
TARGET_CFLAGS += -D_GNU_SOURCE -flto
export NATIVE_CC=$(HOSTCC)
export NATIVE_FLAGS=$(HOST_CFLAGS)
export NSDISTMODE=copy
export NSS_ENABLE_WERROR=0
export NSS_DISABLE_GTESTS=1
export NSS_USE_SYSTEM_SQLITE=1
export OS_TARGET=Linux
export OS_ARCH=Linux
export OS_TEST=$(ARCH)
export CPU_ARCH=$(ARCH)
export fpic=$(FPIC)
export NSPR_INCLUDE_DIR=$(STAGING_DIR)/usr/include/nspr
export SEED_ONLY_DEV_URANDOM=1
export OS_REL_CFLAGS=$(TARGET_CFLAGS)
export NS_USE_GCC=1
export FREEBL_NO_DEPEND=1
#size optimisation, seems to not impact speed
export NSS_DISABLE_DBM=1
export NSS_PKIX_NO_LDAP=1
export ALLOW_OPT_CODE_SIZE=1
export OPT_CODE_SIZE=1
MAKE_FLAGS += \
CROSS_COMPILE=1 \
BUILD_OPT=1 \
NSDISTMODE=copy \
NSS_DISABLE_GTESTS=1 \
NSS_USE_SYSTEM_SQLITE=1 \
OS_ARCH=Linux \
OS_TEST=$(ARCH) \
fpic=$(FPIC) \
NSPR_INCLUDE_DIR=$(STAGING_DIR)/usr/include/nspr \
SEED_ONLY_DEV_URANDOM=1 \
NS_USE_GCC=1 \
FREEBL_NO_DEPEND=1 \
NSS_DISABLE_DBM=1 \
NSS_PKIX_NO_LDAP=1 \
ALLOW_OPT_CODE_SIZE=1 \
OPT_CODE_SIZE=1 \
OS_REL_CFLAGS="$(TARGET_CFLAGS)"
#native compile nsinstall
define Build/Prepare
$(call Build/Prepare/Default)
USE_NATIVE=1 OS_REL_CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" CC="$(HOSTCC)" \
USE_NATIVE=1 OS_REL_CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" \
CC="$(HOSTCC)" CPU_ARCH="$(HOST_ARCH)" \
$(MAKE) -C $(PKG_BUILD_DIR)/nss/coreconf/nsinstall
endef


+ 9
- 0
libs/nss/patches/003-openwrt_fix.patch View File

@ -65,6 +65,15 @@
ifdef MOZ_DEBUG_SYMBOLS
ifdef MOZ_DEBUG_FLAGS
OPTIMIZER += $(MOZ_DEBUG_FLAGS)
@@ -192,7 +192,7 @@
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 2019-04-06 20:34:24.284157646 +0300
+++ b/nss/coreconf/UNIX.mk 2019-04-06 20:34:34.760485327 +0300
@@ -10,7 +10,6 @@


Loading…
Cancel
Save