v8: fix dragonflybsd build
* fix gyp build * don't require libexecinfo, it's not there * libpthread doesn't implement sem_timedwait(), fall back to sem_wait() Upstreamed in https://codereview.chromium.org/11421013/
This commit is contained in:
parent
1e738c5ef2
commit
a25ebb1997
15
deps/v8/build/common.gypi
vendored
15
deps/v8/build/common.gypi
vendored
@ -274,8 +274,7 @@
|
||||
},
|
||||
},
|
||||
}],
|
||||
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
|
||||
or OS=="netbsd"', {
|
||||
['OS in "linux freebsd dragonflybsd openbsd solaris netbsd".split()', {
|
||||
'conditions': [
|
||||
[ 'v8_no_strict_aliasing==1', {
|
||||
'cflags': [ '-fno-strict-aliasing' ],
|
||||
@ -285,8 +284,8 @@
|
||||
['OS=="solaris"', {
|
||||
'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
|
||||
}],
|
||||
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
|
||||
or OS=="netbsd" or OS=="mac" or OS=="android") and \
|
||||
['(OS=="linux" or OS=="freebsd" or OS=="dragonflybsd" or OS=="openbsd" \
|
||||
or OS=="solaris" or OS=="netbsd" or OS=="mac" or OS=="android") and \
|
||||
(v8_target_arch=="arm" or v8_target_arch=="ia32" or \
|
||||
v8_target_arch=="mipsel")', {
|
||||
# Check whether the host compiler and target compiler support the
|
||||
@ -314,7 +313,7 @@
|
||||
}],
|
||||
],
|
||||
}],
|
||||
['OS=="freebsd" or OS=="openbsd"', {
|
||||
['OS=="freebsd" or OS=="dragonflybsd" or OS=="openbsd"', {
|
||||
'cflags': [ '-I/usr/local/include' ],
|
||||
}],
|
||||
['OS=="netbsd"', {
|
||||
@ -346,7 +345,7 @@
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
|
||||
['OS in "linux freebsd dragonflybsd openbsd netbsd".split()', {
|
||||
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
|
||||
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
|
||||
}],
|
||||
@ -368,8 +367,8 @@
|
||||
}, # Debug
|
||||
'Release': {
|
||||
'conditions': [
|
||||
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
|
||||
or OS=="android"', {
|
||||
['OS=="linux" or OS=="freebsd" or OS=="dragonflybsd" \
|
||||
or OS=="openbsd" or OS=="netbsd" or OS=="android"', {
|
||||
'conditions': [
|
||||
[ 'gcc_version==44 and clang==0', {
|
||||
'cflags': [
|
||||
|
13
deps/v8/build/standalone.gypi
vendored
13
deps/v8/build/standalone.gypi
vendored
@ -38,8 +38,7 @@
|
||||
'variables': {
|
||||
'variables': {
|
||||
'conditions': [
|
||||
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \
|
||||
OS=="netbsd" or OS=="mac"', {
|
||||
['OS!="win"', {
|
||||
# This handles the Unix platforms we generally deal with.
|
||||
# Anything else gets passed through, which probably won't work
|
||||
# very well; such hosts should pass an explicit target_arch
|
||||
@ -47,9 +46,8 @@
|
||||
'host_arch%':
|
||||
'<!(uname -m | sed -e "s/i.86/ia32/;\
|
||||
s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/mips.*/mipsel/")',
|
||||
}, {
|
||||
# OS!="linux" and OS!="freebsd" and OS!="openbsd" and
|
||||
# OS!="netbsd" and OS!="mac"
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'host_arch%': 'ia32',
|
||||
}],
|
||||
],
|
||||
@ -89,8 +87,7 @@
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
|
||||
or OS=="netbsd"', {
|
||||
['OS!="win"', {
|
||||
'target_defaults': {
|
||||
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
|
||||
'-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
|
||||
@ -109,8 +106,6 @@
|
||||
],
|
||||
},
|
||||
}],
|
||||
# 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"
|
||||
# or OS=="netbsd"'
|
||||
['OS=="win"', {
|
||||
'target_defaults': {
|
||||
'defines': [
|
||||
|
3
deps/v8/src/d8.gyp
vendored
3
deps/v8/src/d8.gyp
vendored
@ -61,8 +61,7 @@
|
||||
'libraries': [ '-lreadline', ],
|
||||
'sources': [ 'd8-readline.cc' ],
|
||||
}],
|
||||
['(OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="netbsd" \
|
||||
or OS=="openbsd" or OS=="solaris" or OS=="android")', {
|
||||
[ 'OS!="win"', {
|
||||
'sources': [ 'd8-posix.cc', ]
|
||||
}],
|
||||
[ 'OS=="win"', {
|
||||
|
17
deps/v8/src/platform-freebsd.cc
vendored
17
deps/v8/src/platform-freebsd.cc
vendored
@ -43,12 +43,15 @@
|
||||
#include <sys/fcntl.h> // open
|
||||
#include <unistd.h> // getpagesize
|
||||
// If you don't have execinfo.h then you need devel/libexecinfo from ports.
|
||||
#include <execinfo.h> // backtrace, backtrace_symbols
|
||||
#include <strings.h> // index
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <limits.h>
|
||||
|
||||
#if !defined(__DragonFly__)
|
||||
#include <execinfo.h> // backtrace, backtrace_symbols
|
||||
#endif
|
||||
|
||||
#undef MAP_TYPE
|
||||
|
||||
#include "v8.h"
|
||||
@ -296,6 +299,9 @@ void OS::SignalCodeMovingGC() {
|
||||
|
||||
|
||||
int OS::StackWalk(Vector<OS::StackFrame> frames) {
|
||||
#if defined(__DragonFly__)
|
||||
return 0;
|
||||
#else
|
||||
int frames_size = frames.length();
|
||||
ScopedVector<void*> addresses(frames_size);
|
||||
|
||||
@ -320,6 +326,7 @@ int OS::StackWalk(Vector<OS::StackFrame> frames) {
|
||||
free(symbols);
|
||||
|
||||
return frames_count;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -612,6 +619,13 @@ void FreeBSDSemaphore::Wait() {
|
||||
|
||||
|
||||
bool FreeBSDSemaphore::Wait(int timeout) {
|
||||
#if defined(__DragonFly__)
|
||||
/* DragonFlyBSD lacks sem_timedwait() and there is no good way to emulate it.
|
||||
*/
|
||||
if (sem_wait(&sem_)) abort();
|
||||
USE(timeout);
|
||||
return true;
|
||||
#else
|
||||
const long kOneSecondMicros = 1000000; // NOLINT
|
||||
|
||||
// Split timeout into second and nanosecond parts.
|
||||
@ -637,6 +651,7 @@ bool FreeBSDSemaphore::Wait(int timeout) {
|
||||
if (result == -1 && errno == ETIMEDOUT) return false; // Timeout.
|
||||
CHECK(result == -1 && errno == EINTR); // Signal caused spurious wakeup.
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
8
deps/v8/tools/gyp/v8.gyp
vendored
8
deps/v8/tools/gyp/v8.gyp
vendored
@ -678,6 +678,14 @@
|
||||
'libraries': [
|
||||
'-L/usr/local/lib -lexecinfo',
|
||||
]},
|
||||
}],
|
||||
['OS=="dragonflybsd"', {
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-pthread',
|
||||
]},
|
||||
}],
|
||||
['OS=="freebsd" or OS=="dragonflybsd"', {
|
||||
'sources': [
|
||||
'../../src/platform-freebsd.cc',
|
||||
'../../src/platform-posix.cc'
|
||||
|
Loading…
x
Reference in New Issue
Block a user