Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 09dc3fc

Browse filesBrowse files
committed
gh-134273: Propagate CFLAGS to the JIT
1 parent 29af6ce commit 09dc3fc
Copy full SHA for 09dc3fc

File tree

4 files changed

+9
-2
lines changed
Filter options

4 files changed

+9
-2
lines changed

‎Tools/jit/_targets.py

Copy file name to clipboardExpand all lines: Tools/jit/_targets.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import sys
1111
import tempfile
1212
import typing
13+
import shlex
1314

1415
import _llvm
1516
import _schema
@@ -42,6 +43,7 @@ class _Target(typing.Generic[_S, _R]):
4243
stable: bool = False
4344
debug: bool = False
4445
verbose: bool = False
46+
cflags: str = ""
4547
known_symbols: dict[str, int] = dataclasses.field(default_factory=dict)
4648

4749
def _get_nop(self) -> bytes:
@@ -115,6 +117,7 @@ async def _compile(
115117
) -> _stencils.StencilGroup:
116118
o = tempdir / f"{opname}.o"
117119
args = [
120+
*shlex.split(self.cflags),
118121
f"--target={self.triple}",
119122
"-DPy_BUILD_CORE_MODULE",
120123
"-D_DEBUG" if self.debug else "-DNDEBUG",

‎Tools/jit/build.py

Copy file name to clipboardExpand all lines: Tools/jit/build.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
parser.add_argument(
2323
"-v", "--verbose", action="store_true", help="echo commands as they are run"
2424
)
25+
parser.add_argument(
26+
"--with-cflags", help="additional flags to pass to the compiler", default=""
27+
)
2528
args = parser.parse_args()
2629
args.target.debug = args.debug
2730
args.target.verbose = args.verbose
31+
args.target.cflags = args.with_cflags
2832
args.target.build(pathlib.Path.cwd(), comment=comment, force=args.force)

‎configure

Copy file name to clipboardExpand all lines: configure
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac

Copy file name to clipboardExpand all lines: configure.ac
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,7 @@ AS_VAR_IF([jit_flags],
18271827
[],
18281828
[AS_VAR_APPEND([CFLAGS_NODIST], [" $jit_flags"])
18291829
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)\""])
18311831
AS_VAR_SET([JIT_STENCILS_H], ["jit_stencils.h"])
18321832
AS_VAR_IF([Py_DEBUG],
18331833
[true],

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.