File tree 4 files changed +9
-2
lines changed
Filter options
4 files changed +9
-2
lines changed
Original file line number Diff line number Diff line change 10
10
import sys
11
11
import tempfile
12
12
import typing
13
+ import shlex
13
14
14
15
import _llvm
15
16
import _schema
@@ -42,6 +43,7 @@ class _Target(typing.Generic[_S, _R]):
42
43
stable : bool = False
43
44
debug : bool = False
44
45
verbose : bool = False
46
+ cflags : str = ""
45
47
known_symbols : dict [str , int ] = dataclasses .field (default_factory = dict )
46
48
47
49
def _get_nop (self ) -> bytes :
@@ -115,6 +117,7 @@ async def _compile(
115
117
) -> _stencils .StencilGroup :
116
118
o = tempdir / f"{ opname } .o"
117
119
args = [
120
+ * shlex .split (self .cflags ),
118
121
f"--target={ self .triple } " ,
119
122
"-DPy_BUILD_CORE_MODULE" ,
120
123
"-D_DEBUG" if self .debug else "-DNDEBUG" ,
Original file line number Diff line number Diff line change 22
22
parser .add_argument (
23
23
"-v" , "--verbose" , action = "store_true" , help = "echo commands as they are run"
24
24
)
25
+ parser .add_argument (
26
+ "--with-cflags" , help = "additional flags to pass to the compiler" , default = ""
27
+ )
25
28
args = parser .parse_args ()
26
29
args .target .debug = args .debug
27
30
args .target .verbose = args .verbose
31
+ args .target .cflags = args .with_cflags
28
32
args .target .build (pathlib .Path .cwd (), comment = comment , force = args .force )
Original file line number Diff line number Diff line change @@ -1827,7 +1827,7 @@ AS_VAR_IF([jit_flags],
1827
1827
[ ] ,
1828
1828
[ AS_VAR_APPEND ( [ CFLAGS_NODIST] , [ " $jit_flags"] )
1829
1829
AS_VAR_SET ( [ REGEN_JIT_COMMAND] ,
1830
- [ "\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host"] )
1830
+ [ "\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host --with-cflags=\"\$(CONFIGURE_CFLAGS)\" "] )
1831
1831
AS_VAR_SET ( [ JIT_STENCILS_H] , [ "jit_stencils.h"] )
1832
1832
AS_VAR_IF ( [ Py_DEBUG] ,
1833
1833
[ true] ,
You can’t perform that action at this time.
0 commit comments