Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Port v0.12.7 to compile against Visual Studio 2015 #9

Open
wants to merge 1 commit into
base: v0.12.7-release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ tar: $(TARBALL)
$(BINARYTAR): release-only
rm -rf $(BINARYNAME)
rm -rf out/deps out/Release
$(PYTHON) ./configure --prefix=/ --download=all --with-intl=small-icu \
$(PYTHON) ./configure --prefix=/ --download=all --with-intl=none \
--without-snapshot --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS)
$(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1
cp README.md $(BINARYNAME)
Expand Down
12 changes: 8 additions & 4 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
'RuntimeLibrary': 3, # MDd
'Optimization': 0, # /Od, no optimization
'MinimalRebuild': 'false',
'OmitFramePointers': 'false',
Expand Down Expand Up @@ -89,7 +89,7 @@
],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
'RuntimeLibrary': 2, # MD
'Optimization': 3, # /Ox, full optimization
'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
Expand Down Expand Up @@ -181,7 +181,7 @@
}],
[ 'OS in "linux freebsd openbsd solaris android"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=c++11' ],
'ldflags': [ '-rdynamic' ],
'target_conditions': [
['_type=="static_library"', {
Expand Down Expand Up @@ -212,6 +212,10 @@
['OS=="mac"', {
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'GCC_OPTIMIZATION_LEVEL': '3',
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
Expand All @@ -221,7 +225,7 @@
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'PREBINDING': 'NO', # No -Wl,-prebind
'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
'MACOSX_DEPLOYMENT_TARGET': '10.9', # -mmacosx-version-min=10.9
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def configure_winsdk(o):

winsdk_dir = os.environ.get('WindowsSdkDir')

if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\ctrpp.exe'):
if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\x64\\ctrpp.exe'):
print('Found ctrpp in WinSDK--will build generated files '
'into tools/msvs/genfiles.')
o['variables']['node_has_winsdk'] = 'true'
Expand Down Expand Up @@ -1035,7 +1035,7 @@ if options.use_ninja:
elif options.use_xcode:
gyp_args += ['-f', 'xcode']
elif flavor == 'win':
gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto']
gyp_args += ['-f', 'msvs', '-G', 'msvs_version=2013']
else:
gyp_args += ['-f', 'make-' + flavor]

Expand Down
8 changes: 4 additions & 4 deletions deps/cares/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
'VCCLCompilerTool': {
'target_conditions': [
['library=="static_library"', {
'RuntimeLibrary': 1 # static debug
'RuntimeLibrary': 3 # MDd
}, {
'RuntimeLibrary': 3 # DLL debug
'RuntimeLibrary': 3 # MDd
}]
],
'Optimization': 0, # /Od, no optimization
Expand Down Expand Up @@ -49,9 +49,9 @@
'VCCLCompilerTool': {
'target_conditions': [
['library=="static_library"', {
'RuntimeLibrary': 0, # static release
'RuntimeLibrary': 2 # MD
}, {
'RuntimeLibrary': 2, # debug release
'RuntimeLibrary': 2 # MD
}],
],
'Optimization': 3, # /Ox, full optimization
Expand Down
4 changes: 2 additions & 2 deletions deps/http_parser/http_parser.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
'RuntimeLibrary': 3 # MDd
},
},
},
Expand All @@ -24,7 +24,7 @@
'cflags': [ '-Wall', '-Wextra', '-O3' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
'RuntimeLibrary': 2 # MD
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions deps/openssl/openssl/e_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,15 @@ static __inline unsigned int _strlen31(const char *str)
# undef isxdigit
# endif
# if defined(_MSC_VER) && !defined(_DLL) && defined(stdin)
# if _MSC_VER>=1300
# if _MSC_VER>=1300 && _MSC_VER<1900
# undef stdin
# undef stdout
# undef stderr
FILE *__iob_func();
# define stdin (&__iob_func()[0])
# define stdout (&__iob_func()[1])
# define stderr (&__iob_func()[2])
# elif defined(I_CAN_LIVE_WITH_LNK4049)
# elif _MSC_VER<1900 && defined(I_CAN_LIVE_WITH_LNK4049)
# undef stdin
# undef stdout
# undef stderr
Expand Down
8 changes: 4 additions & 4 deletions deps/uv/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
'VCCLCompilerTool': {
'target_conditions': [
['uv_library=="static_library"', {
'RuntimeLibrary': 1, # static debug
'RuntimeLibrary': 3 # MDd
}, {
'RuntimeLibrary': 3, # DLL debug
'RuntimeLibrary': 3 # MDd
}],
],
'Optimization': 0, # /Od, no optimization
Expand Down Expand Up @@ -55,9 +55,9 @@
'VCCLCompilerTool': {
'target_conditions': [
['uv_library=="static_library"', {
'RuntimeLibrary': 0, # static release
'RuntimeLibrary': 2 # MD
}, {
'RuntimeLibrary': 2, # debug release
'RuntimeLibrary': 2 # MD
}],
],
'Optimization': 3, # /Ox, full optimization
Expand Down
16 changes: 8 additions & 8 deletions deps/v8/build/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,9 @@
'Optimization': '0',
'conditions': [
['component=="shared_library"', {
'RuntimeLibrary': '3', # /MDd
'RuntimeLibrary': 3 # MDd
}, {
'RuntimeLibrary': '1', # /MTd
'RuntimeLibrary': 3 # MDd
}],
],
},
Expand Down Expand Up @@ -599,9 +599,9 @@
'BasicRuntimeChecks': '0',
'conditions': [
['component=="shared_library"', {
'RuntimeLibrary': '3', # /MDd
'RuntimeLibrary': 3 # MDd
}, {
'RuntimeLibrary': '1', # /MTd
'RuntimeLibrary': 3 # MDd
}],
],
},
Expand Down Expand Up @@ -653,9 +653,9 @@
'BasicRuntimeChecks': '0',
'conditions': [
['component=="shared_library"', {
'RuntimeLibrary': '3', #/MDd
'RuntimeLibrary': 3 # MDd
}, {
'RuntimeLibrary': '1', #/MTd
'RuntimeLibrary': 3 # MDd
}],
['v8_target_arch=="x64"', {
# TODO(2207): remove this option once the bug is fixed.
Expand Down Expand Up @@ -826,9 +826,9 @@
'StringPooling': 'true',
'conditions': [
['component=="shared_library"', {
'RuntimeLibrary': '2', #/MD
'RuntimeLibrary': 2 # MD
}, {
'RuntimeLibrary': '0', #/MT
'RuntimeLibrary': 2 # MD
}],
['v8_target_arch=="x64"', {
# TODO(2207): remove this option once the bug is fixed.
Expand Down
4 changes: 4 additions & 0 deletions deps/v8/src/compiler/graph-builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "src/compiler/node-properties-inl.h"
#include "src/compiler/operator-properties.h"
#include "src/compiler/operator-properties-inl.h"
#include <iostream>

namespace v8 {
namespace internal {
Expand Down Expand Up @@ -113,11 +114,14 @@ void StructuredGraphBuilder::Environment::Merge(Environment* other) {
// Resurrect a dead environment by copying the contents of the other one and
// placing a singleton merge as the new control dependency.
if (this->IsMarkedAsUnreachable()) {
std::clog << "WARNING: StructuredGraphBuilder::Environment::Merge partially disabled\n";
/*
Node* other_control = other->control_dependency_;
control_dependency_ = graph()->NewNode(common()->Merge(1), other_control);
effect_dependency_ = other->effect_dependency_;
values_ = other->values_;
return;
*/
}

// Create a merge of the control dependencies of both environments and update
Expand Down
3 changes: 3 additions & 0 deletions deps/v8/src/deoptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,12 @@ class FrameDescription {
return malloc(size + frame_size - kPointerSize);
}

// Bug in VS2015 RC, reported fixed in RTM. Microsoft bug: 1153909.
#if !defined(_MSC_FULL_VER) || _MSC_FULL_VER != 190022720
void operator delete(void* pointer, uint32_t frame_size) {
free(pointer);
}
#endif // _MSC_FULL_VER

void operator delete(void* description) {
free(description);
Expand Down
3 changes: 3 additions & 0 deletions deps/zlib/zconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@
#endif
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
# define STDC
# if _MSC_VER>=1900
# define STDC99
# endif
#endif
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
# define STDC
Expand Down
2 changes: 1 addition & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,7 @@ static void EnvSetter(Local<String> property,
WCHAR* key_ptr = reinterpret_cast<WCHAR*>(*key);
// Environment variables that start with '=' are read-only.
if (key_ptr[0] != L'=') {
SetEnvironmentVariableW(key_ptr, reinterpret_cast<WCHAR*>(*val));
_wputenv_s(key_ptr, reinterpret_cast<WCHAR*>(*val));
}
#endif
// Whether it worked or not, always return rval.
Expand Down
16 changes: 15 additions & 1 deletion vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if /i "%1"=="/?" goto help

@rem Process arguments.
set config=Release
set platform=Win32
set msiplatform=x86
set target=Build
set target_arch=ia32
Expand Down Expand Up @@ -94,6 +95,7 @@ if defined build_release (

if "%config%"=="Debug" set debug_arg=--debug
if "%target_arch%"=="x64" set msiplatform=x64
if "%target_arch%"=="x64" set platform=x64
if defined nosnapshot set nosnapshot_arg=--without-snapshot
if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1
Expand All @@ -106,6 +108,18 @@ if defined NIGHTLY set TAG=nightly-%NIGHTLY%

@rem Set environment for msbuild

@rem Look for Visual Studio 2015
if not defined VS140COMNTOOLS goto vc-set-2013
if not exist "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2013
if "%VCVARS_VER%" NEQ "140" (
call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat"
SET VCVARS_VER=140
)
if not defined VCINSTALLDIR goto msbuild-not-found
set GYP_MSVS_VERSION=2015
goto msbuild-found

:vc-set-2013
@rem Look for Visual Studio 2013
if not defined VS120COMNTOOLS goto vc-set-2012
if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
Expand Down Expand Up @@ -161,7 +175,7 @@ echo Project files generated.
if defined nobuild goto sign

@rem Build the sln with msbuild.
msbuild node.sln /m /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
msbuild node.sln /m:%NUMBER_OF_PROCESSORS% /p:BuildInParallel=true /toolsversion:14.0 /p:PlatformToolset=v140 /t:%target% /p:Configuration=%config% /p:Platform=%platform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit

:sign
Expand Down