summaryrefslogtreecommitdiff
path: root/debian/patches/kfreebsd-support.patch
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2018-08-30 21:00:23 +0200
committerRuben Undheim <ruben.undheim@gmail.com>2018-08-30 21:00:23 +0200
commit2025291e69b14e2dc3880a6dc24726ed0735f527 (patch)
treebdaaa0ab9cec1a43c09fb6bd3f408c2f952ab359 /debian/patches/kfreebsd-support.patch
parent78bfe0de96fa5c6a7e53689ef53deaeac1d0a7b8 (diff)
Fix patches after importing new version
Diffstat (limited to 'debian/patches/kfreebsd-support.patch')
-rw-r--r--debian/patches/kfreebsd-support.patch106
1 files changed, 46 insertions, 60 deletions
diff --git a/debian/patches/kfreebsd-support.patch b/debian/patches/kfreebsd-support.patch
index 346ef18b..c9b9b3b1 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 264b1f6..91e9279 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)