From 6868bb9ceb91799a700b0386dea3df17f99d68e1 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 5 Jun 2022 10:01:43 +0100 Subject: [PATCH] darwin.top: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream clang-11. Otherwise build fails as: duplicate symbol '_tsamp' in: main.o top.o --- pkgs/os-specific/darwin/apple-source-releases/top/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/os-specific/darwin/apple-source-releases/top/default.nix b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix index a2f912ca5782..ef766f7bd7f1 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/top/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix @@ -3,6 +3,9 @@ appleDerivation { nativeBuildInputs = [ xcbuildHook ]; buildInputs = [ apple_sdk.frameworks.IOKit ncurses libutil ]; + # Workaround build failure on -fno-common toolchains: + # duplicate symbol '_tsamp' in: main.o top.o + NIX_CFLAGS_COMPILE = "-fcommon"; NIX_LDFLAGS = "-lutil"; installPhase = '' install -D Products/Release/libtop.a $out/lib/libtop.a