summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
Diffstat (limited to 'patches')
-rw-r--r--patches/0007-Disable-pretty-build.patch21
-rw-r--r--patches/0009-Some-spelling-errors-fixed.patch77
-rw-r--r--patches/0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch21
-rw-r--r--patches/0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch133
-rw-r--r--patches/01_gitrevision.patch25
-rw-r--r--patches/02_removeabc.patch23
-rw-r--r--patches/05_abc_executable.patch29
-rw-r--r--patches/kfreebsd-support.patch163
-rw-r--r--patches/manual-build.patch23
-rw-r--r--patches/series10
-rw-r--r--patches/switch-to-free-font.patch79
11 files changed, 604 insertions, 0 deletions
diff --git a/patches/0007-Disable-pretty-build.patch b/patches/0007-Disable-pretty-build.patch
new file mode 100644
index 00000000..7c16ac9e
--- /dev/null
+++ b/patches/0007-Disable-pretty-build.patch
@@ -0,0 +1,21 @@
+From: Ruben Undheim <ruben.undheim@gmail.com>
+Date: Wed, 5 Apr 2017 09:31:37 +0000
+Subject: Disable pretty build
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index f26a6e0..8979641 100644
+--- a/Makefile
++++ b/Makefile
+@@ -41,7 +41,7 @@ EXTRA_OBJS =
+ EXTRA_TARGETS =
+ TARGETS = yosys$(EXE) yosys-config
+
+-PRETTY = 1
++PRETTY = 0
+ SMALL = 0
+
+ all: top-all
diff --git a/patches/0009-Some-spelling-errors-fixed.patch b/patches/0009-Some-spelling-errors-fixed.patch
new file mode 100644
index 00000000..d99a2f65
--- /dev/null
+++ b/patches/0009-Some-spelling-errors-fixed.patch
@@ -0,0 +1,77 @@
+From: Ruben Undheim <ruben.undheim@gmail.com>
+Date: Thu, 12 Jul 2018 13:41:39 +0200
+Subject: Some spelling errors fixed
+
+---
+ backends/verilog/verilog_backend.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(-)
+
+diff --git a/backends/verilog/verilog_backend.cc b/backends/verilog/verilog_backend.cc
+index a617215..6f03f25 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;
+
+ if (!module->processes.empty())
+- log_warning("Module %s contains unmapped RTLIL proccesses. RTLIL processes\n"
++ log_warning("Module %s contains unmapped RTLIL processes. RTLIL processes\n"
+ "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/liberty/liberty.cc b/frontends/liberty/liberty.cc
+index 4666c81..c130a57 100644
+--- a/frontends/liberty/liberty.cc
++++ b/frontends/liberty/liberty.cc
+@@ -575,7 +575,7 @@ struct LibertyFrontend : public Frontend {
+ LibertyAst *bus_type_node = node->find("bus_type");
+
+ if (!bus_type_node || !type_map.count(bus_type_node->value))
+- log_error("Unkown or unsupported type for bus interface %s on cell %s.\n",
++ log_error("Unknown or unsupported type for bus interface %s on cell %s.\n",
+ node->args.at(0).c_str(), log_id(cell_name));
+
+ int bus_type_width = std::get<0>(type_map.at(bus_type_node->value));
+diff --git a/manual/CHAPTER_Overview.tex b/manual/CHAPTER_Overview.tex
+index 964875d..ae5cf09 100644
+--- a/manual/CHAPTER_Overview.tex
++++ b/manual/CHAPTER_Overview.tex
+@@ -240,7 +240,7 @@ An RTLIL::Wire object has the following properties:
+ As with modules, the attributes can be Verilog attributes imported by the
+ Verilog frontend or attributes assigned by passes.
+
+-In Yosys, busses (signal vectors) are represented using a single wire object
++In Yosys, buses (signal vectors) are represented using a single wire object
+ with a width > 1. So Yosys does not convert signal vectors to individual signals.
+ 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
+--- a/manual/command-reference-manual.tex
++++ b/manual/command-reference-manual.tex
+@@ -2859,7 +2859,7 @@ to a graphics file (usually SVG or PostScript).
+ assigned to each unique value of this attribute.
+
+ -width
+- annotate busses with a label indicating the width of the bus.
++ annotate buses with a label indicating the width of the bus.
+
+ -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
+--- a/passes/cmds/show.cc
++++ b/passes/cmds/show.cc
+@@ -618,7 +618,7 @@ struct ShowPass : public Pass {
+ log(" assigned to each unique value of this attribute.\n");
+ log("\n");
+ log(" -width\n");
+- log(" annotate busses with a label indicating the width of the bus.\n");
++ log(" annotate buses with a label indicating the width of the bus.\n");
+ log("\n");
+ log(" -signed\n");
+ log(" mark ports (A, B) that are declared as signed (using the [AB]_SIGNED\n");
diff --git a/patches/0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch b/patches/0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch
new file mode 100644
index 00000000..9ffefdbc
--- /dev/null
+++ b/patches/0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch
@@ -0,0 +1,21 @@
+From: Ruben Undheim <ruben.undheim@gmail.com>
+Date: Fri, 27 Jul 2018 18:46:13 +0000
+Subject: Fix adding of sys.path in yosys-smtbmc
+
+---
+ backends/smt2/Makefile.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/backends/smt2/Makefile.inc b/backends/smt2/Makefile.inc
+index eacda27..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 += ["/usr/share/yosys"]|;' < $< > $@.new
+ $(Q) chmod +x $@.new
+ $(Q) mv $@.new $@
+
diff --git a/patches/0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch b/patches/0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch
new file mode 100644
index 00000000..87082429
--- /dev/null
+++ b/patches/0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch
@@ -0,0 +1,133 @@
+From: Ruben Undheim <ruben.undheim@gmail.com>
+Date: Thu, 12 Jul 2018 10:41:21 +0000
+Subject: Fix reproducibility of PDF documents in yosys-doc
+
+---
+ Makefile | 6 +++---
+ manual/appnotes.sh | 5 ++++-
+ manual/manual.sh | 6 ++++--
+ manual/presentation.sh | 11 +++++++++--
+ manual/presentation.tex | 1 +
+ 5 files changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8979641..aa66a54 100644
+--- a/Makefile
++++ b/Makefile
+@@ -463,9 +463,9 @@ update-manual: $(TARGETS) $(EXTRA_TARGETS)
+ cd manual && ../yosys -p 'help -write-tex-command-reference-manual'
+
+ manual: $(TARGETS) $(EXTRA_TARGETS)
+- cd manual && bash appnotes.sh
+- cd manual && bash presentation.sh
+- cd manual && bash manual.sh
++ cd manual && PDF_DATE=$(PDF_DATE) bash appnotes.sh
++ cd manual && PDF_DATE=$(PDF_DATE) bash presentation.sh
++ cd manual && PDF_DATE=$(PDF_DATE) bash manual.sh
+
+ clean:
+ rm -rf share
+diff --git a/manual/appnotes.sh b/manual/appnotes.sh
+index 0ae5286..798d9d3 100755
+--- a/manual/appnotes.sh
++++ b/manual/appnotes.sh
+@@ -7,16 +7,19 @@ do
+ if [ -f $job/make.sh ]; then
+ cd $job
+ bash make.sh
++ sed -i 's#/CreationDate (D:[^)]\+)#/CreationDate ('${PDF_DATE}')#' *.pdf
+ cd ..
+ fi
+ old_md5=$([ -f $job.aux ] && md5sum < $job.aux || true)
+ while
+- pdflatex -shell-escape -halt-on-error $job.tex || exit
++ pdflatex -shell-escape -halt-on-error '\pdfinfo{/CreationDate('${PDF_DATE}')/ModDate('${PDF_DATE}')}\input{'${job}'.tex}' || exit
+ new_md5=$(md5sum < $job.aux)
+ [ "$old_md5" != "$new_md5" ]
+ do
+ old_md5="$new_md5"
+ done
++ grep -av '^/ID \[\(<[0-9A-F]\{32\}>\) \1]$' ${job}.pdf > ${job}.pdf.without_pdf_id
++ mv -f ${job}.pdf.without_pdf_id ${job}.pdf
+ touch $job.ok
+ done
+
+diff --git a/manual/manual.sh b/manual/manual.sh
+index c467393..4417f56 100755
+--- a/manual/manual.sh
++++ b/manual/manual.sh
+@@ -39,7 +39,7 @@ fi
+
+ set -ex
+
+-pdflatex $PDFTEX_OPT manual.tex
++pdflatex $PDFTEX_OPT '\pdfinfo{/CreationDate('${PDF_DATE}')/ModDate('${PDF_DATE}')}\input{manual.tex}'
+
+ if ! $fast_mode; then
+ bibtex manual.aux
+@@ -50,10 +50,12 @@ if ! $fast_mode; then
+ ! cmp autoloop.old autoloop.new
+ do
+ cp autoloop.new autoloop.old
+- pdflatex $PDFTEX_OPT manual.tex
++ pdflatex $PDFTEX_OPT '\pdfinfo{/CreationDate('${PDF_DATE}')/ModDate('${PDF_DATE}')}\input{manual.tex}'
+ done
+
+ rm -f autoloop.old
+ rm -f autoloop.new
+ fi
+
++grep -av '^/ID \[\(<[0-9A-F]\{32\}>\) \1]$' manual.pdf > manual.pdf.without_pdf_id
++mv -f manual.pdf.without_pdf_id manual.pdf
+diff --git a/manual/presentation.sh b/manual/presentation.sh
+index ca8a6c9..f2d0a30 100755
+--- a/manual/presentation.sh
++++ b/manual/presentation.sh
+@@ -29,15 +29,20 @@ set -ex
+ if ! $fast_mode; then
+ ! md5sum *.aux *.snm *.nav *.toc > autoloop.old
+ make -C PRESENTATION_Intro
++ sed -i 's#/CreationDate (D:[^)]\+)#/CreationDate ('${PDF_DATE}')#' PRESENTATION_Intro/*.pdf
+ make -C PRESENTATION_ExSyn
++ sed -i 's#/CreationDate (D:[^)]\+)#/CreationDate ('${PDF_DATE}')#' PRESENTATION_ExSyn/*.pdf
+ make -C PRESENTATION_ExAdv
++ sed -i 's#/CreationDate (D:[^)]\+)#/CreationDate ('${PDF_DATE}')#' PRESENTATION_ExAdv/*.pdf
+ make -C PRESENTATION_ExOth
++ sed -i 's#/CreationDate (D:[^)]\+)#/CreationDate ('${PDF_DATE}')#' PRESENTATION_ExOth/*.pdf
+ make -C PRESENTATION_Prog
+ fi
+
+ set -ex
+
+-pdflatex $PDFTEX_OPT presentation.tex
++echo ${PDF_DATE}
++pdflatex $PDFTEX_OPT '\pdfinfo{/CreationDate('${PDF_DATE}')/ModDate('${PDF_DATE}')}\input{presentation.tex}'
+
+ if ! $fast_mode; then
+ while
+@@ -45,10 +50,12 @@ if ! $fast_mode; then
+ ! cmp autoloop.old autoloop.new
+ do
+ cp autoloop.new autoloop.old
+- pdflatex $PDFTEX_OPT presentation.tex
++ pdflatex $PDFTEX_OPT '\pdfinfo{/CreationDate('${PDF_DATE}')/ModDate('${PDF_DATE}')}\input{presentation.tex}'
+ done
+
+ rm -f autoloop.old
+ rm -f autoloop.new
+ fi
+
++grep -av '^/ID \[\(<[0-9A-F]\{32\}>\) \1]$' presentation.pdf > presentation.pdf.without_pdf_id
++mv -f presentation.pdf.without_pdf_id presentation.pdf
+diff --git a/manual/presentation.tex b/manual/presentation.tex
+index 8060998..a42648c 100644
+--- a/manual/presentation.tex
++++ b/manual/presentation.tex
+@@ -81,6 +81,7 @@
+
+ \title{Yosys Open SYnthesis Suite}
+ \author{Clifford Wolf}
++\date{REPLACEWITHDATE}
+ \institute{http://www.clifford.at/yosys/}
+
+ \usetheme{Madrid}
diff --git a/patches/01_gitrevision.patch b/patches/01_gitrevision.patch
new file mode 100644
index 00000000..e34ce4a0
--- /dev/null
+++ b/patches/01_gitrevision.patch
@@ -0,0 +1,25 @@
+From: Ruben Undheim <ruben.undheim@gmail.com>
+Date: Sat, 14 May 2016 15:44:12 +0200
+Subject: Compilation from the upstream code depends on being in the git
+ repository to get the correct git-revision to be shown when running the
+ program. This patch puts in the git revision from the correct upstream. It
+ must be updated every time upstream changes!
+
+Forwarded: doesn't make sense upstream
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 0a61fe6..27eb998 100644
+--- a/Makefile
++++ b/Makefile
+@@ -73,7 +73,7 @@ else
+ endif
+
+ YOSYS_VER := 0.7
+-GIT_REV := $(shell cd $(YOSYS_SRC) && git rev-parse --short HEAD 2> /dev/null || echo UNKNOWN)
++GIT_REV := 61f6811
+ OBJS = kernel/version_$(GIT_REV).o
+
+ # set 'ABCREV = default' to use abc/ as it is
diff --git a/patches/02_removeabc.patch b/patches/02_removeabc.patch
new file mode 100644
index 00000000..370f640d
--- /dev/null
+++ b/patches/02_removeabc.patch
@@ -0,0 +1,23 @@
+From: Ruben Undheim <ruben.undheim@gmail.com>
+Date: Sat, 14 May 2016 15:44:12 +0200
+Subject: Don't build abc when building yosys. It is built as a separate
+ source package.
+
+Forwarded: doesn't make sense upstream
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 27eb998..f26a6e0 100644
+--- a/Makefile
++++ b/Makefile
+@@ -225,7 +225,7 @@ endif
+ ifeq ($(ENABLE_ABC),1)
+ CXXFLAGS += -DYOSYS_ENABLE_ABC
+ ifeq ($(ABCEXTERNAL),)
+-TARGETS += yosys-abc$(EXE)
++#TARGETS += yosys-abc$(EXE)
+ endif
+ endif
+
diff --git a/patches/05_abc_executable.patch b/patches/05_abc_executable.patch
new file mode 100644
index 00000000..c9bb08d2
--- /dev/null
+++ b/patches/05_abc_executable.patch
@@ -0,0 +1,29 @@
+From: Ruben Undheim <ruben.undheim@gmail.com>
+Date: Sat, 14 May 2016 15:44:13 +0200
+Subject: The dependency abc is built with the name yosys-abc upstream. Since
+ it is available as a separate package independently of yosys,
+ it is not called yosys-abc in debian. This patch changes the name of the
+ command that yosys looks for.
+
+Forwarded: doesn't make sense upstream
+---
+ passes/techmap/abc.cc | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc
+index cc79296..b215cbc 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();
+
+-#ifdef ABCEXTERNAL
+- std::string exe_file = ABCEXTERNAL;
+-#else
+- std::string exe_file = proc_self_dirname() + "yosys-abc";
+-#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;
+ bool fast_mode = false, dff_mode = false, keepff = false, cleanup = true;
diff --git a/patches/kfreebsd-support.patch b/patches/kfreebsd-support.patch
new file mode 100644
index 00000000..346ef18b
--- /dev/null
+++ b/patches/kfreebsd-support.patch
@@ -0,0 +1,163 @@
+From: Sebastian Kuzminsky <seb@highlab.com>
+Date: Sat, 14 May 2016 15:44:13 +0200
+Subject: Change yosys to look for the #define constant "__unix__" instead of
+ "__linux__",
+ to select code appropriate for Unix-like systems. This has been tested with
+ Clang 3.5 and GCC 4.6, 4.8, and 4.9 on Linux,
+ and Clang 3.5 and GCC 4.9 on kFreeBSD.
+
+---
+ kernel/driver.cc | 6 +++---
+ kernel/log.cc | 6 +++---
+ kernel/log.h | 2 +-
+ kernel/yosys.cc | 4 ++--
+ libs/minisat/System.cc | 4 ++--
+ libs/minisat/System.h | 2 +-
+ passes/cmds/cover.cc | 2 +-
+ 7 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/kernel/driver.cc b/kernel/driver.cc
+index f8d00c3..45cd6ad 100644
+--- a/kernel/driver.cc
++++ b/kernel/driver.cc
+@@ -30,7 +30,7 @@
+ #include <limits.h>
+ #include <errno.h>
+
+-#ifdef __linux__
++#ifdef __unix__
+ # include <sys/types.h>
+ # include <unistd.h>
+ #endif
+@@ -409,7 +409,7 @@ int main(int argc, char **argv)
+ #else
+ std::string meminfo;
+ std::string stats_divider = ", ";
+-# ifdef __linux__
++# ifdef __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)
+ }
+ }
+
+-#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
++#if defined(YOSYS_ENABLE_COVER) && defined(__unix__)
+ 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
+--- a/kernel/log.cc
++++ b/kernel/log.cc
+@@ -25,7 +25,7 @@
+ # include <sys/time.h>
+ #endif
+
+-#ifdef __linux__
++#ifdef __unix__
+ # include <dlfcn.h>
+ #endif
+
+@@ -280,7 +280,7 @@ void log_pop()
+ log_flush();
+ }
+
+-#if defined(__linux__) && defined(YOSYS_ENABLE_PLUGINS)
++#if defined(__unix__) && 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)
+ // ---------------------------------------------------
+ // This is the magic behind the code coverage counters
+ // ---------------------------------------------------
+-#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
++#if defined(YOSYS_ENABLE_COVER) && defined(__unix__)
+
+ 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
+--- 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
+ // This is the magic behind the code coverage counters
+ // ---------------------------------------------------
+
+-#if defined(YOSYS_ENABLE_COVER) && defined(__linux__)
++#if defined(YOSYS_ENABLE_COVER) && defined(__unix__)
+
+ #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
+--- a/kernel/yosys.cc
++++ b/kernel/yosys.cc
+@@ -66,7 +66,7 @@ std::vector<void*> memhasher_store;
+
+ void memhasher_on()
+ {
+-#ifdef __linux__
++#ifdef __unix__
+ memhasher_rng += time(NULL) << 16 ^ getpid();
+ #endif
+ memhasher_store.resize(0x10000);
+@@ -647,7 +647,7 @@ struct TclPass : public Pass {
+ } TclPass;
+ #endif
+
+-#if defined(__linux__) || defined(__CYGWIN__)
++#if defined(__unix__)
+ std::string proc_self_dirname()
+ {
+ char path[PATH_MAX];
+diff --git a/libs/minisat/System.cc b/libs/minisat/System.cc
+index febe3b4..3df1810 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
+
+ #include "System.h"
+
+-#if defined(__linux__)
++#if defined(__unix__)
+
+ #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
+--- 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__)
+ for (auto &it : get_coverage_data()) {
+ if (!patterns.empty()) {
+ for (auto &p : patterns)
diff --git a/patches/manual-build.patch b/patches/manual-build.patch
new file mode 100644
index 00000000..dd3d2030
--- /dev/null
+++ b/patches/manual-build.patch
@@ -0,0 +1,23 @@
+From: Sebastian Kuzminsky <seb@highlab.com>
+Date: Sat, 14 May 2016 15:44:13 +0200
+Subject: build the manual using the headers from the source tree,
+ not the installed ones.
+
+===================================================================
+---
+ manual/PRESENTATION_Prog/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/manual/PRESENTATION_Prog/Makefile b/manual/PRESENTATION_Prog/Makefile
+index 794f5c1..319909c 100644
+--- a/manual/PRESENTATION_Prog/Makefile
++++ b/manual/PRESENTATION_Prog/Makefile
+@@ -2,7 +2,7 @@
+ all: test0.log test1.log test2.log
+
+ my_cmd.so: my_cmd.cc
+- ../../yosys-config --exec --cxx --cxxflags --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs
++ ../../yosys-config --exec --cxx --cxxflags -I../.. --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs
+
+ test0.log: my_cmd.so
+ ../../yosys -Ql test0.log_new -m ./my_cmd.so -p 'my_cmd foo bar' absval_ref.v
diff --git a/patches/series b/patches/series
new file mode 100644
index 00000000..57796885
--- /dev/null
+++ b/patches/series
@@ -0,0 +1,10 @@
+01_gitrevision.patch
+02_removeabc.patch
+05_abc_executable.patch
+switch-to-free-font.patch
+manual-build.patch
+kfreebsd-support.patch
+0007-Disable-pretty-build.patch
+0009-Some-spelling-errors-fixed.patch
+0010-Fix-reproducibility-of-PDF-documents-in-yosys-doc.patch
+0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch
diff --git a/patches/switch-to-free-font.patch b/patches/switch-to-free-font.patch
new file mode 100644
index 00000000..093bbbfc
--- /dev/null
+++ b/patches/switch-to-free-font.patch
@@ -0,0 +1,79 @@
+From: Sebastian Kuzminsky <seb@highlab.com>
+Date: Sat, 14 May 2016 15:44:13 +0200
+Subject: Switch the yosys manual font from luximono (non-free) to inconsolata
+ (free)
+
+===================================================================
+---
+ manual/APPNOTE_010_Verilog_to_BLIF.tex | 2 +-
+ manual/APPNOTE_011_Design_Investigation.tex | 2 +-
+ manual/APPNOTE_012_Verilog_to_BTOR.tex | 2 +-
+ manual/manual.tex | 2 +-
+ manual/presentation.tex | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/manual/APPNOTE_010_Verilog_to_BLIF.tex b/manual/APPNOTE_010_Verilog_to_BLIF.tex
+index 0ecdf61..05559b6 100644
+--- a/manual/APPNOTE_010_Verilog_to_BLIF.tex
++++ b/manual/APPNOTE_010_Verilog_to_BLIF.tex
+@@ -4,7 +4,7 @@
+ \documentclass[9pt,technote,a4paper]{IEEEtran}
+
+ \usepackage[T1]{fontenc} % required for luximono!
+-\usepackage[scaled=0.8]{luximono} % typewriter font with bold face
++\usepackage[scaled=0.8]{inconsolata} % typewriter font with bold face
+
+ % To install the luximono font files:
+ % getnonfreefonts-sys --all or
+diff --git a/manual/APPNOTE_011_Design_Investigation.tex b/manual/APPNOTE_011_Design_Investigation.tex
+index 9780c78..4e63e20 100644
+--- a/manual/APPNOTE_011_Design_Investigation.tex
++++ b/manual/APPNOTE_011_Design_Investigation.tex
+@@ -4,7 +4,7 @@
+ \documentclass[9pt,technote,a4paper]{IEEEtran}
+
+ \usepackage[T1]{fontenc} % required for luximono!
+-\usepackage[scaled=0.8]{luximono} % typewriter font with bold face
++\usepackage[scaled=0.8]{inconsolata} % typewriter font with bold face
+
+ % To install the luximono font files:
+ % getnonfreefonts-sys --all or
+diff --git a/manual/APPNOTE_012_Verilog_to_BTOR.tex b/manual/APPNOTE_012_Verilog_to_BTOR.tex
+index 1bc2778..c139188 100644
+--- a/manual/APPNOTE_012_Verilog_to_BTOR.tex
++++ b/manual/APPNOTE_012_Verilog_to_BTOR.tex
+@@ -4,7 +4,7 @@
+ \documentclass[9pt,technote,a4paper]{IEEEtran}
+
+ \usepackage[T1]{fontenc} % required for luximono!
+-\usepackage[scaled=0.8]{luximono} % typewriter font with bold face
++\usepackage[scaled=0.8]{inconsolata} % typewriter font with bold face
+
+ % To install the luximono font files:
+ % getnonfreefonts-sys --all or
+diff --git a/manual/manual.tex b/manual/manual.tex
+index 67982cb..b274792 100644
+--- a/manual/manual.tex
++++ b/manual/manual.tex
+@@ -2,7 +2,7 @@
+
+ \usepackage[T1]{fontenc} % required for luximono!
+ \usepackage{lmodern}
+-\usepackage[scaled=0.8]{luximono} % typewriter font with bold face
++\usepackage[scaled=0.8]{inconsolata} % typewriter font with bold face
+
+ % To install the luximono font files:
+ % getnonfreefonts-sys --all or
+diff --git a/manual/presentation.tex b/manual/presentation.tex
+index 63b963b..8060998 100644
+--- a/manual/presentation.tex
++++ b/manual/presentation.tex
+@@ -3,7 +3,7 @@
+
+ \usepackage[T1]{fontenc} % required for luximono!
+ \usepackage{lmodern}
+-\usepackage[scaled=0.8]{luximono} % typewriter font with bold face
++\usepackage[scaled=0.8]{inconsolata} % typewriter font with bold face
+
+ % To install the luximono font files:
+ % getnonfreefonts-sys --all or