From: Robert Ou Date: Sat, 19 May 2018 05:45:43 +0000 (-0700) Subject: Force abc to align memory to 8 bytes X-Git-Tag: yosys-0.8~89^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bea71e71ca4f2b756519cd67ec99d24f1e70b53b;p=yosys.git Force abc to align memory to 8 bytes Apparently abc has a memory pool implementation that by default returns memory that is unaligned. There is a workaround in the abc makefile that uses uname to look for "arm" specifically and then sets the alignment. However, ARM is not the only platform that requires proper alignment (e.g. emscripten does too). For now, pessimistically force the alignment for 8 bytes all the time (somehow 4 wasn't enough for fixing emscripten despite being approximately a 32-bit platform). --- diff --git a/Makefile b/Makefile index 1a17bb857..ef838624a 100644 --- a/Makefile +++ b/Makefile @@ -164,7 +164,7 @@ else ifeq ($(CONFIG),emcc) CXX = emcc LD = emcc CXXFLAGS := -std=c++11 $(filter-out -fPIC -ggdb,$(CXXFLAGS)) -ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H" +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']"