From: Claudio Jeker Subject: Re: [sparc64] build fix for abseil-cpp with gcc/15 To: Theo Buehler Cc: ports@openbsd.org, Andrew Krasavin , Klemens Nanni Date: Wed, 12 Nov 2025 10:25:09 +0100 On Sat, Nov 08, 2025 at 04:51:07PM +0100, Theo Buehler wrote: > Just in case someone is interested in this diff. It builds with gcc/15 > (no for need gnu++17 CXXFLAGS). It errors out building some test with > gcc/8. That can likely be fixed but I won't be the one debugging that. > I haven't tried with gcc/11 at all. > > It is a somewhat intrusive patch adapted from > https://github.com/abseil/abseil-cpp/issues/1634#issuecomment-2576011026 > > Since upstream doesn't seem keen on fixing this, I'm not sure we would > really want this (once we switch to a newer gcc). The constant churn > happening in abseil makes it likely that it needs fixing and adapting on > every update. That's going to be tedious albeit rather straightforward. > > I also have no idea why we need this when others seem to run into this > problem only when enabling some sanitiers. > > Tests look reasonable on sparc64 and arm64. Not sure if this works on clang but adding -fdelete-null-pointer-checks allows me to build abseil-cpp without the crazy diff. With this most tests pass: 93% tests passed, 15 tests failed out of 218 I start to think that we should enable that by default in g++ since this also fixes a few other ports. It seems to be on by default on linux at least from reading the various bug reports. Only when sanitizers are used the compiler adds -fno-delete-null-pointer-checks because the sanitizers want to see those checks. -- :wq Claudio Index: Makefile =================================================================== RCS file: /cvs/ports/devel/abseil-cpp/Makefile,v diff -u -p -r1.41 Makefile --- Makefile 23 Sep 2025 18:46:30 -0000 1.41 +++ Makefile 12 Nov 2025 07:39:11 -0000 @@ -1,5 +1,3 @@ -BROKEN-sparc64 = is not a constant expression - COMMENT = abseil common libraries (C++) CATEGORIES = devel @@ -12,6 +10,8 @@ SITES = https://github.com/abseil/absei MAINTAINER = Andrew Krasavin , \ Klemens Nanni +DPB_PROPERTIES = parallel + # Apache 2.0 PERMIT_PACKAGE = Yes @@ -67,6 +67,8 @@ CONFIGURE_ARGS = -DBUILD_SHARED_LIBS=ON # for CMake >= 3.8. Abseil developers recommend enabling this option # to ensure that our project builds correctly. CONFIGURE_ARGS += -DABSL_PROPAGATE_CXX_STD=ON + +CXXFLAGS += -fdelete-null-pointer-checks LIB_DEPENDS += devel/gtest>=1.14.0