diff options
-rw-r--r-- | base/debug_util_unittest.cc | 23 | ||||
-rw-r--r-- | build/common.gypi | 5 |
2 files changed, 18 insertions, 10 deletions
diff --git a/base/debug_util_unittest.cc b/base/debug_util_unittest.cc index 930e9e0..c909436 100644 --- a/base/debug_util_unittest.cc +++ b/base/debug_util_unittest.cc @@ -9,6 +9,8 @@ #include "base/logging.h" #include "testing/gtest/include/gtest/gtest.h" +// Note: this test currently only fully works on Linux Debug builds. +// See comments in the #ifdef soup if you intend to change this. TEST(StackTrace, OutputToStream) { StackTrace trace; @@ -34,14 +36,12 @@ TEST(StackTrace, OutputToStream) { std::string::npos) << "Unable to resolve symbols. Skipping rest of test."; -#if 0 -// TODO(ajwong): Disabling checking of symbol resolution since it depends -// on whether or not symbols are present, and there are too many -// configurations to reliably ensure that symbols are findable. #if defined(OS_MACOSX) +#if 0 + // Disabled due to -fvisibility=hidden in build config. - // Symbol resolution via the backtrace_symbol funciton does not work well - // in OsX. + // Symbol resolution via the backtrace_symbol function does not work well + // in OS X. // See this thread: // // http://lists.apple.com/archives/darwin-dev/2009/Mar/msg00111.html @@ -56,14 +56,20 @@ TEST(StackTrace, OutputToStream) { << "Expected to find start in backtrace:\n" << backtrace_message; +#endif #elif defined(__GLIBCXX__) - + // This branch is for gcc-compiled code, but not Mac due to the + // above #if. // Expect a demangled symbol. EXPECT_TRUE(backtrace_message.find("testing::Test::Run()") != std::string::npos) << "Expected a demangled symbol in backtrace:\n" << backtrace_message; -#else // defined(__GLIBCXX__) + +#elif 0 + // This is the fall-through case; it used to cover Windows. + // But it's disabled because of varying buildbot configs; + // some lack symbols. // Expect to at least find main. EXPECT_TRUE(backtrace_message.find("main") != std::string::npos) @@ -83,5 +89,4 @@ TEST(StackTrace, OutputToStream) { << backtrace_message; #endif // define(OS_MACOSX) -#endif } diff --git a/build/common.gypi b/build/common.gypi index 858ff62..09cf397 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -586,7 +586,6 @@ '<(werror)', # See note above about the werror variable. '-pthread', '-fno-exceptions', - '-fvisibility=hidden', '-Wall', '-D_FILE_OFFSET_BITS=64', ], @@ -698,6 +697,10 @@ # can be removed at link time with --gc-sections. '-fdata-sections', '-ffunction-sections', + # Don't export any symbols (for example, to plugins we dlopen()). + # This must be in Release builds only because otherwise we don't + # get backtraces. + '-fvisibility=hidden', # We don't use exceptions. The eh_frame section is used for those # and for symbolizing backtraces. By passing this flag we drop # the eh_frame section completely, we shaving off 2.5mb from |