Pull in openssl from upstream master
authorRISCi_ATOM <bob@bobcall.me>
Thu, 28 Jun 2018 17:08:04 +0000 (13:08 -0400)
committerRISCi_ATOM <bob@bobcall.me>
Thu, 28 Jun 2018 17:08:04 +0000 (13:08 -0400)
package/libs/openssl/Config.in
package/libs/openssl/Makefile
package/libs/openssl/patches/110-optimize-for-size.patch
package/libs/openssl/patches/150-no_engines.patch
package/libs/openssl/patches/160-disable_doc_tests.patch
package/libs/openssl/patches/200-parallel_build.patch

index dbcd11abfc00bd75ac6a585ee5bb47d910d23704..96d3ba3e9d69c15b5e30d1d07a55581e1bce7928 100644 (file)
@@ -55,8 +55,14 @@ config OPENSSL_HARDWARE_SUPPORT
        default n
        prompt "Enable hardware support"
 
+config OPENSSL_OPTIMIZE_SPEED
+       bool
+       default n
+       prompt "Enable optimization for speed instead of size"
+
 endif
 
 config OPENSSL_ENGINE_CRYPTO
        bool
+       select OPENSSL_HARDWARE_SUPPORT
        prompt "Crypto acceleration support" if PACKAGE_libopenssl
index caecebf2545cb5e2a5c8da77465835d674d944ea..8409730d706f2a8611471f2d7d87602dc1fe78c5 100644 (file)
@@ -18,16 +18,17 @@ PKG_BUILD_PARALLEL:=0
 
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.openssl.org/source/ \
-       ftp://ftp.openssl.org/source/ \
-       http://www.openssl.org/source/old/$(PKG_BASE)/ \
-       ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \
-       ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
-
+PKG_SOURCE_URL:= \
+       http://ftp.fi.muni.cz/pub/openssl/source/ \
+       http://ftp.linux.hr/pub/openssl/source/ \
+       http://gd.tuwien.ac.at/infosys/security/openssl/source/ \
+       http://www.openssl.org/source/ \
+       http://www.openssl.org/source/old/$(PKG_BASE)/
 PKG_HASH:=ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d
 
 PKG_LICENSE:=OpenSSL
 PKG_LICENSE_FILES:=LICENSE
+PKG_CPE_ID:=cpe:/a:openssl:openssl
 PKG_CONFIG_DEPENDS:= \
        CONFIG_OPENSSL_ENGINE_CRYPTO \
        CONFIG_OPENSSL_ENGINE_DIGEST \
@@ -40,7 +41,8 @@ PKG_CONFIG_DEPENDS:= \
        CONFIG_OPENSSL_WITH_COMPRESSION \
        CONFIG_OPENSSL_WITH_NPN \
        CONFIG_OPENSSL_WITH_PSK \
-       CONFIG_OPENSSL_WITH_SRP
+       CONFIG_OPENSSL_WITH_SRP \
+       CONFIG_OPENSSL_OPTIMIZE_SPEED
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -154,6 +156,10 @@ ifndef CONFIG_OPENSSL_WITH_SRP
   OPENSSL_OPTIONS += no-srp
 endif
 
+ifeq ($(CONFIG_OPENSSL_OPTIMIZE_SPEED),y)
+  TARGET_CFLAGS := $(filter-out -Os,$(TARGET_CFLAGS)) -O3
+endif
+
 ifeq ($(CONFIG_x86_64),y)
   OPENSSL_TARGET:=linux-x86_64-openwrt
   OPENSSL_MAKEFLAGS += LIBDIR=lib
@@ -161,6 +167,8 @@ else
   OPENSSL_OPTIONS+=no-sse2
   ifeq ($(CONFIG_mips)$(CONFIG_mipsel),y)
     OPENSSL_TARGET:=linux-mips-openwrt
+  else ifeq ($(CONFIG_aarch64),y)
+    OPENSSL_TARGET:=linux-aarch64-openwrt
   else ifeq ($(CONFIG_arm)$(CONFIG_armeb),y)
     OPENSSL_TARGET:=linux-armv4-openwrt
   else
@@ -182,14 +190,12 @@ define Build/Configure
                        --openssldir=/etc/ssl \
                        $(TARGET_CPPFLAGS) \
                        $(TARGET_LDFLAGS) -ldl \
-                       -DOPENSSL_SMALL_FOOTPRINT \
+                       $(if $(CONFIG_OPENSSL_OPTIMIZE_SPEED),,-DOPENSSL_SMALL_FOOTPRINT) \
                        $(OPENSSL_NO_CIPHERS) \
                        $(OPENSSL_OPTIONS) \
        )
-       # XXX: OpenSSL "make depend" will look for installed headers before its own,
-       # so remove installed stuff first
-       -$(SUBMAKE) -j1 clean-staging
        +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               CROSS_COMPILE="$(TARGET_CROSS)" \
                MAKEDEPPROG="$(TARGET_CROSS)gcc" \
                OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
                $(OPENSSL_MAKEFLAGS) \
