Skip to content

Commit

Permalink
add build flag to fix deadlock
Browse files Browse the repository at this point in the history
add build flag to fix deadlock; set EXEEXT=.html when building wasm target
  • Loading branch information
Yuhengwe1 committed Feb 20, 2023
1 parent 24a19f8 commit b2a2660
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ endif

test: codec_unittest$(EXEEXT)
ifeq ($(BUILD_UT_EXE), Yes)
ifneq (wasm,$(OS))
./codec_unittest
endif
endif

else
test:
Expand Down
9 changes: 0 additions & 9 deletions build/mktargets.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,7 @@ def find_sources():
if args.binary is not None:
f.write("%s$(EXEEXT): $(%s_OBJS) $(%s_DEPS)\n"%(args.binary, PREFIX, PREFIX))
f.write("\t$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $(%s_OBJS) $(%s_LDFLAGS) $(LDFLAGS)\n\n"%(PREFIX, PREFIX))
# for wasm build
f.write("%s.html: $(%s_OBJS) $(%s_DEPS)\n"%(args.binary, PREFIX, PREFIX))
f.write("\t$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $(%s_OBJS) $(%s_LDFLAGS) $(LDFLAGS)\n\n"%(PREFIX, PREFIX))

f.write("ifeq ($(OS), wasm)\n")
f.write("binaries: %s.html\n"%args.binary)
f.write("BINARIES += %s.html\n"%args.binary)
f.write("else\n")
f.write("binaries: %s$(EXEEXT)\n"%args.binary)
f.write("BINARIES += %s$(EXEEXT)\n"%args.binary)
f.write("endif")

f.close()
7 changes: 4 additions & 3 deletions build/platform-wasm.mk
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
include $(SRC_PATH)build/arch.mk
EXEEXT = .html
SHAREDLIBSUFFIX = so
SHAREDLIBSUFFIXFULLVER=$(SHAREDLIBSUFFIX).$(FULL_VERSION)
SHAREDLIBSUFFIXMAJORVER=$(SHAREDLIBSUFFIX).$(SHAREDLIB_MAJORVERSION)
SHLDFLAGS = -Wl,-soname,$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER)
CFLAGS += -Wall -fno-strict-aliasing -fPIC -MMD -MP
# fix undifined symbol: __stack_chk_guard bug
# flags needed to build wasm
CFLAGS += -U_FORTIFY_SOURCE -pthread -DWASMSIMD -msimd128 -sINITIAL_MEMORY=104857600
CXXFLAGS += -U_FORTIFY_SOURCE -pthread -DWASMSIMD -msimd128 -sINITIAL_MEMORY=104857600
LDFLAGS += -U_FORTIFY_SOURCE -pthread -msimd128 -sINITIAL_MEMORY=104857600
CFLAGS += -U_FORTIFY_SOURCE -pthread -DWASMSIMD -msimd128 -sINITIAL_MEMORY=134217728 -sALLOW_MEMORY_GROWTH -sPROXY_TO_PTHREAD -sEXIT_RUNTIME
CXXFLAGS += -U_FORTIFY_SOURCE -pthread -DWASMSIMD -msimd128 -sINITIAL_MEMORY=134217728 -sALLOW_MEMORY_GROWTH -sPROXY_TO_PTHREAD -sEXIT_RUNTIME
LDFLAGS += -U_FORTIFY_SOURCE -pthread -msimd128 -sINITIAL_MEMORY=134217728 -sALLOW_MEMORY_GROWTH -sPROXY_TO_PTHREAD -sEXIT_RUNTIME
ifeq ($(EMFS), nodefs)
CFLAGS += -DNODEFS
CXXFLAGS += -DNODEFS
Expand Down

0 comments on commit b2a2660

Please sign in to comment.