Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Compilation of v0.11.7 fails on Solaris 10 #6182

Closed
ptribble opened this issue Sep 5, 2013 · 4 comments
Closed

Compilation of v0.11.7 fails on Solaris 10 #6182

ptribble opened this issue Sep 5, 2013 · 4 comments

Comments

@ptribble
Copy link

ptribble commented Sep 5, 2013

Building v0.11.7 on Solaris (gcc 4.6.3) fails with:

make[1]: Entering directory /storage/build/node/node-v0.11.7/out' g++ '-DSUNOS_NO_IFADDRS' '-DOPENSSL_NO_SSL2=1' '-DNODE_WANT_INTERNALS=1' '-DARCH="ia32"' '-DNODE_TAG=""' '-DHAVE_OPENSSL=1' '-DHAVE_DTRACE=1' '-D__POSIX__' '-DPLATFORM="sunos"' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' -I../src -I../tools/msvs/genfiles -I../deps/uv/src/ares -I/storage/build/node/node-v0.11.7/out/Release/obj/gen -I../deps/openssl/openssl/include -I../deps/v8/include -I../deps/zlib -I../deps/http_parser -I../deps/cares/include -I../deps/uv/include -Wall -Wextra -Wno-unused-parameter -m32 -pthreads -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-tree-vrp -fno-rtti -fno-exceptions -MMD -MF /storage/build/node/node-v0.11.7/out/Release/.deps//storage/build/node/node-v0.11.7/out/Release/obj.target/node/src/node.o.d.raw -c -o /storage/build/node/node-v0.11.7/out/Release/obj.target/node/src/node.o ../src/node.cc ../src/node.cc: In function 'void node::GetUid(const v8::FunctionCallbackInfo<v8::Value>&)': ../src/node.cc:1552:37: error: call of overloaded 'Set(uid_t)' is ambiguous ../src/node.cc:1552:37: note: candidates are: ../deps/v8/include/v8.h:5939:6: note: void v8::ReturnValue<T>::Set(bool) [with T = v8::Value] ../deps/v8/include/v8.h:5909:6: note: void v8::ReturnValue<T>::Set(double) [with T = v8::Value] ../deps/v8/include/v8.h:5915:6: note: void v8::ReturnValue<T>::Set(int32_t) [with T = v8::Value, int32_t = int] ../deps/v8/include/v8.h:5926:6: note: void v8::ReturnValue<T>::Set(uint32_t) [with T = v8::Value, uint32_t = unsigned int] ../src/node.cc: In function 'void node::GetGid(const v8::FunctionCallbackInfo<v8::Value>&)': ../src/node.cc:1557:37: error: call of overloaded 'Set(gid_t)' is ambiguous ../src/node.cc:1557:37: note: candidates are: ../deps/v8/include/v8.h:5939:6: note: void v8::ReturnValue<T>::Set(bool) [with T = v8::Value] ../deps/v8/include/v8.h:5909:6: note: void v8::ReturnValue<T>::Set(double) [with T = v8::Value] ../deps/v8/include/v8.h:5915:6: note: void v8::ReturnValue<T>::Set(int32_t) [with T = v8::Value, int32_t = int] ../deps/v8/include/v8.h:5926:6: note: void v8::ReturnValue<T>::Set(uint32_t) [with T = v8::Value, uint32_t = unsigned int] gmake[1]: *** [/storage/build/node/node-v0.11.7/out/Release/obj.target/node/src/node.o] Error 1 gmake[1]: Leaving directory/storage/build/node/node-v0.11.7/out'

@bnoordhuis
Copy link
Member

Sigh, compilers. Does this patch fix it?

diff --git a/src/node.cc b/src/node.cc
index 3f49ec4..c88b0ef 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -1549,12 +1549,14 @@ static gid_t gid_by_name(Handle<Value> value) {


 static void GetUid(const FunctionCallbackInfo<Value>& args) {
-  args.GetReturnValue().Set(getuid());
+  // uid_t is an uint32_t on all supported platforms.
+  args.GetReturnValue().Set(static_cast<uint32_t>(getuid()));
 }


 static void GetGid(const FunctionCallbackInfo<Value>& args) {
-  args.GetReturnValue().Set(getgid());
+  // gid_t is an uint32_t on all supported platforms.
+  args.GetReturnValue().Set(static_cast<uint32_t>(getgid()));
 }

@ptribble
Copy link
Author

ptribble commented Sep 5, 2013

Works for me - thanks. (Technically on Solaris 10 uid_t and git_t are signed, but I think you're OK.)

@bnoordhuis
Copy link
Member

Fixed in 6df4741.

Technically on Solaris 10 uid_t and git_t are signed

That's strange, it's unsigned on the SmartOS systems I have access to. I thought Solaris had switched to uint32_t years ago?

@ptribble
Copy link
Author

ptribble commented Sep 5, 2013

Fixed in 6df4741 6df4741.

Technically on Solaris 10 uid_t and git_t are signed

That's strange, it's unsigned on the SmartOS systems I have access to. I
thought Solaris had switched to uint32_t years ago?

Going a little off-topic, that's true, the change was made in
2007 or so; but Solaris 10 originally shipped in 2005.

-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants