Source: Chloe "SpaceToast" Kudryavtsev Remove When: The default Makefile doesn't enforce 32 bit binaries and allows for static linking. 1. Make M32 mode conditional and not dependent on cross-compilation (off by default). 2. Fix up LIBS. 3. Allow for static linking. --- a/Makefile 2019-09-04 19:14:04.134679886 -0400 +++ b/Makefile 2019-09-04 19:15:42.761338716 -0400 @@ -33,6 +33,7 @@ #CONFIG_WERROR=y # force 32 bit build for some utilities #CONFIG_M32=y +#CONFIG_STATIC=y ifdef CONFIG_DARWIN # use clang instead of gcc @@ -105,6 +106,9 @@ CFLAGS_OPT=$(CFLAGS) -O2 CFLAGS_NOLTO:=$(CFLAGS_OPT) LDFLAGS=-g +ifdef CONFIG_STATIC +LDFLAGS+=-static +endif ifdef CONFIG_LTO CFLAGS_SMALL+=-flto CFLAGS_OPT+=-flto @@ -118,11 +122,11 @@ CFLAGS+=-fsanitize=address LDFLAGS+=-fsanitize=address endif -ifdef CONFIG_WIN32 -LDEXPORT= -else +ifndef CONFIG_WIN32 +ifndef CONFIG_STATIC LDEXPORT=-rdynamic endif +endif PROGS=qjs$(EXE) qjsc$(EXE) run-test262 ifneq ($(CROSS_PREFIX),)