@@ -201,6 +207,7 @@ TARGET_LDFLAGS += -Wl,--gc-sections
 
 define Build/Compile
        +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               CROSS_COMPILE="$(TARGET_CROSS)" \
                CC="$(TARGET_CC)" \
                ASFLAGS="$(TARGET_ASFLAGS) -I$(PKG_BUILD_DIR)/crypto -c" \
                AR="$(TARGET_CROSS)ar r" \
@@ -209,6 +216,7 @@ define Build/Compile
                $(OPENSSL_MAKEFLAGS) \
                all
        +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               CROSS_COMPILE="$(TARGET_CROSS)" \
                CC="$(TARGET_CC)" \
                ASFLAGS="$(TARGET_ASFLAGS) -I$(PKG_BUILD_DIR)/crypto -c" \
                AR="$(TARGET_CROSS)ar r" \
@@ -219,11 +227,13 @@ define Build/Compile
        # Work around openssl build bug to link libssl.so with libcrypto.so.
        -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
        +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               CROSS_COMPILE="$(TARGET_CROSS)" \
                CC="$(TARGET_CC)" \
                OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
                $(OPENSSL_MAKEFLAGS) \
                do_linux-shared
        $(MAKE) -C $(PKG_BUILD_DIR) \
+               CROSS_COMPILE="$(TARGET_CROSS)" \
                CC="$(TARGET_CC)" \
                INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
                $(OPENSSL_MAKEFLAGS) \
index 0f174a34694ec163d064d6baa05a594183e3fa21..d6d4a211110f8a135257270f1a0bab2085d0f86e 100644 (file)
@@ -1,11 +1,12 @@
 --- a/Configure
 +++ b/Configure
-@@ -470,6 +470,12 @@ my %table=(
+@@ -470,6 +470,13 @@ my %table=(
  "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
  "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
  
 +# OpenWrt targets
 +"linux-armv4-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-aarch64-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 +"linux-x86_64-openwrt",       "gcc:-m64 -DL_ENDIAN -DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 +"linux-mips-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 +"linux-generic-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
index 1cb04bdabbe65361bb2cf021d9fccb29473b663d..102e7a3272967ca5f7ecf2c76a89d3620d5a8fed 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Configure
 +++ b/Configure
-@@ -2130,6 +2130,11 @@ EOF
+@@ -2136,6 +2136,11 @@ EOF
        close(OUT);
    }
    
index 73459ff90584bc2ae8f215a5a771bf5e15f303e2..e38d44a768cb5c93eb76ddc946dd74dc8eb50f92 100644 (file)
@@ -36,7 +36,7 @@
  
  build_libs: build_libcrypto build_libssl openssl.pc
  
-@@ -534,7 +534,7 @@ dist:
+@@ -542,7 +542,7 @@ dist:
        @$(MAKE) SDIRS='$(SDIRS)' clean
        @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
  
@@ -47,7 +47,7 @@
        @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
 --- a/Makefile.org
 +++ b/Makefile.org
-@@ -532,7 +532,7 @@ dist:
+@@ -540,7 +540,7 @@ dist:
        @$(MAKE) SDIRS='$(SDIRS)' clean
        @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
  
index f1d9f0705194c27a31a283da0b7728fefa576fda..0616551b6e75c7cf93a3bf5aed94d9528ce9a55e 100644 (file)
@@ -24,7 +24,7 @@
  
  all_testapps: build_libs build_testapps
  build_testapps:
-@@ -465,7 +465,7 @@ update: errors stacks util/libeay.num ut
+@@ -473,7 +473,7 @@ update: errors stacks util/libeay.num ut
        @set -e; target=update; $(RECURSIVE_BUILD_CMD)
  
  depend:
@@ -33,7 +33,7 @@
  
  lint:
        @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
-@@ -527,9 +527,9 @@ dist:
+@@ -535,9 +535,9 @@ dist:
        @$(MAKE) SDIRS='$(SDIRS)' clean
        @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
  
@@ -45,7 +45,7 @@
        @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
                $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
                $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
-@@ -538,12 +538,19 @@ install_sw:
+@@ -546,12 +546,19 @@ install_sw:
                $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
                $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
                $(INSTALL_PREFIX)$(OPENSSLDIR)/private
@@ -66,7 +66,7 @@
        @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
        do \
                if [ -f "$$i" ]; then \
-@@ -627,12 +634,7 @@ install_html_docs:
+@@ -635,12 +642,7 @@ install_html_docs:
                done; \
        done
  
        ctags $(SRC)
 --- a/test/Makefile
 +++ b/test/Makefile
-@@ -144,7 +144,7 @@ install:
+@@ -145,7 +145,7 @@ install:
  tags:
        ctags $(SRC)
  
  
  apps:
        @(cd ..; $(MAKE) DIRS=apps all)
-@@ -577,7 +577,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl
+@@ -586,7 +586,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl
  #     fi
  
  dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)