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
This commit is contained in:
Sergei Trofimovich 2022-06-05 10:01:43 +01:00
parent 8420ca28de
commit 6868bb9ceb

View file

@ -3,6 +3,9 @@
appleDerivation { appleDerivation {
nativeBuildInputs = [ xcbuildHook ]; nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ apple_sdk.frameworks.IOKit ncurses libutil ]; 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"; NIX_LDFLAGS = "-lutil";
installPhase = '' installPhase = ''
install -D Products/Release/libtop.a $out/lib/libtop.a install -D Products/Release/libtop.a $out/lib/libtop.a