1
1
diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py
2
- index b3b065652e0..d361f57382e 100644
2
+ index 6ceb4404e74..94b74b5c8b0 100644
3
3
--- a/Tools/jit/_targets.py
4
4
+++ b/Tools/jit/_targets.py
5
5
@@ -10,6 +10,7 @@
@@ -10,15 +10,15 @@ index b3b065652e0..d361f57382e 100644
10
10
11
11
import _llvm
12
12
import _schema
13
- @@ -42 ,6 +43 ,7 @@ class _Target(typing.Generic[_S, _R]):
13
+ @@ -46 ,6 +47 ,7 @@ class _Target(typing.Generic[_S, _R]):
14
14
stable: bool = False
15
15
debug: bool = False
16
16
verbose: bool = False
17
17
+ cflags: str = ""
18
18
known_symbols: dict[str, int] = dataclasses.field(default_factory=dict)
19
19
20
20
def _get_nop(self) -> bytes:
21
- @@ -115 ,6 +117 ,7 @@ async def _compile(
21
+ @@ -119 ,6 +121 ,7 @@ async def _compile(
22
22
) -> _stencils.StencilGroup:
23
23
o = tempdir / f"{opname}.o"
24
24
args = [
@@ -27,44 +27,48 @@ index b3b065652e0..d361f57382e 100644
27
27
"-DPy_BUILD_CORE_MODULE",
28
28
"-D_DEBUG" if self.debug else "-DNDEBUG",
29
29
diff --git a/Tools/jit/build.py b/Tools/jit/build.py
30
- index a8cb0f67c36..663874ad439 100644
30
+ index 49b08f477db..49a1b11de47 100644
31
31
--- a/Tools/jit/build.py
32
32
+++ b/Tools/jit/build.py
33
- @@ -22,7 +22,11 @@
33
+ @@ -26,11 +26,15 @@
34
34
parser.add_argument(
35
35
"-v", "--verbose", action="store_true", help="echo commands as they are run"
36
36
)
37
37
+ parser.add_argument(
38
38
+ "--with-cflags", help="additional flags to pass to the compiler", default=""
39
39
+ )
40
40
args = parser.parse_args()
41
- args.target.debug = args.debug
42
- args.target.verbose = args.verbose
43
- + args.target.cflags = args.with_cflags
44
- args.target.build(pathlib.Path.cwd(), comment=comment, force=args.force)
41
+ for target in args.target:
42
+ target.debug = args.debug
43
+ target.force = args.force
44
+ target.verbose = args.verbose
45
+ + target.cflags = args.with_cflags
46
+ target.build(
47
+ out,
48
+ comment=comment,
45
49
diff --git a/configure b/configure
46
- index 1b75ddfa26d..3c9e550b5d3 100755
50
+ index c51192f12c8..0dcef7c2617 100755
47
51
--- a/configure
48
52
+++ b/configure
49
- @@ -8399 ,7 +8399 ,7 @@ then :
53
+ @@ -10863 ,7 +10863 ,7 @@ then :
50
54
51
55
else case e in #(
52
56
e) as_fn_append CFLAGS_NODIST " $jit_flags"
53
- - REGEN_JIT_COMMAND="\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host"
54
- + REGEN_JIT_COMMAND="\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host --with-cflags=\"\$(CONFIGURE_CFLAGS)\""
57
+ - REGEN_JIT_COMMAND="\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py ${ARCH_TRIPLES:-$ host} "
58
+ + REGEN_JIT_COMMAND="\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py ${ARCH_TRIPLES:-$ host} --with-cflags=\"\$(CONFIGURE_CFLAGS)\""
55
59
JIT_STENCILS_H="jit_stencils.h"
56
60
if test "x$Py_DEBUG" = xtrue
57
61
then :
58
62
diff --git a/configure.ac b/configure.ac
59
- index c449bb5ebb3..5f9d08a4ee7 100644
63
+ index a7b2f62579b..5998f896a4e 100644
60
64
--- a/configure.ac
61
65
+++ b/configure.ac
62
- @@ -1827 ,7 +1827 ,7 @@ AS_VAR_IF([jit_flags],
66
+ @@ -2776 ,7 +2776 ,7 @@ AS_VAR_IF([jit_flags],
63
67
[],
64
68
[AS_VAR_APPEND([CFLAGS_NODIST], [" $jit_flags"])
65
69
AS_VAR_SET([REGEN_JIT_COMMAND],
66
- - ["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host"])
67
- + ["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host --with-cflags=\"\$(CONFIGURE_CFLAGS)\""])
70
+ - ["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py ${ARCH_TRIPLES:-$ host} "])
71
+ + ["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py ${ARCH_TRIPLES:-$ host} --with-cflags=\"\$(CONFIGURE_CFLAGS)\""])
68
72
AS_VAR_SET([JIT_STENCILS_H], ["jit_stencils.h"])
69
73
AS_VAR_IF([Py_DEBUG],
70
74
[true],
0 commit comments