Merge pull request #240654 from reckenrode/cctools-port-clang16

cctools-port: fix build with clang 16 on x86_64-darwin

Changed files
+7 -9
pkgs
os-specific
+1 -5
pkgs/os-specific/darwin/cctools/darwin-no-memstream.patch pkgs/os-specific/darwin/cctools/darwin-memstream.patch
···
-
MacOS SDKs before 10.13 don't support open_memstream. This is already replaced
-
by a runtime check in cctools-port, but because we build with SDK 10.12 by
-
default, linking still fails for us. Disable it entirely here.
-
--- a/cctools/include/stuff/diagnostics.h
+++ b/cctools/include/stuff/diagnostics.h
@@ -60,13 +60,6 @@ void diagnostics_log_msg(enum diagnostic_level level, const char* message);
···
-#ifndef HAVE_OPENMEMSTREAM_RUNTIME
-# define HAVE_OPENMEMSTREAM_RUNTIME 1
-#endif
-
+#define HAVE_OPENMEMSTREAM_RUNTIME 0
#endif /* diagnostics_h */
···
--- a/cctools/include/stuff/diagnostics.h
+++ b/cctools/include/stuff/diagnostics.h
@@ -60,13 +60,6 @@ void diagnostics_log_msg(enum diagnostic_level level, const char* message);
···
-#ifndef HAVE_OPENMEMSTREAM_RUNTIME
-# define HAVE_OPENMEMSTREAM_RUNTIME 1
-#endif
+
+#define HAVE_OPENMEMSTREAM_RUNTIME 1
#endif /* diagnostics_h */
+6 -4
pkgs/os-specific/darwin/cctools/port.nix
···
-
{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, autoreconfHook
, installShellFiles
, libuuid
, libobjc ? null, maloader ? null
···
outputs = [ "out" "dev" "man" ];
-
nativeBuildInputs = [ autoconf automake libtool autoreconfHook installShellFiles ];
buildInputs = [ libuuid ]
++ lib.optionals stdenv.isDarwin [ libobjc ]
++ lib.optional enableTapiSupport libtapi;
···
url = "https://github.com/MercuryTechnologies/cctools-port/commit/025899b7b3593dedb0c681e689e57c0e7bbd9b80.patch";
hash = "sha256-SWVUzFaJHH2fu9y8RcU3Nx/QKx60hPE5zFx0odYDeQs=";
})
-
]
-
++ lib.optional stdenv.isDarwin ./darwin-no-memstream.patch;
__propagatedImpureHostDeps = [
# As far as I can tell, otool from cctools is the only thing that depends on these two, and we should fix them
···
+
{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, autoreconfHook, memstreamHook
, installShellFiles
, libuuid
, libobjc ? null, maloader ? null
···
outputs = [ "out" "dev" "man" ];
+
nativeBuildInputs = [ autoconf automake libtool autoreconfHook installShellFiles ]
+
++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ memstreamHook ];
buildInputs = [ libuuid ]
++ lib.optionals stdenv.isDarwin [ libobjc ]
++ lib.optional enableTapiSupport libtapi;
···
url = "https://github.com/MercuryTechnologies/cctools-port/commit/025899b7b3593dedb0c681e689e57c0e7bbd9b80.patch";
hash = "sha256-SWVUzFaJHH2fu9y8RcU3Nx/QKx60hPE5zFx0odYDeQs=";
})
+
# Always use `open_memstream`. This is provided by memstream via hook on x86_64-darwin.
+
./darwin-memstream.patch
+
];
__propagatedImpureHostDeps = [
# As far as I can tell, otool from cctools is the only thing that depends on these two, and we should fix them