1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-15 20:25:17 +03:00
aports/testing/quickjs/00-makefile.patch

41 lines
982 B
Diff

Source: Chloe Kudryavtsev <code@toast.bunkerlabs.net>
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
+++ b/Makefile
@@ -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
@@ -113,6 +114,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
@@ -126,11 +130,11 @@
CFLAGS+=-fsanitize=address -fno-omit-frame-pointer
LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer
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),)