Skip to content

Commit e64ed47

Browse files
author
Julien Gilli
committed
src,build: support g++ 4.7.x
Requiring g++ 4.8.x and later to build node binaries means that users who download node binaries from nodejs.org may not be able to use them if the C++ runtime library installed on their system is older. This is the case for instance by default for Solaris 11.2. This change works around a g++ bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53613) whose fix is present in g++ 4.8.x, but hasn't been backported to g++ 4.7.x and makes node buildable with g++4.7.x. The resulting binary thus requires a less recent C++ runtime and works on a broader set of systems. Fixes nodejs#3349.
1 parent 503f279 commit e64ed47

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ def check_compiler(o):
485485
ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++')
486486
if not ok:
487487
warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX)
488-
elif clang_version < '3.4.0' if is_clang else gcc_version < '4.8.0':
489-
warn('C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=%s)' % CXX)
488+
elif clang_version < '3.4.0' if is_clang else gcc_version < '4.7.0':
489+
warn('C++ compiler too old, need g++ 4.7 or clang++ 3.4 (CXX=%s)' % CXX)
490490

491491
ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c')
492492
if not ok:

src/stream_base.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ Local<Object> StreamBase::GetObject() {
443443
return GetAsyncWrap()->object();
444444
}
445445

446+
StreamBase::~StreamBase() = default;
446447

447448
int StreamResource::DoTryWrite(uv_buf_t** bufs, size_t* count) {
448449
// No TryWrite by default
@@ -459,4 +460,6 @@ void StreamResource::ClearError() {
459460
// No-op
460461
}
461462

463+
StreamResource::~StreamResource() = default;
464+
462465
} // namespace node

src/stream_base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class StreamResource {
131131

132132
StreamResource() {
133133
}
134-
virtual ~StreamResource() = default;
134+
virtual ~StreamResource();
135135

136136
virtual int DoShutdown(ShutdownWrap* req_wrap) = 0;
137137
virtual int DoTryWrite(uv_buf_t** bufs, size_t* count);
@@ -215,7 +215,7 @@ class StreamBase : public StreamResource {
215215
explicit StreamBase(Environment* env) : env_(env), consumed_(false) {
216216
}
217217

218-
virtual ~StreamBase() = default;
218+
virtual ~StreamBase();
219219

220220
// One of these must be implemented
221221
virtual AsyncWrap* GetAsyncWrap();

0 commit comments

Comments
 (0)