aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2020-03-12 12:16:28 +0200
committerGitHub <noreply@github.com>2020-03-12 12:16:28 +0200
commitd38098e5fa4ba6b27a67c0069f9134c6cbdbb68b (patch)
tree6827be0f104a347e031a38cd0737bfba547e8e3c
parentdd8ebf7873eadab9c6d0fba8c4ed25eb88acbb8f (diff)
parent26137d8bb70cea1f2de16346e883ec5c43754145 (diff)
downloadyosys-d38098e5fa4ba6b27a67c0069f9134c6cbdbb68b.tar.gz
yosys-d38098e5fa4ba6b27a67c0069f9134c6cbdbb68b.tar.bz2
yosys-d38098e5fa4ba6b27a67c0069f9134c6cbdbb68b.zip
Merge pull request #1757 from jiegec/fix-emcc
Fix compilation for emcc
-rw-r--r--Makefile4
-rw-r--r--frontends/rpc/Makefile.inc3
-rw-r--r--kernel/log.cc1
-rw-r--r--kernel/yosys.cc4
4 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 864be3c2e..0eb42e0d6 100644
--- a/Makefile
+++ b/Makefile
@@ -237,7 +237,8 @@ ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H -DABC_MEMALIGN=8"
EMCCFLAGS := -Os -Wno-warn-absolute-paths
EMCCFLAGS += --memory-init-file 0 --embed-file share -s NO_EXIT_RUNTIME=1
EMCCFLAGS += -s EXPORTED_FUNCTIONS="['_main','_run','_prompt','_errmsg']"
-EMCCFLAGS += -s TOTAL_MEMORY=128*1024*1024
+EMCCFLAGS += -s TOTAL_MEMORY=134217728
+EMCCFLAGS += -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]'
# https://github.com/kripken/emscripten/blob/master/src/settings.js
CXXFLAGS += $(EMCCFLAGS)
LDFLAGS += $(EMCCFLAGS)
@@ -895,6 +896,7 @@ config-emcc: clean
echo 'ENABLE_ABC := 0' >> Makefile.conf
echo 'ENABLE_PLUGINS := 0' >> Makefile.conf
echo 'ENABLE_READLINE := 0' >> Makefile.conf
+ echo 'ENABLE_ZLIB := 0' >> Makefile.conf
config-mxe: clean
echo 'CONFIG := mxe' > Makefile.conf
diff --git a/frontends/rpc/Makefile.inc b/frontends/rpc/Makefile.inc
index 9af505098..7b270b6fe 100644
--- a/frontends/rpc/Makefile.inc
+++ b/frontends/rpc/Makefile.inc
@@ -1,2 +1,3 @@
-
+ifneq ($(CONFIG),emcc)
OBJS += frontends/rpc/rpc_frontend.o
+endif
diff --git a/kernel/log.cc b/kernel/log.cc
index 72181ebe8..2f8ce9e8c 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -695,7 +695,6 @@ void log_check_expected()
log_warn_regexes.clear();
log("Expected error pattern '%s' found !!!\n", item.second.pattern.c_str());
#ifdef EMSCRIPTEN
- log_files = backup_log_files;
throw 0;
#elif defined(_MSC_VER)
_exit(0);
diff --git a/kernel/yosys.cc b/kernel/yosys.cc
index 8190d8902..7694fc9b6 100644
--- a/kernel/yosys.cc
+++ b/kernel/yosys.cc
@@ -341,7 +341,11 @@ int run_command(const std::string &command, std::function<void(const std::string
if (!process_line)
return system(command.c_str());
+#ifdef EMSCRIPTEN
+ FILE *f = nullptr;
+#else
FILE *f = popen(command.c_str(), "r");
+#endif
if (f == nullptr)
return -1;