From owner-svn-ports-all@freebsd.org Sun May 13 08:21:49 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AC2AFCDD50; Sun, 13 May 2018 08:21:49 +0000 (UTC) (envelope-from bhughes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F2096CA7B; Sun, 13 May 2018 08:21:49 +0000 (UTC) (envelope-from bhughes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1006E29A4; Sun, 13 May 2018 08:21:49 +0000 (UTC) (envelope-from bhughes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4D8LmWN039399; Sun, 13 May 2018 08:21:48 GMT (envelope-from bhughes@FreeBSD.org) Received: (from bhughes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4D8LlBB039392; Sun, 13 May 2018 08:21:47 GMT (envelope-from bhughes@FreeBSD.org) Message-Id: <201805130821.w4D8LlBB039392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bhughes set sender to bhughes@FreeBSD.org using -f From: "Bradley T. Hughes" Date: Sun, 13 May 2018 08:21:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r469781 - in head/www/node: . files X-SVN-Group: ports-head X-SVN-Commit-Author: bhughes X-SVN-Commit-Paths: in head/www/node: . files X-SVN-Commit-Revision: 469781 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2018 08:21:49 -0000 Author: bhughes Date: Sun May 13 08:21:47 2018 New Revision: 469781 URL: https://svnweb.freebsd.org/changeset/ports/469781 Log: www/node: fix SSL/TLS on i386 The upgrade to v10.0.0 included significant changes to the OpenSSL dependency in Node.js, in particular how the build was configured. Upstream does not include a BSD-x86 config anymore, so the www/node port ended up using the BSD-x86_64 no-asm config for all builds except x86_64 (which used the asm optimized config). This was a mistake, causing all 32-bit archs to build OpenSSL configured for a 64-bit architecture, and it causes problems with SSL/TLS as described in PR 228135. Change the build config to not use BSD-x86_64 no-asm for 32-bit i386 and arm builds, falling back to the generic linux-elf configuration instead. Patches remove Linux specific libraries (-ldl) and keep the CFLAGS the same as the BSD config. PR: 228135 Reported by: Marcin Cie\xc5\x9blak Added: head/www/node/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl-cl.gypi (contents, props changed) head/www/node/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl.gypi (contents, props changed) Deleted: head/www/node/files/patch-deps_openssl_openssl__no__asm.gypi Modified: head/www/node/Makefile head/www/node/files/patch-deps_openssl_config_bn__conf__no-asm.h head/www/node/files/patch-deps_openssl_config_dso__conf__no-asm.h head/www/node/files/patch-deps_openssl_config_opensslconf__no-asm.h head/www/node/files/patch-deps_openssl_openssl-cl__no__asm.gypi Modified: head/www/node/Makefile ============================================================================== --- head/www/node/Makefile Sun May 13 08:13:28 2018 (r469780) +++ head/www/node/Makefile Sun May 13 08:21:47 2018 (r469781) @@ -3,6 +3,7 @@ PORTNAME= node PORTVERSION= 10.1.0 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= http://nodejs.org/dist/v${PORTVERSION}/ @@ -76,7 +77,7 @@ IGNORE= cannot build node.js with LibreSSL. You must .include -.if ${ARCH} != amd64 +.if ${ARCH} != amd64 && ${ARCH} != i386 CONFIGURE_ARGS+=--openssl-no-asm .endif Added: head/www/node/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl-cl.gypi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/node/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl-cl.gypi Sun May 13 08:21:47 2018 (r469781) @@ -0,0 +1,15 @@ +--- deps/openssl/config/archs/linux-elf/no-asm/openssl-cl.gypi.orig 2018-05-11 11:01:14 UTC ++++ deps/openssl/config/archs/linux-elf/no-asm/openssl-cl.gypi +@@ -9,10 +9,10 @@ + 'OPENSSL_PIC', + ], + 'openssl_cflags_linux-elf': [ +- '-Wall -O3 -pthread -DL_ENDIAN -fomit-frame-pointer', ++ '-Wall -O3 -pthread -DL_ENDIAN', + ], + 'openssl_ex_libs_linux-elf': [ +- '-ldl -pthread', ++ '', + ], + 'openssl_cli_srcs_linux-elf': [ + 'openssl/apps/app_rand.c', Added: head/www/node/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl.gypi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/node/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl.gypi Sun May 13 08:21:47 2018 (r469781) @@ -0,0 +1,15 @@ +--- deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi.orig 2018-05-11 11:01:19 UTC ++++ deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi +@@ -652,10 +652,10 @@ + 'OPENSSL_PIC', + ], + 'openssl_cflags_linux-elf': [ +- '-Wall -O3 -pthread -DL_ENDIAN -fomit-frame-pointer', ++ '-Wall -O3 -pthread -DL_ENDIAN', + ], + 'openssl_ex_libs_linux-elf': [ +- '-ldl -pthread', ++ '', + ], + }, + 'include_dirs': [ Modified: head/www/node/files/patch-deps_openssl_config_bn__conf__no-asm.h ============================================================================== --- head/www/node/files/patch-deps_openssl_config_bn__conf__no-asm.h Sun May 13 08:13:28 2018 (r469780) +++ head/www/node/files/patch-deps_openssl_config_bn__conf__no-asm.h Sun May 13 08:21:47 2018 (r469781) @@ -1,15 +1,13 @@ ---- deps/openssl/config/bn_conf_no-asm.h.orig 2018-04-24 14:41:19 UTC +--- deps/openssl/config/bn_conf_no-asm.h.orig 2018-05-09 01:59:18 UTC +++ deps/openssl/config/bn_conf_no-asm.h -@@ -21,9 +21,9 @@ +@@ -21,8 +21,8 @@ # include "./archs/VC-WIN32/no-asm/crypto/include/internal/bn_conf.h" #elif defined(_WIN32) && defined(_M_X64) # include "./archs/VC-WIN64A/no-asm/crypto/include/internal/bn_conf.h" -#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) -# include "./archs/BSD-x86/no-asm/crypto/include/internal/bn_conf.h" --#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +//#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +//# include "./archs/BSD-x86/no-asm/crypto/include/internal/bn_conf.h" -+#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) // && defined(__x86_64__) + #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) # include "./archs/BSD-x86_64/no-asm/crypto/include/internal/bn_conf.h" #elif defined(__sun) && defined(__i386__) - # include "./archs/solaris-x86-gcc/no-asm/crypto/include/internal/bn_conf.h" Modified: head/www/node/files/patch-deps_openssl_config_dso__conf__no-asm.h ============================================================================== --- head/www/node/files/patch-deps_openssl_config_dso__conf__no-asm.h Sun May 13 08:13:28 2018 (r469780) +++ head/www/node/files/patch-deps_openssl_config_dso__conf__no-asm.h Sun May 13 08:21:47 2018 (r469781) @@ -1,15 +1,13 @@ ---- deps/openssl/config/dso_conf_no-asm.h.orig 2018-04-24 14:41:19 UTC +--- deps/openssl/config/dso_conf_no-asm.h.orig 2018-05-09 01:59:18 UTC +++ deps/openssl/config/dso_conf_no-asm.h -@@ -21,9 +21,9 @@ +@@ -21,8 +21,8 @@ # include "./archs/VC-WIN32/no-asm/crypto/include/internal/dso_conf.h" #elif defined(_WIN32) && defined(_M_X64) # include "./archs/VC-WIN64A/no-asm/crypto/include/internal/dso_conf.h" -#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) -# include "./archs/BSD-x86/no-asm/crypto/include/internal/dso_conf.h" --#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +//#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +//# include "./archs/BSD-x86/no-asm/crypto/include/internal/dso_conf.h" -+#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) // && defined(__x86_64__) + #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) # include "./archs/BSD-x86_64/no-asm/crypto/include/internal/dso_conf.h" #elif defined(__sun) && defined(__i386__) - # include "./archs/solaris-x86-gcc/no-asm/crypto/include/internal/dso_conf.h" Modified: head/www/node/files/patch-deps_openssl_config_opensslconf__no-asm.h ============================================================================== --- head/www/node/files/patch-deps_openssl_config_opensslconf__no-asm.h Sun May 13 08:13:28 2018 (r469780) +++ head/www/node/files/patch-deps_openssl_config_opensslconf__no-asm.h Sun May 13 08:21:47 2018 (r469781) @@ -1,15 +1,13 @@ ---- deps/openssl/config/opensslconf_no-asm.h.orig 2018-04-24 14:41:19 UTC +--- deps/openssl/config/opensslconf_no-asm.h.orig 2018-05-09 01:59:18 UTC +++ deps/openssl/config/opensslconf_no-asm.h -@@ -16,9 +16,9 @@ +@@ -16,8 +16,8 @@ # include "./archs/VC-WIN32/no-asm/include/openssl/opensslconf.h" #elif defined(_WIN32) && defined(_M_X64) # include "./archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h" -#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) -# include "./archs/BSD-x86/no-asm/include/openssl/opensslconf.h" --#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) +//#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) +//# include "./archs/BSD-x86/no-asm/include/openssl/opensslconf.h" -+#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) // && defined(__x86_64__) + #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) # include "./archs/BSD-x86_64/no-asm/include/openssl/opensslconf.h" #elif defined(__sun) && defined(__i386__) - # include "./archs/solaris-x86-gcc/no-asm/include/openssl/opensslconf.h" Modified: head/www/node/files/patch-deps_openssl_openssl-cl__no__asm.gypi ============================================================================== --- head/www/node/files/patch-deps_openssl_openssl-cl__no__asm.gypi Sun May 13 08:13:28 2018 (r469780) +++ head/www/node/files/patch-deps_openssl_openssl-cl__no__asm.gypi Sun May 13 08:21:47 2018 (r469781) @@ -1,23 +1,17 @@ ---- deps/openssl/openssl-cl_no_asm.gypi.orig 2018-04-24 14:41:19 UTC +--- deps/openssl/openssl-cl_no_asm.gypi.orig 2018-05-11 10:11:27 UTC +++ deps/openssl/openssl-cl_no_asm.gypi -@@ -1,6 +1,10 @@ +@@ -1,4 +1,5 @@ { + 'defines': ['OPENSSL_NO_ASM'], 'conditions': [ -- ['target_arch=="ppc" and OS=="aix"', { -+ ['OS=="freebsd"', { -+ # noasm BSD-x86_64 for all FreeBSD archs -+ 'includes': ['config/archs/BSD-x86_64/no-asm/openssl-cl.gypi'], -+ }, 'target_arch=="ppc" and OS=="aix"', { + ['target_arch=="ppc" and OS=="aix"', { 'includes': ['config/archs/aix-gcc/no-asm/openssl-cl.gypi'], - }, 'target_arch=="ppc" and OS=="linux"', { - 'includes': ['config/archs/linux-ppc/no-asm/openssl-cl.gypi'], -@@ -29,8 +33,6 @@ - }, 'target_arch=="ia32"', { - # noasm linux-elf for other ia32 platforms - 'includes': ['config/archs/linux-elf/no-asm/openssl-cl.gypi'], -- }, 'target_arch=="x64" and OS=="freebsd"', { -- 'includes': ['config/archs/BSD-x86_64/no-asm/openssl-cl.gypi'], - }, 'target_arch=="x64" and OS=="mac"', { - 'includes': ['config/archs/darwin64-x86_64-cc/no-asm/openssl-cl.gypi'], - }, 'target_arch=="x64" and OS=="solaris"', { +@@ -41,7 +42,7 @@ + 'includes': ['config/archs/linux-x86_64/no-asm/openssl-cl.gypi'], + }, { + # Other architectures don't use assembly +- 'includes': ['config/archs/linux-x86_64/no-asm/openssl-cl.gypi'], ++ 'includes': ['config/archs/linux-elf/no-asm/openssl-cl.gypi'], + }], + ], + }