From a06d109d48ddbf3158c15c7c021e4d0f02d080df Mon Sep 17 00:00:00 2001 From: whispers Date: Sat, 4 Jul 2026 00:25:31 -0400 Subject: [PATCH] glog: disable optimization-dependent stacktrace test This test fails under GCC 16. It appears to be because it makes assumptions that certain compiler optimizations do not occur. It clearly is compiler-specific and tries to work around specific compiler optimizations upstream. In particular, an analysis of the test https://github.com/google/glog/blob/53d58e4531c7c90f71ddab503d915e027432447a/src/stacktrace_unittest.cc#L218 shows that it would be very plausible/correct for GCC to place labels such that the `INIT_ADDRESS_RANGE` macro has `start` and `end` labels that have the same address. While the functions are labeled NOINLINE, interprocedural analysis could *plausibly* produce this result. While we are not completely certain that this is the case, it seems likely that this is not a genuine issue and just a questionable test. --- pkgs/by-name/gl/glog/package.nix | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/gl/glog/package.nix b/pkgs/by-name/gl/glog/package.nix index ef5fb3be4277..0a19f5e81440 100644 --- a/pkgs/by-name/gl/glog/package.nix +++ b/pkgs/by-name/gl/glog/package.nix @@ -71,18 +71,22 @@ stdenv.mkDerivation (finalAttrs: { checkPhase = let - excludedTests = - lib.optionals stdenv.hostPlatform.isDarwin [ - "mock-log" - ] - ++ [ - "logging" # works around segfaults for now - ] - ++ lib.optionals (stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isBigEndian) [ - # CHECK_STREQ failed: symbol == "non_inline_func" ((/build/source/build/symbolize_unittest+0x1000b840) vs. non_inline_func) - # TestWithPCInsideNonInlineFunction doesn't use TEST(), so can't exclude via GTEST_FILTER - "symbolize" - ]; + excludedTests = [ + "logging" # works around segfaults for now + ] + ++ lib.optionals stdenv.hostPlatform.isGnu [ + # Test appears to make strong assumptions about compiler optimizations + # that appear to be broken under GCC 16. + "stacktrace" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "mock-log" + ] + ++ lib.optionals (stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isBigEndian) [ + # CHECK_STREQ failed: symbol == "non_inline_func" ((/build/source/build/symbolize_unittest+0x1000b840) vs. non_inline_func) + # TestWithPCInsideNonInlineFunction doesn't use TEST(), so can't exclude via GTEST_FILTER + "symbolize" + ]; excludedTestsRegex = lib.optionalString ( excludedTests != [ ] ) "(${lib.concatStringsSep "|" excludedTests})";