yosys: fix build on darwin

Attempt to work around a confusion in yosys' build system that causes
builds under clang to fail.

+27 -7
+1 -7
pkgs/development/compilers/yosys/default.nix
··· 51 52 patches = [ 53 ./plugin-search-dirs.patch 54 ]; 55 56 postPatch = '' ··· 104 license = licenses.isc; 105 platforms = platforms.all; 106 maintainers = with maintainers; [ shell thoughtpolice emily ]; 107 - #In file included from kernel/driver.cc:20: 108 - #./kernel/yosys.h:42:10: fatal error: 'map' file not found 109 - ##include <map> 110 - 111 - #https://github.com/YosysHQ/yosys/issues/681 112 - #https://github.com/YosysHQ/yosys/issues/2011 113 - broken = stdenv.isDarwin; 114 }; 115 }
··· 51 52 patches = [ 53 ./plugin-search-dirs.patch 54 + ./fix-clang-build.patch # see https://github.com/YosysHQ/yosys/issues/2011 55 ]; 56 57 postPatch = '' ··· 105 license = licenses.isc; 106 platforms = platforms.all; 107 maintainers = with maintainers; [ shell thoughtpolice emily ]; 108 }; 109 }
+26
pkgs/development/compilers/yosys/fix-clang-build.patch
···
··· 1 + diff --git a/Makefile b/Makefile 2 + index 86abc6958..a72f7b792 100644 3 + --- a/Makefile 4 + +++ b/Makefile 5 + @@ -145,7 +145,12 @@ bumpversion: 6 + ABCREV = 4f5f73d 7 + ABCPULL = 1 8 + ABCURL ?= https://github.com/YosysHQ/abc 9 + + 10 + +ifneq ($(CONFIG),clang) 11 + +ABCMKARGS = CC=clang CXX="$(CXX)" LD=clang ABC_USE_LIBSTDCXX=1 VERBOSE=$(Q) 12 + +else 13 + ABCMKARGS = CC="$(CXX)" CXX="$(CXX)" ABC_USE_LIBSTDCXX=1 VERBOSE=$(Q) 14 + +endif 15 + 16 + # set ABCEXTERNAL = <abc-command> to use an external ABC instance 17 + # Note: The in-tree ABC (yosys-abc) will not be installed when ABCEXTERNAL is set. 18 + @@ -187,7 +192,7 @@ endif 19 + endif 20 + 21 + ifeq ($(CONFIG),clang) 22 + -CXX = clang 23 + +CXX = clang++ 24 + LD = clang++ 25 + CXXFLAGS += -std=$(CXXSTD) -Os 26 + ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H"