Unverified Commit 1769d98a authored by Emily's avatar Emily Committed by GitHub
Browse files

apple-sdk: add hack for C++ issues on `x86_64-darwin` (#397398)

parents b0e88f53 cb004b01
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -35,7 +35,24 @@ self: super: {
          | .main_library.reexported_libraries[].names[] |= select([.] | inside($libs) | not)
        ' > usr/lib/$libSystem~
        # Convert libSystem back to tbd-v4 because not all tooling supports the JSON-based format yet.
        llvm-readtapi -delete-input --filetype=tbd-v4 usr/lib/$libSystem~ -o usr/lib/$libSystem
        llvm-readtapi --filetype=tbd-v4 usr/lib/$libSystem~ -o usr/lib/$libSystem
        rm usr/lib/$libSystem~
      done

      # Strip weak C++ symbols to work around `libc++` leakage in system
      # frameworks for now. These are only present on `x86_64-darwin`, so
      # it should hopefully be harmless.
      #
      # TODO FIXME: This is kind of horrible.
      while read -r -d "" stub; do
        printf 'Stripping weak C++ symbols from %s\n' "$stub"
        llvm-readtapi --filetype=tbd-v5 "$stub" \
        | jq '
          (.main_library, .libraries[]?).exported_symbols[]?.data.weak[]? |=
            select(startswith("__Z") | not)
        ' > $stub~
        llvm-readtapi --filetype=tbd-v4 $stub~ -o $stub
        rm $stub~
      done < <(find . -name '*.tbd' -print0)
    '';
}
+0 −2
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@
  enabledModules ? [ ],

  bzip2,
  apple-sdk_14, # earlier SDKs cause linking issues on x86_64
  callPackage,
}@inputs:

@@ -417,7 +416,6 @@ effectiveStdenv.mkDerivation {
    ]
    ++ optionals effectiveStdenv.hostPlatform.isDarwin [
      bzip2
      apple-sdk_14
    ]
    ++ optionals enableDocs [
      doxygen
+0 −1
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@ let
      throw "Please add a qtPlatformCross entry for ${plat.config}";

  # Per https://doc.qt.io/qt-5/macos.html#supported-versions: build SDK = 13.x or 14.x.
  # SDK 13.x causes weird linking errors on x86_64-darwin, so use 14.x
  darwinVersionInputs = [
    apple-sdk_14
  ];