Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit09dc3fc

Browse files
committed
gh-134273: Propagate CFLAGS to the JIT
1 parent29af6ce commit09dc3fc

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

‎Tools/jit/_targets.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
importsys
1111
importtempfile
1212
importtyping
13+
importshlex
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"ifself.debugelse"-DNDEBUG",

‎Tools/jit/build.py

Lines 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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎configure.ac

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp