diff --git a/source/Makefile.mk b/source/Makefile.mk index 61c6a2c36..c1f302df7 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -48,10 +48,13 @@ LINK_OPTS += -Wl,-x endif else # Common linker flags -LINK_OPTS = -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed +LINK_OPTS = -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 ifneq ($(SKIP_STRIPPING),true) LINK_OPTS += -Wl,--strip-all endif +ifneq ($(WASM),true) +LINK_OPTS += -Wl,--as-needed +endif endif ifeq ($(NOOPT),true) @@ -85,8 +88,13 @@ BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden CXXFLAGS += -fvisibility-inlines-hidden endif +# ifeq ($(WASM),true) +# BASE_FLAGS += -s USE_PTHREADS=1 +# LINK_FLAGS += -s USE_PTHREADS=1 +# endif + ifeq ($(WITH_LTO),true) -BASE_FLAGS += -fno-strict-aliasing -flto -ffat-lto-objects +BASE_FLAGS += -fno-strict-aliasing -flto endif 32BIT_FLAGS = -m32 @@ -97,8 +105,11 @@ BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS) BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++11 $(CXXFLAGS) LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) -ifneq ($(MACOS),true) -# Not available on MacOS +ifeq ($(WASM),true) +# Web-Assembly has its own dedicated syntax +LINK_FLAGS += -s LLD_REPORT_UNDEFINED +else ifneq ($(MACOS),true) +# And not available on MacOS LINK_FLAGS += -Wl,--no-undefined endif diff --git a/source/includes/CarlaDefines.h b/source/includes/CarlaDefines.h index e1df62a0f..b90abf887 100644 --- a/source/includes/CarlaDefines.h +++ b/source/includes/CarlaDefines.h @@ -323,8 +323,4 @@ typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; -#ifdef CARLA_OS_WASM -typedef int ssize_t; -#endif - #endif /* CARLA_DEFINES_H_INCLUDED */