Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Fails for 7.4.0 on OpenBSD 6.0 #10904

Closed
AdamNewman opened this issue Jan 19, 2017 · 20 comments
Closed

Compilation Fails for 7.4.0 on OpenBSD 6.0 #10904

AdamNewman opened this issue Jan 19, 2017 · 20 comments
Labels
build Issues and PRs related to build files or the CI.

Comments

@AdamNewman
Copy link

AdamNewman commented Jan 19, 2017

  • Version: 7.4.0
  • Platform: OpenBSD athena.digislacker.com 6.0 GENERIC.MP#146 amd64
  • Subsystem: v8

Per BUILDING.md I have made sure to install the required "libexecinfo". CXX has been defined as /usr/local/bin/eg++, which is version "4.9.4" from the OpenBSD ports tree.

I've run ./configure which outputs:

adam@athena (node-v7.4.0): ./configure
creating ./icu_config.gypi
* Using ICU in deps/icu-small
Using version-specific floating patch tools/icu/patches/58/source/i18n/digitlst.cpp
creating ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'asan': 0,
                 'coverage': 'false',
                 'debug_devtools': 'node',
                 'force_dynamic_crt': 0,
                 'gas_version': '2.17',
                 'host_arch': 'x64',
                 'icu_data_file': 'icudt58l.dat',
                 'icu_data_in': '../../deps/icu-small/source/data/in/icudt58l.dat',
                 'icu_endianness': 'l',
                 'icu_gyp_path': 'tools/icu/icu-generic.gyp',
                 'icu_locales': 'en,root',
                 'icu_path': 'deps/icu-small',
                 'icu_small': 'true',
                 'icu_ver_major': '58',
                 'node_byteorder': 'little',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_module_version': 51,
                 'node_no_browser_globals': 'false',
                 'node_prefix': '/usr/local',
                 'node_release_urlbase': '',
                 'node_shared': 'false',
                 'node_shared_cares': 'false',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_bundled_v8': 'true',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'false',
                 'node_use_v8_platform': 'true',
                 'openssl_fips': '',
                 'openssl_no_asm': 0,
                 'shlib_suffix': 'so.51',
                 'target_arch': 'x64',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_inspector': 'true',
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 0,
                 'want_separate_host_toolset_mkpeephole': 0}}
creating ./config.gypi
creating ./config.mk
adam@athena (node-v7.4.0): 

I run "gmake" to compile. Everything seems to be fine until the following:

  /usr/local/bin/eg++ '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' '-DV8_I18N_SUPPORT' -I../deps/v8  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fno-strict-aliasing -I/usr/local/include -fdata-sections -ffunction-sections -O3 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/adam/src/node-v7.4.0/out/Release/.deps//home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-posix.o.d.raw   -c -o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-posix.o ../deps/v8/src/base/platform/platform-posix.cc
  rm -f /home/adam/src/node-v7.4.0/out/Release/obj.target/deps/v8/src/libv8_libbase.a && ar crs /home/adam/src/node-v7.4.0/out/Release/obj.target/deps/v8/src/libv8_libbase.a /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/accounting-allocator.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/atomicops_internals_x86_gcc.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/bits.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/cpu.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/division-by-constant.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/debug/stack_trace.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/file-utils.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/functional.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/ieee754.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/logging.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/once.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/time.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/condition-variable.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/mutex.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/semaphore.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/sys-info.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/utils/random-number-generator.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-openbsd.o /home/adam/src/node-v7.4.0/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-posix.o
  /usr/local/bin/eg++ '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' '-DV8_I18N_SUPPORT' -I../deps/v8  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fno-strict-aliasing -I/usr/local/include -fdata-sections -ffunction-sections -O3 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/adam/src/node-v7.4.0/out/Release/.deps//home/adam/src/node-v7.4.0/out/Release/obj.target/mkpeephole/deps/v8/src/interpreter/bytecodes.o.d.raw   -c -o /home/adam/src/node-v7.4.0/out/Release/obj.target/mkpeephole/deps/v8/src/interpreter/bytecodes.o ../deps/v8/src/interpreter/bytecodes.cc
  /usr/local/bin/eg++ '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' '-DV8_I18N_SUPPORT' -I../deps/v8  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fno-strict-aliasing -I/usr/local/include -fdata-sections -ffunction-sections -O3 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/adam/src/node-v7.4.0/out/Release/.deps//home/adam/src/node-v7.4.0/out/Release/obj.target/mkpeephole/deps/v8/src/interpreter/mkpeephole.o.d.raw   -c -o /home/adam/src/node-v7.4.0/out/Release/obj.target/mkpeephole/deps/v8/src/interpreter/mkpeephole.o ../deps/v8/src/interpreter/mkpeephole.cc
  /usr/local/bin/eg++ -pthread -rdynamic -m64 -Wl,-z,wxneeded  -o /home/adam/src/node-v7.4.0/out/Release/mkpeephole -Wl,--start-group /home/adam/src/node-v7.4.0/out/Release/obj.target/mkpeephole/deps/v8/src/interpreter/bytecodes.o /home/adam/src/node-v7.4.0/out/Release/obj.target/mkpeephole/deps/v8/src/interpreter/mkpeephole.o /home/adam/src/node-v7.4.0/out/Release/obj.target/deps/v8/src/libv8_libbase.a -Wl,--end-group -L/usr/local/lib -lexecinfo
