aboutsummaryrefslogtreecommitdiffstats
path: root/testing/quickjs/00-makefile.patch
blob: bc0a2a911c991cf69dd2d95c92d61c424d3f1e23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Source: Chloe "SpaceToast" Kudryavtsev <toast@toast.cafe>
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),)