Skip to content

Commit d5438b1

Browse files
committed
add build flag to fix deadlock
add build flag to fix deadlock; set EXEEXT=.html when building wasm target add wasm build test into .workflow/build.yaml
1 parent 24a19f8 commit d5438b1

File tree

5 files changed

+30
-41
lines changed

5 files changed

+30
-41
lines changed

.github/workflows/build.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: CI
22

33
on: workflow_dispatch
4-
# push:
5-
# pull_request:
4+
push:
5+
pull_request:
66

77
jobs:
88
build:
@@ -138,3 +138,25 @@ jobs:
138138
with:
139139
name: artifacts
140140
path: ./out/artifacts
141+
142+
wasm:
143+
runs-on: ubuntu-latest
144+
steps:
145+
- uses: actions/checkout@v3
146+
- uses: mymindstorm/setup-emsdk@v11
147+
with:
148+
version: 3.1.16
149+
- uses: actions/setup-node@v3
150+
with:
151+
node-version: 16
152+
- run: node -v
153+
- run: emcc -v
154+
- run: sudo apt-get update -qq
155+
- run: sudo apt-get install -qq nasm g++-multilib gcc-multilib libc6-dev-i386
156+
- run: make gmp-bootstrap
157+
- run: make gtest-bootstrap
158+
- run: bash ./build/mktargets.sh
159+
- run: ( cd test/encoder_binary_comparison ; ./run_PrepareAllTestData.sh 64 wasm )
160+
- run: ./run_Test.sh BinaryCompareWasm BA_MW_D.264
161+
- run: ./run_Test.sh BinaryCompareWasm Adobe_PDF_sample_a_1024x768_50Frms.264
162+
- run: ./run_Test.sh BinaryCompareWasm Zhling_1280x720.264

.github/workflows/wasm-test.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ endif
194194

195195
test: codec_unittest$(EXEEXT)
196196
ifeq ($(BUILD_UT_EXE), Yes)
197+
ifneq (wasm,$(OS))
197198
./codec_unittest
198199
endif
200+
endif
199201

200202
else
201203
test:

build/mktargets.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,16 +268,7 @@ def find_sources():
268268
if args.binary is not None:
269269
f.write("%s$(EXEEXT): $(%s_OBJS) $(%s_DEPS)\n"%(args.binary, PREFIX, PREFIX))
270270
f.write("\t$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $(%s_OBJS) $(%s_LDFLAGS) $(LDFLAGS)\n\n"%(PREFIX, PREFIX))
271-
# for wasm build
272-
f.write("%s.html: $(%s_OBJS) $(%s_DEPS)\n"%(args.binary, PREFIX, PREFIX))
273-
f.write("\t$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $(%s_OBJS) $(%s_LDFLAGS) $(LDFLAGS)\n\n"%(PREFIX, PREFIX))
274-
275-
f.write("ifeq ($(OS), wasm)\n")
276-
f.write("binaries: %s.html\n"%args.binary)
277-
f.write("BINARIES += %s.html\n"%args.binary)
278-
f.write("else\n")
279271
f.write("binaries: %s$(EXEEXT)\n"%args.binary)
280272
f.write("BINARIES += %s$(EXEEXT)\n"%args.binary)
281-
f.write("endif")
282273

283274
f.close()

build/platform-wasm.mk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
include $(SRC_PATH)build/arch.mk
2+
EXEEXT = .html
23
SHAREDLIBSUFFIX = so
34
SHAREDLIBSUFFIXFULLVER=$(SHAREDLIBSUFFIX).$(FULL_VERSION)
45
SHAREDLIBSUFFIXMAJORVER=$(SHAREDLIBSUFFIX).$(SHAREDLIB_MAJORVERSION)
56
SHLDFLAGS = -Wl,-soname,$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER)
67
CFLAGS += -Wall -fno-strict-aliasing -fPIC -MMD -MP
78
# fix undifined symbol: __stack_chk_guard bug
89
# flags needed to build wasm
9-
CFLAGS += -U_FORTIFY_SOURCE -pthread -DWASMSIMD -msimd128 -sINITIAL_MEMORY=104857600
10-
CXXFLAGS += -U_FORTIFY_SOURCE -pthread -DWASMSIMD -msimd128 -sINITIAL_MEMORY=104857600
11-
LDFLAGS += -U_FORTIFY_SOURCE -pthread -msimd128 -sINITIAL_MEMORY=104857600
10+
CFLAGS += -U_FORTIFY_SOURCE -pthread -DWASMSIMD -msimd128 -sINITIAL_MEMORY=134217728 -sALLOW_MEMORY_GROWTH -sPROXY_TO_PTHREAD -sEXIT_RUNTIME
11+
CXXFLAGS += -U_FORTIFY_SOURCE -pthread -DWASMSIMD -msimd128 -sINITIAL_MEMORY=134217728 -sALLOW_MEMORY_GROWTH -sPROXY_TO_PTHREAD -sEXIT_RUNTIME
12+
LDFLAGS += -U_FORTIFY_SOURCE -pthread -msimd128 -sINITIAL_MEMORY=134217728 -sALLOW_MEMORY_GROWTH -sPROXY_TO_PTHREAD -sEXIT_RUNTIME
1213
ifeq ($(EMFS), nodefs)
1314
CFLAGS += -DNODEFS
1415
CXXFLAGS += -DNODEFS

0 commit comments

Comments
 (0)