Bug 243798 - www/node: node-13.6.0 fails to compile on i386
Summary: www/node: node-13.6.0 fails to compile on i386
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Bradley T. Hughes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-02 15:05 UTC by Martin Birgmeier
Modified: 2020-02-02 21:50 UTC (History)
0 users

See Also:
bhughes: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2020-02-02 15:05:15 UTC
Scenario:
- using portmaster to upgrade www/node on i386 (running in a VM) from 13.3.0 to 13.6.0

Result:
- The build fails as follows:

  c++ -o /usr/tmp/a/SRC/FreeBSD-ports/head/www/node/work/node-v13.6.0/out/Release/obj.target/torque_base/deps/v8/src/torque/csa-generator.o ../deps/v8/src/torque/csa-generator.cc '-DNODE_OPENSSL_CERT_STORE' '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D__STDC_FORMAT_MACROS' '-DV8_TARGET_ARCH_IA32' '-DV8_EMBEDDER_STRING="-node.26"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DENABLE_MINOR_MC' '-DV8_INTL_SUPPORT' '-DV8_CONCURRENT_MARKING' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_EMBEDDED_BUILTINS' '-DV8_USE_SIPHASH' '-DDISABLE_UNTRUSTED_CODE_MITIGATIONS' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' -I../deps/v8 -I../deps/v8/include  -pthread -Wno-unused-parameter -m32 -Wno-return-type -msse2 -mfpmath=sse -mmmx -fno-strict-aliasing -m32 -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -std=gnu++1y -fexceptions -MMD -MF /usr/tmp/a/SRC/FreeBSD-ports/head/www/node/work/node-v13.6.0/out/Release/.deps//usr/tmp/a/SRC/FreeBSD-ports/head/www/node/work/node-v13.6.0/out/Release/obj.target/torque_base/deps/v8/src/torque/csa-generator.o.d.raw -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -c
../deps/v8/src/base/platform/platform-freebsd.cc:84:25: error: reinterpret_cast
      from 'uint64_t' (aka 'unsigned long long') to 'uintptr_t'
      (aka 'unsigned int') is not allowed
              lib_name, reinterpret_cast<uintptr_t>(map->kve_start),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/base/platform/platform-freebsd.cc:85:15: error: reinterpret_cast
      from 'uint64_t' (aka 'unsigned long long') to 'uintptr_t'
      (aka 'unsigned int') is not allowed
              reinterpret_cast<uintptr_t>(map->kve_end)));
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
Comment 1 Bradley T. Hughes freebsd_committer freebsd_triage 2020-02-02 21:22:41 UTC
I am currently testing a patch to fix this. I will commit it as soon as my i386 builds finish. Thanks for the report :)
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-02-02 21:44:02 UTC
A commit references this bug:

Author: bhughes
Date: Sun Feb  2 21:43:41 UTC 2020
New revision: 525005
URL: https://svnweb.freebsd.org/changeset/ports/525005

Log:
  www/node: build on i386

  A recent change to V8 changed how mapped shared libraries were
  discovered on FreeBSD, changing from using /proc/self/maps to using
  sysctl with KERN_PROC_VMMAP. Unforcunately, this change fails to build
  on i386 (and probably other 32-bit platforms) due to the use of
  reinterpret_cast to change uint64_t to uintptr_t. This is an invalid
  cast. The uin64_t should be static_cast to uintptr_t for it to work on
  all platforms.

  While here, bump the libuv dependency that I missed when upgrading to
  13.6.0

  PR:		243798
  Reported by:	Martin Birgmeier <d8zNeCFG@aon.at>
  Reported by:	paul beard <paulbeard@gmail.com>
  Reported by:	pkg-fallout@FreeBSD.org
  Sponsored by:	Miles AS

Changes:
  head/www/node/Makefile
  head/www/node/files/patch-deps_v8_src_base_platform_platform-freebsd.cc
Comment 3 Bradley T. Hughes freebsd_committer freebsd_triage 2020-02-02 21:50:17 UTC
I have committed the fix. Thanks again for the report :)