/home/adam/src/node-v7.4.0/out/Release/obj.target/deps/v8/src/libv8_libbase.a(logging.o): In function `V8_Fatal':
logging.cc:(.text.V8_Fatal+0xf2): undefined reference to `v8::base::debug::StackTrace::StackTrace()'
logging.cc:(.text.V8_Fatal+0xfa): undefined reference to `v8::base::debug::StackTrace::Print() const'
logging.cc:(.text.V8_Fatal+0x10b): undefined reference to `v8::base::debug::DisableSignalStackDump()'
collect2: error: ld returned 1 exit status
gmake[1]: *** [deps/v8/src/mkpeephole.target.mk:130: /home/adam/src/node-v7.4.0/out/Release/mkpeephole] Error 1
gmake[1]: Leaving directory '/home/adam/src/node-v7.4.0/out'
gmake: *** [Makefile:73: node] Error 2
adam@athena (node-v7.4.0):
@mscdex mscdex added the build Issues and PRs related to build files or the CI. label Jan 20, 2017
@mscdex
Copy link
Contributor

mscdex commented Jan 20, 2017

/cc @nodejs/v8 @nodejs/build

@bnoordhuis
Copy link
Member

Does this patch fix it?

diff --git a/deps/v8/src/v8.gyp b/deps/v8/src/v8.gyp
index 1adb2fe..698e687 100644
--- a/deps/v8/src/v8.gyp
+++ b/deps/v8/src/v8.gyp
@@ -1917,16 +1917,17 @@
           }
         ],
         ['OS=="openbsd"', {
             'link_settings': {
               'libraries': [
                 '-L/usr/local/lib -lexecinfo',
             ]},
             'sources': [
+              'base/debug/stack_trace_posix.cc',
               'base/platform/platform-openbsd.cc',
               'base/platform/platform-posix.cc'
             ],
           }
         ],
         ['OS=="netbsd"', {
             'link_settings': {
               'libraries': [

@AdamNewman
Copy link
Author

AdamNewman commented Jan 20, 2017 via email

@jbergstroem
Copy link
Member

@AdamNewman please point to where g++ is hardcoded, if you find any places. We pass clang++ to CXX as compiler on for instance FreeBSD which works fine.

@AdamNewman
Copy link
Author

AdamNewman commented Jan 20, 2017 via email

@bnoordhuis
Copy link
Member

Try building with make CXX=eg++ CXX.host=eg++ CXX.target=eg++. You may have to override LINK that way as well.

@AdamNewman
Copy link
Author

AdamNewman commented Jan 22, 2017 via email

@bnoordhuis
Copy link
Member

What does file out/Release/icupkg print? Does it have the execute bit set?

@AdamNewman
Copy link
Author

AdamNewman commented Jan 22, 2017 via email

@bnoordhuis
Copy link
Member

What does file(1) print for those files?

@AdamNewman
Copy link
Author

AdamNewman commented Jan 23, 2017 via email

@bnoordhuis
Copy link
Member

Hum, seems to match your system's uname. Not sure why it's not working then. File system mounted noexec, an exec whitelist/blacklist policy, something like that?

@AdamNewman
Copy link
Author

AdamNewman commented Jan 23, 2017 via email

@lin7sh
Copy link

lin7sh commented Jan 27, 2017

@AdamNewman Will you update the node port for OpenBSD, so it's available for everyone, It only has version 6.x, right now

@Trott
Copy link
Member

Trott commented Jul 16, 2017

This issue has been inactive for sufficiently long that it seems like perhaps it should be closed. Feel free to re-open (or leave a comment requesting that it be re-opened) if you disagree. I'm just tidying up and not acting on a super-strong opinion or anything like that.

@Trott Trott closed this as completed Jul 16, 2017
@matheusanmo
Copy link

I'm trying to compile 8.4.0 on OpenBSD and am running into all kinds of problems too. Should I create a new issue or continue to discuss here?

@Trott
Copy link
Member

Trott commented Aug 18, 2017

@matheusanmo New issue unless you have a strong suspicion that you are facing exactly the same issue as described here. Thanks!

@Alhadis
Copy link
Contributor

Alhadis commented Jan 1, 2018

Same problem here on OpenBSD 6.1. Trying to build after checking out v9.3.0, and it keeps dying whenever it attempts to run out/Release/icupkg while citing the same "Permission denied" error reported earlier.

Since this affects both OpenBSD 6.0 and 6.1, I'm wondering if this doesn't have anything to do with pledge(2), which was introduced in OpenBSD 5.9. But other than that, I'm at a loss as to what might be going on here. 😓

@qbit
Copy link
Contributor

qbit commented Jan 29, 2018

You get the permission denied stuff because you are building node outside of a wxallowed mount. If you clone the node repo to /usr/local/build/node or similar (inside /usr/local) it should get past that part.

If you see weird "permission denied" errors, check dmesg:

/home/qbit/dev/node/out/Release/icupkg(992): W^X binary outside wxallowed mountpoint

@Alhadis
Copy link
Contributor

Alhadis commented Jan 30, 2018

You get the permission denied stuff because you are building node outside of a wxallowed mount.

Oh shit, that would explain everything. 😅 Thank you!

(I originally picked the /home partition because it had the most disk space. Me and my bright ideas...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

No branches or pull requests

9 participants