Unverified Commit 3dafab35 authored by Niklas Korz's avatar Niklas Korz Committed by GitHub
Browse files

[Backport release-25.05] shibboleth-sp: fix build for Clang >=19 (#407999)

parents 72e7dda2 dee17997
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  stdenv,
  fetchgit,
  fetchpatch,
  autoreconfHook,
  boost,
  fcgi,
@@ -24,6 +25,26 @@ stdenv.mkDerivation rec {
    sha256 = "1qb4dbz5gk10b9w1rf6f4vv7c2wb3a8bfzif6yiaq96ilqad7gdr";
  };

  # Upgrade to Clang 19 (and thereby LLVM19) causes `std::char_traits` to now be present,
  # making `char_traits` references ambiguous due to both `std` and `xmltooling` exporting this symbol,
  # and the file in question uses both `using namespace std;` and `using namespace xmltooling;`
  # The patches below result in `xmltooling` being removed.
  # As `char_traits` is a compile time construct, no runtime repercussions can stem from this.
  # See https://shibboleth.atlassian.net/browse/SSPCPP-998 for a related discussion.
  patches = lib.optionals (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "19") [
    (fetchpatch {
      name = "char-traits-ambig-1";
      url = "https://git.shibboleth.net/view/?p=cpp-sp.git;a=blobdiff_plain;f=shibsp/util/IPRange.cpp;h=532cf9e94c915667c091d127c696979f63939eb5;hp=d6f00bc36ea25997817a2308314bcdbea572936f;hb=49cd05fa6d9935a45069fa555db7a26ca77d23db;hpb=293ff2ab6454b0946b3b03719efa132bff461f1f";
      hash = "sha256-ZF0jsZJoHaxaPPjVbT6Wlq+wjyPQLTnEKcUxONji/hE=";
    })

    (fetchpatch {
      name = "char-traits-ambig-2";
      url = "https://git.shibboleth.net/view/?p=cpp-sp.git;a=blobdiff_plain;f=shibsp/util/IPRange.cpp;h=da954870eb03c7cd054ecc5c52a6c1f011787760;hp=354010d5f5e533262cb385ea16756df53fe0c241;hb=793663a67aaa4e9a4aa9172728d924f8cec45cf6;hpb=a43814935030930c49b7a08f5515b861906525c7";
      hash = "sha256-4iGwCGpGwAkriOwQmh5AgvHLX1o39NuQ2l4sAJbD2bc=";
    })
  ];

  nativeBuildInputs = [
    autoreconfHook
    pkg-config