summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2018-10-17 18:18:09 +0200
committerRuben Undheim <ruben.undheim@gmail.com>2018-10-17 18:18:46 +0200
commit21b42cdffcb5b24bf467ecf2b74adea47bbdc393 (patch)
tree5794a304e60e2060a34a6eaa076230c71de2001e /debian/patches
parent42942203476b47ac8ec62671e4c133b7c7fceab3 (diff)
parent0b254e3191dbed4a29ee37c5ae7cfcf8d723fbb2 (diff)
Merge branch 'next'
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0007-Disable-pretty-build.patch6
-rw-r--r--debian/patches/0009-Some-spelling-errors-fixed.patch62
-rw-r--r--debian/patches/0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch4
-rw-r--r--debian/patches/0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch4
-rw-r--r--debian/patches/0011-Do-not-show-g-build-flags-in-Version-string.patch16
-rw-r--r--debian/patches/0012-Skip-non-deterministic-test-causing-random-FTBFS-on-.patch4
-rw-r--r--debian/patches/0013-Let-dpkg-buildpackage-handle-stripping-of-binaries.patch32
-rw-r--r--debian/patches/01_gitrevision.patch8
-rw-r--r--debian/patches/02_removeabc.patch10
-rw-r--r--debian/patches/05_abc_executable.patch10
-rw-r--r--debian/patches/kfreebsd-support.patch106
-rw-r--r--debian/patches/series1
12 files changed, 163 insertions, 100 deletions
diff --git a/debian/patches/0007-Disable-pretty-build.patch b/debian/patches/0007-Disable-pretty-build.patch
index 7c16ac9e..c115f66b 100644
--- a/debian/patches/0007-Disable-pretty-build.patch
+++ b/debian/patches/0007-Disable-pretty-build.patch
@@ -7,10 +7,10 @@ Subject: Disable pretty build
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index f26a6e0..8979641 100644
+index f357258..13b19ce 100644
--- a/Makefile
+++ b/Makefile
-@@ -41,7 +41,7 @@ EXTRA_OBJS =
+@@ -52,7 +52,7 @@ EXTRA_OBJS =
EXTRA_TARGETS =
TARGETS = yosys$(EXE) yosys-config
@@ -18,4 +18,4 @@ index f26a6e0..8979641 100644
+PRETTY = 0
SMALL = 0
- all: top-all
+ # Unit test
diff --git a/debian/patches/0009-Some-spelling-errors-fixed.patch b/debian/patches/0009-Some-spelling-errors-fixed.patch
index d99a2f65..40cc827a 100644
--- a/debian/patches/0009-Some-spelling-errors-fixed.patch
+++ b/debian/patches/0009-Some-spelling-errors-fixed.patch
@@ -3,19 +3,48 @@ Date: Thu, 12 Jul 2018 13:41:39 +0200
Subject: Some spelling errors fixed
---
+ backends/simplec/simplec.cc | 2 +-
+ backends/table/table.cc | 2 +-
backends/verilog/verilog_backend.cc | 2 +-
+ frontends/blif/blifparse.cc | 2 +-
frontends/liberty/liberty.cc | 2 +-
manual/CHAPTER_Overview.tex | 2 +-
manual/command-reference-manual.tex | 2 +-
passes/cmds/show.cc | 2 +-
- 5 files changed, 5 insertions(+), 5 deletions(-)
+ 8 files changed, 8 insertions(+), 8 deletions(-)
+diff --git a/backends/simplec/simplec.cc b/backends/simplec/simplec.cc
+index 349bc5a..6f2ccbe 100644
+--- a/backends/simplec/simplec.cc
++++ b/backends/simplec/simplec.cc
+@@ -748,7 +748,7 @@ struct SimplecBackend : public Backend {
+ log("\n");
+ log(" write_simplec [options] [filename]\n");
+ log("\n");
+- log("Write simple C code for simulating the design. The C code writen can be used to\n");
++ log("Write simple C code for simulating the design. The C code written can be used to\n");
+ log("simulate the design in a C environment, but the purpose of this command is to\n");
+ log("generate code that works well with C-based formal verification.\n");
+ log("\n");
+diff --git a/backends/table/table.cc b/backends/table/table.cc
+index 979273d..b75169e 100644
+--- a/backends/table/table.cc
++++ b/backends/table/table.cc
+@@ -109,7 +109,7 @@ struct TableBackend : public Backend {
+ else if (cell->output(conn.first))
+ *f << "out" << "\t";
+ else
+- *f << "unkown" << "\t";
++ *f << "unknown" << "\t";
+
+ *f << log_signal(sigmap(conn.second)) << "\n";
+ }
diff --git a/backends/verilog/verilog_backend.cc b/backends/verilog/verilog_backend.cc
-index a617215..6f03f25 100644
+index ae90315..d53df2e 100644
--- a/backends/verilog/verilog_backend.cc
+++ b/backends/verilog/verilog_backend.cc
-@@ -1253,7 +1253,7 @@ void dump_module(std::ostream &f, std::string indent, RTLIL::Module *module)
- active_module = module;
+@@ -1415,7 +1415,7 @@ void dump_module(std::ostream &f, std::string indent, RTLIL::Module *module)
+ }
if (!module->processes.empty())
- log_warning("Module %s contains unmapped RTLIL proccesses. RTLIL processes\n"
@@ -23,11 +52,24 @@ index a617215..6f03f25 100644
"can't always be mapped directly to Verilog always blocks. Unintended\n"
"changes in simulation behavior are possible! Use \"proc\" to convert\n"
"processes to logic networks and registers.", log_id(module));
+diff --git a/frontends/blif/blifparse.cc b/frontends/blif/blifparse.cc
+index 034b3e7..9116b25 100644
+--- a/frontends/blif/blifparse.cc
++++ b/frontends/blif/blifparse.cc
+@@ -276,7 +276,7 @@ void parse_blif(RTLIL::Design *design, std::istream &f, std::string dff_name, bo
+
+ if(lastcell == nullptr || module == nullptr)
+ {
+- err_reason = stringf("No primative object to attach .cname %s.", p);
++ err_reason = stringf("No primitive object to attach .cname %s.", p);
+ goto error_with_reason;
+ }
+
diff --git a/frontends/liberty/liberty.cc b/frontends/liberty/liberty.cc
-index 4666c81..c130a57 100644
+index 0a5bd84..e90c87a 100644
--- a/frontends/liberty/liberty.cc
+++ b/frontends/liberty/liberty.cc
-@@ -575,7 +575,7 @@ struct LibertyFrontend : public Frontend {
+@@ -615,7 +615,7 @@ struct LibertyFrontend : public Frontend {
LibertyAst *bus_type_node = node->find("bus_type");
if (!bus_type_node || !type_map.count(bus_type_node->value))
@@ -50,10 +92,10 @@ index 964875d..ae5cf09 100644
This makes some aspects of RTLIL more complex but enables Yosys to be used for
coarse grain synthesis where the cells of the target architecture operate on
diff --git a/manual/command-reference-manual.tex b/manual/command-reference-manual.tex
-index 8af8ccd..3452ccb 100644
+index bed6326..eb43467 100644
--- a/manual/command-reference-manual.tex
+++ b/manual/command-reference-manual.tex
-@@ -2859,7 +2859,7 @@ to a graphics file (usually SVG or PostScript).
+@@ -3182,7 +3182,7 @@ to a graphics file (usually SVG or PostScript).
assigned to each unique value of this attribute.
-width
@@ -63,10 +105,10 @@ index 8af8ccd..3452ccb 100644
-signed
mark ports (A, B) that are declared as signed (using the [AB]_SIGNED
diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc
-index 3a3939a..9170ad8 100644
+index a488732..58acd30 100644
--- a/passes/cmds/show.cc
+++ b/passes/cmds/show.cc
-@@ -618,7 +618,7 @@ struct ShowPass : public Pass {
+@@ -623,7 +623,7 @@ struct ShowPass : public Pass {
log(" assigned to each unique value of this attribute.\n");
log("\n");
log(" -width\n");
diff --git a/debian/patches/0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch b/debian/patches/0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch
index 9ffefdbc..0b46c4a0 100644
--- a/debian/patches/0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch
+++ b/debian/patches/0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch
@@ -7,14 +7,14 @@ Subject: Fix adding of sys.path in yosys-smtbmc
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/smt2/Makefile.inc b/backends/smt2/Makefile.inc
-index eacda27..f98e610 100644
+index dce82f0..f98e610 100644
--- a/backends/smt2/Makefile.inc
+++ b/backends/smt2/Makefile.inc
@@ -6,7 +6,7 @@ ifneq ($(CONFIG),emcc)
TARGETS += yosys-smtbmc
yosys-smtbmc: backends/smt2/smtbmc.py
-- $(P) sed 's|##yosys-sys-path##|sys.path += [os.path.dirname(__file__) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' < $< > $@.new
+- $(P) sed 's|##yosys-sys-path##|sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' < $< > $@.new
+ $(P) sed 's|##yosys-sys-path##|sys.path += ["/usr/share/yosys"]|;' < $< > $@.new
$(Q) chmod +x $@.new
$(Q) mv $@.new $@
diff --git a/debian/patches/0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch b/debian/patches/0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch
index 87082429..aa77fe92 100644
--- a/debian/patches/0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch
+++ b/debian/patches/0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch
@@ -11,10 +11,10 @@ Subject: Fix reproducibility of PDF documents in yosys-doc
5 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
-index 8979641..aa66a54 100644
+index 13b19ce..e7a9de1 100644
--- a/Makefile
+++ b/Makefile
-@@ -463,9 +463,9 @@ update-manual: $(TARGETS) $(EXTRA_TARGETS)
+@@ -638,9 +638,9 @@ update-manual: $(TARGETS) $(EXTRA_TARGETS)
cd manual && ../yosys -p 'help -write-tex-command-reference-manual'
manual: $(TARGETS) $(EXTRA_TARGETS)
diff --git a/debian/patches/0011-Do-not-show-g-build-flags-in-Version-string.patch b/debian/patches/0011-Do-not-show-g-build-flags-in-Version-string.patch
index 92bde35e..b72651db 100644
--- a/debian/patches/0011-Do-not-show-g-build-flags-in-Version-string.patch
+++ b/debian/patches/0011-Do-not-show-g-build-flags-in-Version-string.patch
@@ -7,10 +7,10 @@ Subject: Do not show g++ build flags in Version string
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
-index aa66a54..2d4a1ff 100644
+index e7a9de1..5c381ff 100644
--- a/Makefile
+++ b/Makefile
-@@ -370,15 +370,16 @@ libyosys.so: $(filter-out kernel/driver.o,$(OBJS))
+@@ -504,8 +504,7 @@ libyosys.so: $(filter-out kernel/driver.o,$(OBJS))
$(Q) mkdir -p $(dir $@)
$(P) $(CXX) -o $@ -c $(CPPFLAGS) $(CXXFLAGS) $<
@@ -20,13 +20,15 @@ index aa66a54..2d4a1ff 100644
kernel/version_$(GIT_REV).cc: $(YOSYS_SRC)/Makefile
$(P) rm -f kernel/version_*.o kernel/version_*.d kernel/version_*.cc
- $(Q) mkdir -p kernel && echo "namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"$(YOSYS_VER_STR)\"; }" > kernel/version_$(GIT_REV).cc
+@@ -519,8 +518,10 @@ CXXFLAGS_NOVERIFIC = $(CXXFLAGS)
+ LDLIBS_NOVERIFIC = $(LDLIBS)
+ endif
-+CXXFLAGS_FOR_YOSYS_CONFIG := $(shell echo $(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(CXXFLAGS)) | sed 's/-fdebug-prefix[^ ]\+ //' | sed 's/-ffile-prefix-map[^ ]\+ //')
++CXXFLAGS_FOR_YOSYS_CONFIG := $(shell echo $(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(CXXFLAGS_NOVERIFIC)) | sed 's/-fdebug-prefix[^ ]\+ //' | sed 's/-ffile-prefix-map[^ ]\+ //')
+
yosys-config: misc/yosys-config.in
-- $(P) $(SED) -e 's#@CXXFLAGS@#$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(CXXFLAGS))#;' \
+- $(P) $(SED) -e 's#@CXXFLAGS@#$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(strip $(CXXFLAGS_NOVERIFIC)))#;' \
+ $(P) $(SED) -e 's#@CXXFLAGS@#$(CXXFLAGS_FOR_YOSYS_CONFIG)#;' \
- -e 's#@CXX@#$(CXX)#;' -e 's#@LDFLAGS@#$(LDFLAGS)#;' -e 's#@LDLIBS@#$(LDLIBS)#;' \
- -e 's#@BINDIR@#$(BINDIR)#;' -e 's#@DATDIR@#$(DATDIR)#;' < $< > yosys-config
+ -e 's#@CXX@#$(strip $(CXX))#;' -e 's#@LDFLAGS@#$(strip $(LDFLAGS) $(PLUGIN_LDFLAGS))#;' -e 's#@LDLIBS@#$(strip $(LDLIBS_NOVERIFIC))#;' \
+ -e 's#@BINDIR@#$(strip $(BINDIR))#;' -e 's#@DATDIR@#$(strip $(DATDIR))#;' < $< > yosys-config
$(Q) chmod +x yosys-config
diff --git a/debian/patches/0012-Skip-non-deterministic-test-causing-random-FTBFS-on-.patch b/debian/patches/0012-Skip-non-deterministic-test-causing-random-FTBFS-on-.patch
index cdeccca8..18ba0e17 100644
--- a/debian/patches/0012-Skip-non-deterministic-test-causing-random-FTBFS-on-.patch
+++ b/debian/patches/0012-Skip-non-deterministic-test-causing-random-FTBFS-on-.patch
@@ -8,10 +8,10 @@ Subject: Skip non-deterministic test causing random FTBFS on some
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index 2d4a1ff..f277f11 100644
+index 5c381ff..b169eb7 100644
--- a/Makefile
+++ b/Makefile
-@@ -417,7 +417,7 @@ test: $(TARGETS) $(EXTRA_TARGETS)
+@@ -566,7 +566,7 @@ test: $(TARGETS) $(EXTRA_TARGETS)
+cd tests/simple && bash run-test.sh $(SEEDOPT)
+cd tests/hana && bash run-test.sh $(SEEDOPT)
+cd tests/asicworld && bash run-test.sh $(SEEDOPT)
diff --git a/debian/patches/0013-Let-dpkg-buildpackage-handle-stripping-of-binaries.patch b/debian/patches/0013-Let-dpkg-buildpackage-handle-stripping-of-binaries.patch
new file mode 100644
index 00000000..2389eb85
--- /dev/null
+++ b/debian/patches/0013-Let-dpkg-buildpackage-handle-stripping-of-binaries.patch
@@ -0,0 +1,32 @@
+From: Ruben Undheim <ruben.undheim@gmail.com>
+Date: Wed, 17 Oct 2018 08:40:22 +0200
+Subject: Let dpkg-buildpackage handle stripping of binaries
+
+---
+ Makefile | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index b169eb7..961e2ce 100644
+--- a/Makefile
++++ b/Makefile
+@@ -612,19 +612,15 @@ install: $(TARGETS) $(EXTRA_TARGETS)
+ $(INSTALL_SUDO) mkdir -p $(DESTDIR)$(BINDIR)
+ $(INSTALL_SUDO) cp $(TARGETS) $(DESTDIR)$(BINDIR)
+ ifneq ($(filter yosys,$(TARGETS)),)
+- $(INSTALL_SUDO) $(STRIP) -S $(DESTDIR)$(BINDIR)/yosys
+ endif
+ ifneq ($(filter yosys-abc,$(TARGETS)),)
+- $(INSTALL_SUDO) $(STRIP) $(DESTDIR)$(BINDIR)/yosys-abc
+ endif
+ ifneq ($(filter yosys-filterlib,$(TARGETS)),)
+- $(INSTALL_SUDO) $(STRIP) $(DESTDIR)$(BINDIR)/yosys-filterlib
+ endif
+ $(INSTALL_SUDO) mkdir -p $(DESTDIR)$(DATDIR)
+ $(INSTALL_SUDO) cp -r share/. $(DESTDIR)$(DATDIR)/.
+ ifeq ($(ENABLE_LIBYOSYS),1)
+ $(INSTALL_SUDO) cp libyosys.so $(DESTDIR)$(LIBDIR)
+- $(INSTALL_SUDO) $(STRIP) -S $(DESTDIR)$(LIBDIR)/libyosys.so
+ $(INSTALL_SUDO) ldconfig
+ endif
+
diff --git a/debian/patches/01_gitrevision.patch b/debian/patches/01_gitrevision.patch
index e34ce4a0..8e3b5352 100644
--- a/debian/patches/01_gitrevision.patch
+++ b/debian/patches/01_gitrevision.patch
@@ -11,15 +11,15 @@ Forwarded: doesn't make sense upstream
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index 0a61fe6..27eb998 100644
+index d759b11..c92c808 100644
--- a/Makefile
+++ b/Makefile
-@@ -73,7 +73,7 @@ else
+@@ -100,7 +100,7 @@ LDLIBS += -lrt
endif
- YOSYS_VER := 0.7
+ YOSYS_VER := 0.8
-GIT_REV := $(shell cd $(YOSYS_SRC) && git rev-parse --short HEAD 2> /dev/null || echo UNKNOWN)
-+GIT_REV := 61f6811
++GIT_REV := 5706e90
OBJS = kernel/version_$(GIT_REV).o
# set 'ABCREV = default' to use abc/ as it is
diff --git a/debian/patches/02_removeabc.patch b/debian/patches/02_removeabc.patch
index 370f640d..4ef26c8c 100644
--- a/debian/patches/02_removeabc.patch
+++ b/debian/patches/02_removeabc.patch
@@ -9,15 +9,15 @@ Forwarded: doesn't make sense upstream
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index 27eb998..f26a6e0 100644
+index c92c808..f357258 100644
--- a/Makefile
+++ b/Makefile
-@@ -225,7 +225,7 @@ endif
- ifeq ($(ENABLE_ABC),1)
- CXXFLAGS += -DYOSYS_ENABLE_ABC
+@@ -350,7 +350,7 @@ LDLIBS += -lpthread
+ endif
+ else
ifeq ($(ABCEXTERNAL),)
-TARGETS += yosys-abc$(EXE)
+#TARGETS += yosys-abc$(EXE)
endif
endif
-
+ endif
diff --git a/debian/patches/05_abc_executable.patch b/debian/patches/05_abc_executable.patch
index c9bb08d2..b4a97529 100644
--- a/debian/patches/05_abc_executable.patch
+++ b/debian/patches/05_abc_executable.patch
@@ -11,12 +11,12 @@ Forwarded: doesn't make sense upstream
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc
-index cc79296..b215cbc 100644
+index d2d15a4..adc9614 100644
--- a/passes/techmap/abc.cc
+++ b/passes/techmap/abc.cc
-@@ -1327,11 +1327,7 @@ struct AbcPass : public Pass {
- log_header(design, "Executing ABC pass (technology mapping using ABC).\n");
- log_push();
+@@ -1432,11 +1432,7 @@ struct AbcPass : public Pass {
+ pi_map.clear();
+ po_map.clear();
-#ifdef ABCEXTERNAL
- std::string exe_file = ABCEXTERNAL;
@@ -25,5 +25,5 @@ index cc79296..b215cbc 100644
-#endif
+ std::string exe_file = "berkeley-abc";
std::string script_file, liberty_file, constr_file, clk_str;
- std::string delay_target, sop_inputs, sop_products;
+ std::string delay_target, sop_inputs, sop_products, lutin_shared = "-S 1";
bool fast_mode = false, dff_mode = false, keepff = false, cleanup = true;
diff --git a/debian/patches/kfreebsd-support.patch b/debian/patches/kfreebsd-support.patch
index 346ef18b..d1ae9201 100644
--- a/debian/patches/kfreebsd-support.patch
+++ b/debian/patches/kfreebsd-support.patch
@@ -7,104 +7,112 @@ Subject: Change yosys to look for the #define constant "__unix__" instead of
and Clang 3.5 and GCC 4.9 on kFreeBSD.
---
- kernel/driver.cc | 6 +++---
+ kernel/driver.cc | 8 ++++----
kernel/log.cc | 6 +++---
kernel/log.h | 2 +-
kernel/yosys.cc | 4 ++--
- libs/minisat/System.cc | 4 ++--
- libs/minisat/System.h | 2 +-
+ libs/minisat/System.cc | 2 +-
passes/cmds/cover.cc | 2 +-
- 7 files changed, 13 insertions(+), 13 deletions(-)
+ 6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/kernel/driver.cc b/kernel/driver.cc
-index f8d00c3..45cd6ad 100644
+index 1786411..8b328e5 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
-@@ -30,7 +30,7 @@
+@@ -34,7 +34,7 @@
#include <limits.h>
#include <errno.h>
--#ifdef __linux__
-+#ifdef __unix__
+-#if defined (__linux__) || defined(__FreeBSD__)
++#if defined (__unix__) || defined(__FreeBSD__)
+ # include <sys/resource.h>
# include <sys/types.h>
# include <unistd.h>
- #endif
-@@ -409,7 +409,7 @@ int main(int argc, char **argv)
+@@ -449,7 +449,7 @@ int main(int argc, char **argv)
+ if (print_stats)
+ log_hasher = new SHA1;
+
+-#if defined(__linux__)
++#if defined(__unix__)
+ // set stack size to >= 128 MB
+ {
+ struct rlimit rl;
+@@ -532,7 +532,7 @@ int main(int argc, char **argv)
#else
std::string meminfo;
std::string stats_divider = ", ";
--# ifdef __linux__
-+# ifdef __unix__
+-# if defined(__linux__)
++# if defined(__unix__)
std::ifstream statm;
statm.open(stringf("/proc/%lld/statm", (long long)getpid()));
if (statm.is_open()) {
-@@ -463,7 +463,7 @@ int main(int argc, char **argv)
+@@ -599,7 +599,7 @@ int main(int argc, char **argv)
}
}
--#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
-+#if defined(YOSYS_ENABLE_COVER) && defined(__unix__)
+-#if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__))
++#if defined(YOSYS_ENABLE_COVER) && (defined(__unix__) || defined(__FreeBSD__))
if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE"))
{
string filename;
diff --git a/kernel/log.cc b/kernel/log.cc
-index abc401f..9641e9d 100644
+index 0ee2170..1dfa89a 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -25,7 +25,7 @@
# include <sys/time.h>
#endif
--#ifdef __linux__
-+#ifdef __unix__
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__unix__) || defined(__FreeBSD__)
# include <dlfcn.h>
#endif
-@@ -280,7 +280,7 @@ void log_pop()
+@@ -389,7 +389,7 @@ void log_pop()
log_flush();
}
--#if defined(__linux__) && defined(YOSYS_ENABLE_PLUGINS)
-+#if defined(__unix__) && defined(YOSYS_ENABLE_PLUGINS)
+-#if (defined(__linux__) || defined(__FreeBSD__)) && defined(YOSYS_ENABLE_PLUGINS)
++#if (defined(__unix__) || defined(__FreeBSD__)) && defined(YOSYS_ENABLE_PLUGINS)
void log_backtrace(const char *prefix, int levels)
{
if (levels <= 0) return;
-@@ -464,7 +464,7 @@ void log_cell(RTLIL::Cell *cell, std::string indent)
+@@ -584,7 +584,7 @@ void log_wire(RTLIL::Wire *wire, std::string indent)
// ---------------------------------------------------
// This is the magic behind the code coverage counters
// ---------------------------------------------------
--#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
-+#if defined(YOSYS_ENABLE_COVER) && defined(__unix__)
+-#if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__))
++#if defined(YOSYS_ENABLE_COVER) && (defined(__unix__) || defined(__FreeBSD__))
dict<std::string, std::pair<std::string, int>> extra_coverage_data;
diff --git a/kernel/log.h b/kernel/log.h
-index 53480db..4cf7d00 100644
+index 0b4905c..0f068a1 100644
--- a/kernel/log.h
+++ b/kernel/log.h
-@@ -106,7 +106,7 @@ static inline void log_assert_worker(bool cond, const char *expr, const char *fi
+@@ -119,7 +119,7 @@ static inline void log_assert_worker(bool cond, const char *expr, const char *fi
// This is the magic behind the code coverage counters
// ---------------------------------------------------
--#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
-+#if defined(YOSYS_ENABLE_COVER) && defined(__unix__)
+-#if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__))
++#if defined(YOSYS_ENABLE_COVER) && (defined(__unix__) || defined(__FreeBSD__))
#define cover(_id) do { \
static CoverData __d __attribute__((section("yosys_cover_list"), aligned(1), used)) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \
diff --git a/kernel/yosys.cc b/kernel/yosys.cc
-index 08fee97..8b071f0 100644
+index ad03289..822cab9 100644
--- a/kernel/yosys.cc
+++ b/kernel/yosys.cc
-@@ -66,7 +66,7 @@ std::vector<void*> memhasher_store;
+@@ -77,7 +77,7 @@ std::vector<void*> memhasher_store;
void memhasher_on()
{
--#ifdef __linux__
-+#ifdef __unix__
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__unix__) || defined(__FreeBSD__)
memhasher_rng += time(NULL) << 16 ^ getpid();
#endif
memhasher_store.resize(0x10000);
-@@ -647,7 +647,7 @@ struct TclPass : public Pass {
+@@ -660,7 +660,7 @@ struct TclPass : public Pass {
} TclPass;
#endif
@@ -114,10 +122,10 @@ index 08fee97..8b071f0 100644
{
char path[PATH_MAX];
diff --git a/libs/minisat/System.cc b/libs/minisat/System.cc
-index febe3b4..3df1810 100644
+index 1921a1d..efbfb08 100644
--- a/libs/minisat/System.cc
+++ b/libs/minisat/System.cc
-@@ -25,7 +25,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
+@@ -29,7 +29,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#include "System.h"
@@ -126,38 +134,16 @@ index febe3b4..3df1810 100644
#include <stdlib.h>
-@@ -99,7 +99,7 @@ double Minisat::memUsedPeak(bool) { return 0; }
-
- void Minisat::setX86FPUPrecision()
- {
--#if defined(__linux__) && defined(_FPU_EXTENDED) && defined(_FPU_DOUBLE) && defined(_FPU_GETCW)
-+#if defined(__unix__) && defined(_FPU_EXTENDED) && defined(_FPU_DOUBLE) && defined(_FPU_GETCW)
- // Only correct FPU precision on Linux architectures that needs and supports it:
- fpu_control_t oldcw, newcw;
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
-diff --git a/libs/minisat/System.h b/libs/minisat/System.h
-index ee92a6e..8ad9902 100644
---- a/libs/minisat/System.h
-+++ b/libs/minisat/System.h
-@@ -21,7 +21,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
- #ifndef Minisat_System_h
- #define Minisat_System_h
-
--#if defined(__linux__)
-+#if defined(__unix__)
- #include <fpu_control.h>
- #endif
-
diff --git a/passes/cmds/cover.cc b/passes/cmds/cover.cc
-index 1475475..1918b54 100644
+index 0ec7476..5f0042a 100644
--- a/passes/cmds/cover.cc
+++ b/passes/cmds/cover.cc
@@ -128,7 +128,7 @@ struct CoverPass : public Pass {
log("\n");
}
--#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
-+#if defined(YOSYS_ENABLE_COVER) && defined(__unix__)
+-#if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__))
++#if defined(YOSYS_ENABLE_COVER) && (defined(__unix__) || defined(__FreeBSD__))
for (auto &it : get_coverage_data()) {
if (!patterns.empty()) {
for (auto &p : patterns)
diff --git a/debian/patches/series b/debian/patches/series
index bebc566a..643b1cf4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ kfreebsd-support.patch
0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch
0011-Do-not-show-g-build-flags-in-Version-string.patch
0012-Skip-non-deterministic-test-causing-random-FTBFS-on-.patch
+0013-Let-dpkg-buildpackage-handle-stripping-of-binaries.patch