Repository navigation
node compile failure on Solaris 11.2 and gcc 4.8 (undefined std::isnan) #3179
Description
./configure --dest-cpu=x64 --dest-os=solaris --prefix=/opt/node
make
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory .../node.git/out' deps/v8/tools/gyp/v8_base.target.mk:432: warning: overriding recipe for targetsomewhere/node.git/out/Release/libv8_base.a'
deps/v8/tools/gyp/v8_base.host.mk:428: warning: ignoring old recipe for target somewhere/node.git/out/Release/libv8_base.a' deps/v8/tools/gyp/v8_libbase.target.mk:147: warning: overriding recipe for targetsomewhere/node.git/out/Release/libv8_libbase.a'
deps/v8/tools/gyp/v8_libbase.host.mk:143: warning: ignoring old recipe for target somewhere/node.git/out/Release/libv8_libbase.a' deps/v8/tools/gyp/v8_libplatform.target.mk:135: warning: overriding recipe for targetsomewhere/node.git/out/Release/libv8_libplatform.a'
deps/v8/tools/gyp/v8_libplatform.host.mk:131: warning: ignoring old recipe for target somewhere/node.git/out/Release/libv8_libplatform.a' deps/v8/tools/gyp/v8_nosnapshot.target.mk:139: warning: overriding recipe for targetsomewhere/node.git/out/Release/libv8_nosnapshot.a'
deps/v8/tools/gyp/v8_nosnapshot.host.mk:135: warning: ignoring old recipe for target somewhere/node.git/out/Release/libv8_nosnapshot.a' deps/v8/tools/gyp/v8_snapshot.target.mk:158: warning: overriding recipe for targetsomewhere/node.git/out/Release/libv8_snapshot.a'
deps/v8/tools/gyp/v8_snapshot.host.mk:158: warning: ignoring old recipe for target somewhere/node.git/out/Release/libv8_snapshot.a' g++ '-DV8_TARGET_ARCH_X64' '-D__C99FEATURES__=1' '-DENABLE_DISASSEMBLER' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' -I../deps/v8 -Wall -Wextra -Wno-unused-parameter -m64 -pthreads -fno-strict-aliasing -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF somewhere/node.git/out/Release/.deps/somewhere/node.git/out/Release/obj.target/v8_base/deps/v8/src/accessors.o.d.raw -c -o somewhere/node.git/out/Release/obj.target/v8_base/deps/v8/src/accessors.o ../deps/v8/src/accessors.cc In file included from ../deps/v8/src/objects-inl.h:18:0, from ../deps/v8/src/v8.h:39, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/conversions-inl.h: In function 'double v8::internal::DoubleToInteger(double)': ../deps/v8/src/conversions-inl.h:79:7: error: '__builtin_isnan' is not a member of 'std' if (std::isnan(x)) return 0; ^ ../deps/v8/src/conversions-inl.h:79:7: note: suggested alternative: <built-in>:0:0: note: '__builtin_isnan' In file included from /usr/include/math.h:13:0, from /usr/gcc/4.8/include/c++/4.8.2/cmath:44, from ../deps/v8/src/utils.h:11, from ../deps/v8/src/v8.h:34, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/conversions-inl.h:80:13: error: expected unqualified-id before '__extension__' if (!std::isfinite(x) || x == 0) return x; ^ ../deps/v8/src/conversions-inl.h:80:13: error: expected ')' before '__extension__' In file included from ../deps/v8/src/v8.h:39:0, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/objects-inl.h: In member function 'bool v8::internal::Object::IsNaN() const': ../deps/v8/src/objects-inl.h:1125:34: error: '__builtin_isnan' is not a member of 'std' return this->IsHeapNumber() && std::isnan(HeapNumber::cast(this)->value()); ^ ../deps/v8/src/objects-inl.h:1125:34: note: suggested alternative: <built-in>:0:0: note: '__builtin_isnan' ../deps/v8/src/objects-inl.h: In member function 'void v8::internal::FixedDoubleArray::set(int, double)': ../deps/v8/src/objects-inl.h:2312:7: error: '__builtin_isnan' is not a member of 'std' if (std::isnan(value)) { ^ ../deps/v8/src/objects-inl.h:2312:7: note: suggested alternative: <built-in>:0:0: note: '__builtin_isnan' make[1]: *** [somewhere/node.git/out/Release/obj.target/v8_base/deps/v8/src/accessors.o] Error 1 make[1]: Leaving directorysomewhere/node.git/out'
make: *** [node] Error 2
Same issue as nodejs/node-v0.x-archive#9351
Activity
jbergstroem commentedon Oct 5, 2015
@nodejs/platform-solaris: Ping. Does anyone have solaris 11.2 to test the patch on?
jbergstroem commentedon Oct 5, 2015
@cgalibern this is against latest git nodejs HEAD?
cgalibern commentedon Oct 5, 2015
yes, after: git clone https://github.com/nodejs/node.git
git branch -v
jbergstroem commentedon Oct 6, 2015
So, adding this define doesn't at least break our current smartos builds. Test suite runs fine. If you say it fixes your issue, I'm ok with merging. Anyone else in @nodejs/platform-solaris object?
Edit: I'll create a PR if so.
misterdjules commentedon Oct 6, 2015
I'm wondering if using
-std=gnu++11would also fix the problem? The interaction betweenstd::isnanand other math macros/functions from the C99 standard and the respective similar functions from the C++0x/11 and later standards can be very confusing on some platforms. I don't have access to a Solaris system right now so I can't test it myself.Otherwise, I don't have a problem with defining
_GLIBCXX_USE_C99_MATHon Solaris. The error itself is in V8's source, and I'm wondering if it would be worth it to submit a patch upstream.Also, do we have Solaris (not SmartOS) Jenkins agents on which to run builds and tests?
cgalibern commentedon Oct 6, 2015
I will try to compile using
-std=gnu++11tomorrow.jbergstroem commentedon Oct 6, 2015
@misterdjules no, we don't - but it'd be great if we did.
jbergstroem commentedon Oct 9, 2015
@cgalibern ping! any feedback?
cgalibern commentedon Oct 9, 2015
Hi,
I have tried:
-std=gnu++11=> failedexample:
g++ '-DV8_TARGET_ARCH_X64' '-D__C99FEATURES__=1' '-DENABLE_DISASSEMBLER' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' -I../deps/v8 -Wall -Wextra -Wno-unused-parameter -m64 -pthreads -fno-strict-aliasing -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -std=gnu++11 -MMD -MF=>
In file included from ../deps/v8/src/objects-inl.h:18:0, from ../deps/v8/src/v8.h:39, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/conversions-inl.h: In function 'double v8::internal::DoubleToInteger(double)': ../deps/v8/src/conversions-inl.h:79:7: error: '__builtin_isnan' is not a member of 'std' if (std::isnan(x)) return 0; ^ ../deps/v8/src/conversions-inl.h:79:7: note: suggested alternative: <built-in>:0:0: note: '__builtin_isnan' In file included from /usr/include/math.h:13:0, from /usr/gcc/4.8/include/c++/4.8.2/cmath:44, from ../deps/v8/src/utils.h:11, from ../deps/v8/src/v8.h:34, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/conversions-inl.h:80:13: error: expected unqualified-id before '__extension__' if (!std::isfinite(x) || x == 0) return x; ^ ../deps/v8/src/conversions-inl.h:80:13: error: expected ')' before '__extension__' In file included from ../deps/v8/src/v8.h:39:0, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/objects-inl.h: In member function 'bool v8::internal::Object::IsNaN() const': ../deps/v8/src/objects-inl.h:1125:34: error: '__builtin_isnan' is not a member of 'std' return this->IsHeapNumber() && std::isnan(HeapNumber::cast(this)->value()); ^ ../deps/v8/src/objects-inl.h:1125:34: note: suggested alternative: <built-in>:0:0: note: '__builtin_isnan' ../deps/v8/src/objects-inl.h: In member function 'void v8::internal::FixedDoubleArray::set(int, double)': ../deps/v8/src/objects-inl.h:2312:7: error: '__builtin_isnan' is not a member of 'std' if (std::isnan(value)) { ^ ../deps/v8/src/objects-inl.h:2312:7: note: suggested alternative: <built-in>:0:0: note: '__builtin_isnan'-std=gnu++0xbystd=gnu++11=> failedexample:
g++ '-DV8_TARGET_ARCH_X64' '-D__C99FEATURES__=1' '-DENABLE_DISASSEMBLER' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' -I../deps/v8 -Wall -Wextra -Wno-unused-parameter -m64 -pthreads -fno-strict-aliasing -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++11 -MMD -MF=>
In file included from ../deps/v8/src/objects-inl.h:18:0, from ../deps/v8/src/v8.h:39, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/conversions-inl.h: In function 'double v8::internal::DoubleToInteger(double)': ../deps/v8/src/conversions-inl.h:79:7: error: '__builtin_isnan' is not a member of 'std' if (std::isnan(x)) return 0; ^ ../deps/v8/src/conversions-inl.h:79:7: note: suggested alternative: <built-in>:0:0: note: '__builtin_isnan' In file included from /usr/include/math.h:13:0, from /usr/gcc/4.8/include/c++/4.8.2/cmath:44, from ../deps/v8/src/utils.h:11, from ../deps/v8/src/v8.h:34, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/conversions-inl.h:80:13: error: expected unqualified-id before '__extension__' if (!std::isfinite(x) || x == 0) return x; ^ ../deps/v8/src/conversions-inl.h:80:13: error: expected ')' before '__extension__' In file included from ../deps/v8/src/v8.h:39:0, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/objects-inl.h: In member function 'bool v8::internal::Object::IsNaN() const': ../deps/v8/src/objects-inl.h:1125:34: error: '__builtin_isnan' is not a member of 'std' return this->IsHeapNumber() && std::isnan(HeapNumber::cast(this)->value()); ^ ../deps/v8/src/objects-inl.h:1125:34: note: suggested alternative: <built-in>:0:0: note: '__builtin_isnan' ../deps/v8/src/objects-inl.h: In member function 'void v8::internal::FixedDoubleArray::set(int, double)': ../deps/v8/src/objects-inl.h:2312:7: error: '__builtin_isnan' is not a member of 'std' if (std::isnan(value)) { ^ ../deps/v8/src/objects-inl.h:2312:7: note: suggested alternative: <built-in>:0:0: note: '__builtin_isnan'-D_GLIBCXX_USE_C99_MATH=> compile correctly=>
g++ '-D_GLIBCXX_USE_C99_MATH' '-DV8_TARGET_ARCH_X64' '-D__C99FEATURES__=1' '-DENABLE_DISASSEMBLER' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' -I../deps/v8 -Wall -Wextra -Wno-unused-parameter -m64 -pthreads -fno-strict-aliasing -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF .../out/Release/.deps/.../out/Release/obj.target/v8_base/deps/v8/src/accessors.o.d.raw -c -o .../out/Release/obj.target/v8_base/deps/v8/src/accessors.o ../deps/v8/src/accessors.ccmisterdjules commentedon Oct 9, 2015
Without access to the same platform I don't have anything against defining
_GLIBCXX_USE_C99_MATH, although I'd like to understand a bit more details about the problem.I would also suggest to upstream the change to V8 instead of making the change in node's
common.gypi. @cgalibern @jbergstroem Is that something that you guys can do? If not, I can help you do that, but I'd need access to a Solaris machine to test the changes.alexijs commentedon Oct 16, 2015
I installed a plain vanilla Solaris 11.2 instance and compiled node v4.2.1 there successfully.
Oracle Corporation SunOS 5.11 11.2 June 2014
root@solaris:
# which gcc# pkg install pkg:/developer/gcc-4/gcc-c-48@4.8.2-0.175.2.0.0.42.1no gcc in /usr/bin /usr/sbin
�
root@solaris:
root@solaris:~# pkg install pkg:/developer/gcc-4/gcc-c++-48@4.8.2-0.175.2.0.0.42.1
root@solaris:
# which cc# ln -s /usr/bin/gcc /usr/bin/ccno cc in /usr/bin /usr/sbin
root@solaris:
root@solaris:~# cc --version
cc (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\
root@solaris:
# export PATH=$PATH:/usr/gnu/bin# curl https://nodejs.org/dist/v4.2.1/node-v4.2.1.tar.gz > node.tgzroot@solaris:
root@solaris:
# tar xf node.tgz# cd node-4.2.1root@solaris:
root@solaris:/opt/node-4.2.1~# ./configure --dest-cpu=x64 --dest-os=solaris --prefix=/opt/node
root@solaris:/opt/node-4.2.1~# vi common.gypi
/**
[ 'OS=="solaris"', {
'defines': ['_GLIBCXX_USE_C99_MATH'],
'cflags': [ '-pthreads' ],
'ldflags': [ '-pthreads' ],
'cflags!': [ '-pthread' ],
'ldflags!': [ '-pthread' ],
}]
**/
root@solaris:/opt/node-4.2.1~# gmake -j 6
output truncated
touch /opt/node-v4.2.1/out/Release/obj.target/node_dtrace_ustack.stamp
gmake[1]: Leaving directory `/opt/node-v4.2.1/out'
ln -fs out/Release/node node
Thanks to @drook and @cgalibern for their previous findings that helped me to accomplish this.
GeorgeBailey commentedon Oct 16, 2015
@alexijs, I've confirmed this does build and properly runs our node.js-based services on Solaris 11.2.
These are the only issues I had - both were easily resolved.
ECONNREFUSEDconnecting to localhost mysql. (same thing as when I upgraded to v0.12 of Peter Tribble's build for Solaris 10). Looks likemysqlserver was not listening on IPv6. Resolved by removing the::1 localhostfrom/etc/hosts.This was not necessary for v0.10 so I guess it was using IPv4 by default back then.
Had to install
npm- as it was apparently not bundled.alexijs commentedon Oct 16, 2015
@GeorgeBailey:
JDougherty commentedon Nov 19, 2015
Thanks for the instructions, I was able to compile Node 4.2.2 from source on Solaris 11.3. Like mentioned above, this doesn't include npm and I'm new to node so I'm not quite sure what I need to do to get that installed given that I now have a functioning node binary. Can anyone help me out? Thanks again!
[Edit]
Additionally, if I can help out by providing access to Solaris machines, please reach out to me.
[2nd edit]
Once the first
gmakecommand is finished, runninggmake installcreates abin/directory which contains bothnodeandnpm, so I think I'm all good. Thanks!Trott commentedon Jun 7, 2016
This seems resolved to me so I'm going to close it. Feel free to re-open or comment if I'm wrong about closing it.
cgalibern commentedon Jun 10, 2016
@Trott is it possible to also provide Solaris node versions into https://nodejs.org/en/download/ ?
If yes why not use node-vx.x.x-solaris-x64.tar.gz to avoid conflict with other sunos versions ?
many thanks
bnoordhuis commentedon Jun 10, 2016
@cgalibern See #7115 for some discussion on that.
janorn commentedon Oct 6, 2016
I am missing this patch in the repo.
janorn commentedon Oct 6, 2016
Without the patch it won't build on Solaris 11 with gcc.