From cfe8ef68b6bef2bf6395ac6f18d982288ea7eae7 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Tue, 17 Oct 2023 03:16:30 +0100 Subject: [PATCH] Upgrade Emscripten + build fixes - Upgraded to 3.1.47. - EM_CACHE override leads to some new issues with package search in sysroot, probably because sysroot is hardcoded in PKG_CONFIG* variables. Use Docker's path mapping mechanism instead. - Added temporary workaround for new issue from https://github.com/emscripten-core/emscripten/issues/16836. --- Dockerfile | 5 ++--- Makefile | 4 +++- build.sh | 7 +++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 31ab0de..6b0ff24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM emscripten/emsdk:3.1.3 -RUN apt-get update && apt-get install -qqy autoconf autopoint pkg-config +FROM emscripten/emsdk:3.1.47 +RUN apt-get update && apt-get install -qqy autoconf autopoint pkg-config libtool libtool-bin WORKDIR /src -ENV EM_CACHE /src/deps/.emcache CMD ["sh", "-c", "emmake make -j`nproc`"] diff --git a/Makefile b/Makefile index 15451c7..53f7605 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SYSROOT = $(EM_CACHE)/sysroot +SYSROOT = /emsdk/upstream/emscripten/cache/sysroot # Add custom sysroot to library & macro search paths. export LDFLAGS += -L$(SYSROOT)/lib @@ -6,6 +6,8 @@ export ACLOCAL_PATH := $(SYSROOT)/share/aclocal:$(ACLOCAL_PATH) # Common linking flags for all targets. export LDFLAGS += -s DYNAMIC_EXECUTION=0 -s AUTO_JS_LIBRARIES=0 -s AUTO_NATIVE_LIBRARIES=0 +# Temporary workaround for https://github.com/emscripten-core/emscripten/issues/16836. +export LDFLAGS += -Wl,-u,ntohs # Common compilation & linking flags for all langs and targets. COMMON_FLAGS = -Os -flto diff --git a/build.sh b/build.sh index f234196..6f3b13c 100755 --- a/build.sh +++ b/build.sh @@ -16,16 +16,15 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -if [ -z "$CI" ] -then +if [ -z "$CI" ]; then DOCKER_INTERACTIVE_OPTS="-it" else DOCKER_INTERACTIVE_OPTS="" fi -docker build -t web-gphoto2 - < Dockerfile +docker build -t web-gphoto2 -