Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build with sunpro compiler on Sun Solaris. #25

Closed
GoogleCodeExporter opened this issue Aug 1, 2015 · 3 comments
Closed

Fails to build with sunpro compiler on Sun Solaris. #25

GoogleCodeExporter opened this issue Aug 1, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What version of the product are you using? On what operating system?

svn revision 78
SunOS dev01-mel 5.10 Generic_118833-17 sun4u sparc SUNW,Sun-Fire-V440
CC: Sun C++ 5.8 Patch 121017-11 2007/05/02

Please provide any additional information below.

The following patch fixes it for me.

Index: test/gtest-filepath_test.cc
===================================================================
--- test/gtest-filepath_test.cc (revision 78)
+++ test/gtest-filepath_test.cc (working copy)
@@ -61,6 +61,11 @@
 #define PATH_SEP "/"
 #endif  // GTEST_OS_WINDOWS

+
+#ifdef GTEST_OS_SUN
+#include <unistd.h>
+#endif  // GTEST_OS_SUN
+
 namespace testing {
 namespace internal {
 namespace {
Index: test/gtest_break_on_failure_unittest.py
===================================================================
--- test/gtest_break_on_failure_unittest.py (revision 78)
+++ test/gtest_break_on_failure_unittest.py (working copy)
@@ -81,7 +81,7 @@
   # On Unix-like systems, the lowest 8 bits of the exit code is the
   # signal number that killed the process (or 0 if it wasn't killed by
   # a signal).
-  return (exit_code & 255) != 0
+  return (exit_code>>8) == (signal.SIGSEGV + 128)


 # The unit test.
Index: include/gtest/internal/gtest-port.h
===================================================================
--- include/gtest/internal/gtest-port.h (revision 78)
+++ include/gtest/internal/gtest-port.h (working copy)
@@ -145,6 +145,11 @@
 #define GTEST_OS_MAC
 #elif defined __linux__
 #define GTEST_OS_LINUX
+#elif defined __sun
+// TODO(johnsyweb@gmail.com): GTEST_OS_SUN is currently used to mean both "The
+// OS is Solaris" and "The compiler is Sunpro". These meanings should
really be
+// separated in order to better support Solaris compilers other than Sunpro.
+#define GTEST_OS_SUN
 #endif  // _MSC_VER

 // Determines whether ::std::string and ::string are available.
@@ -249,7 +254,7 @@
 //   struct Foo {
 //     Foo() { ... }
 //   } GTEST_ATTRIBUTE_UNUSED;
-#if defined(__GNUC__) && !defined(COMPILER_ICC)
+#if defined(__GNUC__) && !defined(COMPILER_ICC) || defined(GTEST_OS_SUN)
 #define GTEST_ATTRIBUTE_UNUSED __attribute__ ((unused))
 #else
 #define GTEST_ATTRIBUTE_UNUSED

Original issue reported on code.google.com by johnsy...@gmail.com on 8 Aug 2008 at 11:39

@GoogleCodeExporter
Copy link
Author

Thanks for the patch.  We don't have access to a Solaris machine so this 
platform is
kinda unsupported.  We are relying on users like you to make Google Test work 
on Solaris.

Would you mind signing a CLA?  This is required before we are able to use the 
code
you sent.  The CLA protects both you and Google.  You can do it on-line and the
instructions are at 
http://code.google.com/p/googletest/wiki/GoogleTestDevGuide.  Thanks.

Original comment by shiq...@gmail.com on 8 Sep 2008 at 11:37

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Original comment by shiq...@gmail.com on 30 Sep 2008 at 10:05

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

This should be fixed in 1.2.0.  Please re-open if you still see the problem 
after 
upgrading to 1.2.0.

Original comment by shiq...@gmail.com on 2 Dec 2008 at 4:59

  • Changed state: Fixed

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

No branches or pull requests

1 participant