Fix compilation for emcc
authorjiegec <noc@jiegec.ac.cn>
Wed, 11 Mar 2020 14:08:02 +0000 (22:08 +0800)
committerjiegec <noc@jiegec.ac.cn>
Wed, 11 Mar 2020 14:09:24 +0000 (22:09 +0800)
Makefile
frontends/rpc/Makefile.inc
kernel/log.cc
kernel/yosys.cc

index 864be3c2e3ee72fda7bf0ead5d750eb7acb21d37..237731baec1f847a2b3417a476d4558ba868b4eb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -237,7 +237,7 @@ 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
 # https://github.com/kripken/emscripten/blob/master/src/settings.js
 CXXFLAGS += $(EMCCFLAGS)
 LDFLAGS += $(EMCCFLAGS)
@@ -895,6 +895,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
index 9af505098918136431c6b8846a5e7bfc32ed7682..7b270b6feb21e177e01081f7cfabcce65779ef74 100644 (file)
@@ -1,2 +1,3 @@
-
+ifneq ($(CONFIG),emcc)
 OBJS += frontends/rpc/rpc_frontend.o
+endif
index 72181ebe80b1b971dafffc0f7f9f17d6966f1009..2f8ce9e8c0040b857a1033cc478536b151951d75 100644 (file)
@@ -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);
index 8190d89028eb4ca553932977adb992379558b047..7694fc9b62eeadf34a5e7ffbb817e19ffc68c293 100644 (file)
@@ -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;