Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
efd5863
First draft of supporting fat builds on macOS with the experimental JIT
ronaldoussoren Feb 20, 2024
4f493cd
merge conflict
savannahostrowski Sep 25, 2024
a55268e
fix up merge
savannahostrowski Sep 25, 2024
bce7980
add fix for CI?;
savannahostrowski Sep 25, 2024
b606b48
Fix up to make generic
savannahostrowski Sep 25, 2024
a382a44
Fix up conditions
savannahostrowski Sep 27, 2024
ff3d363
Save state before merge
savannahostrowski Mar 26, 2025
3bc2820
Merge main and fix conflicts
savannahostrowski Mar 26, 2025
348f2b6
Fix event loop binding error for _CORES in FAT builds
savannahostrowski Mar 26, 2025
4b31a30
📜🤖 Added by blurb_it.
blurb-it[bot] Mar 26, 2025
4564bc4
Try using weakref?
savannahostrowski Mar 26, 2025
2d381ca
Merge branch 'og_fat_build' of https://github.com/savannahostrowski/c…
savannahostrowski Mar 26, 2025
49f86a1
Remove weakref and lazily instantiate cores
savannahostrowski Mar 27, 2025
467ffe1
use Runner
savannahostrowski Apr 3, 2025
fd858bc
Merge branch 'main' into og_fat_build
savannahostrowski Apr 3, 2025
58649ff
Remove conditional and fix indentation in stencils
savannahostrowski Apr 11, 2025
182612c
Merge branch 'og_fat_build' of https://github.com/savannahostrowski/c…
savannahostrowski Apr 11, 2025
30a4d99
Merge branch 'main' into og_fat_build
savannahostrowski Apr 11, 2025
b172a41
CI updates
savannahostrowski Apr 11, 2025
18e77f2
Merge branch 'og_fat_build' of https://github.com/savannahostrowski/c…
savannahostrowski Apr 11, 2025
de3f896
Remove extra space
savannahostrowski Apr 11, 2025
7c22761
Fix condition typo
savannahostrowski Apr 11, 2025
c54250b
undo
savannahostrowski Apr 11, 2025
c21573f
Update jit.yml
savannahostrowski Apr 11, 2025
4332f10
Merge branch 'main' into og_fat_build
savannahostrowski Apr 16, 2025
dd5f196
Merge branch 'main' into og_fat_build
brandtbucher Apr 28, 2025
cdc4bfb
Merge branch 'main' into og_fat_build
savannahostrowski Apr 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge main and fix conflicts
  • Loading branch information
savannahostrowski committed Mar 26, 2025
commit 3bc28205c31e79e313d3a56116350ba0514e5d55
40 changes: 29 additions & 11 deletions Tools/jit/_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
CPYTHON = TOOLS.parent
PYTHON_EXECUTOR_CASES_C_H = CPYTHON / "Python" / "executor_cases.c.h"
TOOLS_JIT_TEMPLATE_C = TOOLS_JIT / "template.c"
ASYNCIO_RUNNER=asyncio.Runner()
ASYNCIO_RUNNER = asyncio.Runner()

_S = typing.TypeVar("_S", _schema.COFFSection, _schema.ELFSection, _schema.MachOSection)
_R = typing.TypeVar(
"_R", _schema.COFFRelocation, _schema.ELFRelocation, _schema.MachORelocation
)


@dataclasses.dataclass
class _Target(typing.Generic[_S, _R]):
triple: str
Expand All @@ -44,6 +45,7 @@ class _Target(typing.Generic[_S, _R]):
debug: bool = False
verbose: bool = False
known_symbols: dict[str, int] = dataclasses.field(default_factory=dict)
basename: str = ""

def _compute_digest(self, out: pathlib.Path) -> str:
hasher = hashlib.sha256()
Expand Down Expand Up @@ -178,7 +180,12 @@ async def _build_stencils(self) -> dict[str, _stencils.StencilGroup]:
return stencil_groups

def build(
self, out: pathlib.Path, *, comment: str = "", force: bool = False, stencils_h: str = "jit_stencils.h"
self,
out: pathlib.Path,
*,
comment: str = "",
force: bool = False,
stencils_h: str = "jit_stencils.h",
) -> None:
"""Build jit_stencils.h in the given directory."""
if not self.stable:
Expand Down Expand Up @@ -499,30 +506,41 @@ def get_target(host: str) -> _COFF | _ELF | _MachO:
target: _COFF | _ELF | _MachO
if re.fullmatch(r"aarch64-apple-darwin.*", host):
condition = "defined(__aarch64__) && defined(__APPLE__)"
condition, alignment=8, prefix="_")
>
host, condition, alignment=8, prefix="_", basename="aarch64-apple-darwin"
)
elif re.fullmatch(r"aarch64-pc-windows-msvc", host):
args = ["-fms-runtime-lib=dll"]
args = ["-fms-runtime-lib=dll", "-fplt"]
condition = "defined(_M_ARM64)"
condition, alignment=8, args=args)
elif re.fullmatch(r"aarch64-.*-linux-gnu", host):
args = ["-fpic"]
args = [
"-fpic",
# On aarch64 Linux, intrinsics were being emitted and this flag
# was required to disable them.
"-mno-outline-atomics",
]
condition = "aarch64__) && defined(__linux__)"
condition, alignment=8, args=args)
elif re.fullmatch(r"i686-pc-windows-msvc", host):
args = ["-DPy_NO_ENABLE_SHARED"]
args = [
"-DPy_NO_ENABLE_SHARED",
# __attribute__((preserve_none)) is not supported
"-Wno-ignored-attributes",
]
condition = "defined(_M_IX86)"
condition, args=args, ghccc=True, prefix="_")
condition, args=args, prefix="_")
elif re.fullmatch(r"x86_64-apple-darwin.*", host):
condition = "defined(__x86_64__) && defined(__APPLE__)"
condition, ghccc=True, prefix="_")
condition, prefix="_", basename="x86_64-apple-darwin")
elif re.fullmatch(r"x86_64-pc-windows-msvc", host):
args = ["-fms-runtime-lib=dll"]
condition = "defined(_M_X64)"
condition, args=args, ghccc=True)
condition, args=args)
elif re.fullmatch(r"x86_64-.*-linux-gnu", host):
args = ["-fpic"]
args = ["-fno-pic", "-mcmodel=medium", "-mlarge-data-threshold=0"]
condition = "defined(__x86_64__) && defined(__linux__)"
condition, args=args, ghccc=True)
condition, args=args)
else:
raise ValueError(host)
return target
111 changes: 40 additions & 71 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.