pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/53758: lang/nodejs build error



The following reply was made to PR pkg/53758; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: pkg/53758: lang/nodejs build error
Date: Sat, 8 Dec 2018 23:14:03 +0900

 It seems there are several problems on pkgsrc-2018Q3 lang/nodejs
 for NetBSD/i386 8.0 (no problem on NetBSD/amd64 8.0):
 
 (1) There is no deps/openssl/config/archs/BSD-x86 for BSD ia32 systems
     in the distribution, but deps/openssl/config/opensslconf_asm.h
     still refers it for FreeBSD and OpenBSD (and NetBSD by pkgsrc patches).
 
 (2) According to comments in the opensslconf_asm.h, all ia32 systems
     that has no OS specific support imlicitly use
     deps/openssl/config/archs/linux-elf/asm for linux ia32.
 
 (3) But even for NetBSD/i386,
     deps/openssl/config/archs/linux-elf/asm/openssl-cl.gypi has
     Linux specific library (-ldl) definitions, so it causes link errors
     later.
 
 (4) Node.js seems to also use 64 bit atomic ops, so extra atomic libraries
     (or Pentium class CPUs) are required for __atomic_*_8() functions.
 
 I wrote a dumb patch to work around these issue:
 
 (1) Remove BSD-x86 leftovers in deps/openssl/config/opensslconf_asm.h
 
 (2) Use linux-elf for NetBSD/i386
     (no idea what we can do for non-x86 systems though)
 
 (3) Add a 'conditions' block to check linux for library definitions
     in deps/openssl/config/archs/linux-elf/asm/openssl-cl.gypi
 
 (4) Explicitly specify "CPPFLAGS+= i586" in Makefile.
     Also add "CPPFLAGS+= -mstackrealign for SSE instructions
     as pkgsrc/www/firefox/mozilla.mk does.
     (I'm not sure if these should rather be in Makefile.common though)
 
  https://gist.github.com/tsutsui/8f5d83a46dd317b8604071521bbec255
 
 ---
 ? patches/patch-deps_openssl_config_archs_linux-elf_asm_openssl-cl.gypi
 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/lang/nodejs/Makefile,v
 retrieving revision 1.145
 diff -u -p -d -r1.145 Makefile
 --- Makefile	20 Sep 2018 14:05:25 -0000	1.145
 +++ Makefile	8 Dec 2018 11:32:17 -0000
 @@ -23,6 +23,13 @@ CONFIGURE_ARGS+=	--with-intl=system-icu
  
  CHECK_PORTABILITY_SKIP+=	deps/openssl/openssl/.travis-create-release.sh
  
 +.if ${MACHINE_ARCH} == "i386"
 +# 64 bit atomic ops are required
 +CXXFLAGS+=		-march=i586
 +# required for SSE2 code under i386.
 +CXXFLAGS+=		-mstackrealign
 +.endif
 +
  .include "options.mk"
  
  .include "../../lang/nodejs/Makefile.common"
 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/lang/nodejs/distinfo,v
 retrieving revision 1.135
 diff -u -p -d -r1.135 distinfo
 --- distinfo	20 Sep 2018 14:05:25 -0000	1.135
 +++ distinfo	8 Dec 2018 11:32:17 -0000
 @@ -6,7 +6,8 @@ SHA512 (node-v10.11.0.tar.gz) = 0d1bce55
  Size (node-v10.11.0.tar.gz) = 36198226 bytes
  SHA1 (patch-common.gypi) = de37949f38d9bd39a18b59d59ec74e528bd323ac
  SHA1 (patch-deps_cares_cares.gyp) = 2235eb44bc984fa2e745fdf1786f1ae6de6ef80f
 -SHA1 (patch-deps_openssl_config_opensslconf__asm.h) = 7b074ebd5353dff662ac66cf4012926f12dd7b7e
 +SHA1 (patch-deps_openssl_config_archs_linux-elf_asm_openssl-cl.gypi) = f92f5547728cf67de5ccfd652f23cc4ab8f5b207
 +SHA1 (patch-deps_openssl_config_opensslconf__asm.h) = 86b1c42bbe0f7b9e6412a62e5771da316bd8b96c
  SHA1 (patch-deps_openssl_config_opensslconf__no-asm.h) = 4b2eb51f6369c2acd328421cd896b8471234c0c8
  SHA1 (patch-deps_openssl_openssl-cl__asm.gypi) = a7966d08e45120c55ff5ec62c6f6bf944212af2d
  SHA1 (patch-deps_openssl_openssl-cl__no__asm.gypi) = f90a0cbdbe5d2088f892fdc6586d0fe9c612b8d5
 Index: patches/patch-deps_openssl_config_opensslconf__asm.h
 ===================================================================
 RCS file: /cvsroot/pkgsrc/lang/nodejs/patches/patch-deps_openssl_config_opensslconf__asm.h,v
 retrieving revision 1.1
 diff -u -p -d -r1.1 patch-deps_openssl_config_opensslconf__asm.h
 --- patches/patch-deps_openssl_config_opensslconf__asm.h	3 May 2018 21:19:16 -0000	1.1
 +++ patches/patch-deps_openssl_config_opensslconf__asm.h	8 Dec 2018 11:32:17 -0000
 @@ -2,15 +2,14 @@ $NetBSD: patch-deps_openssl_config_opens
  
  Add support for NetBSD.
  
 ---- deps/openssl/config/opensslconf_asm.h.orig	2018-04-24 14:41:19.000000000 +0000
 +--- deps/openssl/config/opensslconf_asm.h.orig	2018-09-20 07:28:30.000000000 +0000
  +++ deps/openssl/config/opensslconf_asm.h
 -@@ -108,9 +108,9 @@
 +@@ -108,9 +108,7 @@
   # include "./archs/VC-WIN32/asm/include/openssl/opensslconf.h"
   #elif defined(_WIN32) && defined(_M_X64)
   # include "./archs/VC-WIN64A/asm/include/openssl/opensslconf.h"
  -#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
 -+#elif (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)) && defined(__i386__)
 - # include "./archs/BSD-x86/asm/include/openssl/opensslconf.h"
 +-# include "./archs/BSD-x86/asm/include/openssl/opensslconf.h"
  -#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
  +#elif (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)) && defined(__x86_64__)
   # include "./archs/BSD-x86_64/asm/include/openssl/opensslconf.h"
 --- /dev/null	2018-12-08 20:31:04.725130460 +0900
 +++ patches/patch-deps_openssl_config_archs_linux-elf_asm_openssl-cl.gypi	2018-12-08 20:17:05.055217148 +0900
 @@ -0,0 +1,23 @@
 +$NetBSD$
 +
 +--- deps/openssl/config/archs/linux-elf/asm/openssl-cl.gypi.orig	2018-09-20 07:28:30.000000000 +0000
 ++++ deps/openssl/config/archs/linux-elf/asm/openssl-cl.gypi
 +@@ -28,8 +28,16 @@
 +     'openssl_cflags_linux-elf': [
 +       '-Wall -O3 -pthread -DL_ENDIAN -fomit-frame-pointer',
 +     ],
 +-    'openssl_ex_libs_linux-elf': [
 +-      '-ldl -pthread',
 ++    'conditions': [
 ++      ['OS=="linux"', {
 ++        'openssl_ex_libs_linux-elf': [
 ++          '-ldl -pthread',
 ++        ],
 ++      }, {
 ++        'openssl_ex_libs_linux-elf': [
 ++          '',
 ++        ],
 ++      }],
 +     ],
 +     'openssl_cli_srcs_linux-elf': [
 +       'openssl/apps/app_rand.c',
 
 
 ---
 
 This patch is for pkgsrc-2018Q3 (i.e. nodejs-10.11.0, while the latest
 pkgsrc-current has 10.14.0), but I can build working firefox 63.0.3
 binary for NetBSD/i386 8.0, using partially updated pkgsrc-2018Q3 tree.
 
 (note the patch is not tested on Linux ia32 systems)
 
 I'm not sure nodejs (and firefox) actually require OpenSSL functions,
 but it looks the "real fix" is to use pkgsrc openssl 1.1, as pkgsrc log
 messages said?
  http://mail-index.netbsd.org/pkgsrc-changes/2018/05/03/msg175076.html
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index