svn commit: r469781 - in head/www/node: . files
Bradley T. Hughes
bhughes at FreeBSD.org
Sun May 13 08:21:49 UTC 2018
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 <saper at saper.info>
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 <bsd.port.pre.mk>
-.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'],
+ }],
+ ],
+ }
More information about the svn-ports-all
mailing list