Skip to content

Commit 618a4a6

Browse files
Revert CI simplication and address comments for memcpy
1 parent 0540ba3 commit 618a4a6

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

.github/workflows/jit.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ concurrency:
3131

3232
env:
3333
FORCE_COLOR: 1
34-
LLVM_VERSION: 20
3534

3635
jobs:
3736
interpreter:
@@ -68,6 +67,8 @@ jobs:
6867
debug:
6968
- true
7069
- false
70+
llvm:
71+
- 20
7172
include:
7273
- target: i686-pc-windows-msvc/msvc
7374
architecture: Win32
@@ -109,7 +110,7 @@ jobs:
109110
if: runner.os == 'macOS'
110111
run: |
111112
brew update
112-
brew install llvm@${{ env.LLVM_VERSION }}
113+
brew install llvm@${{ matrix.llvm }}
113114
export SDKROOT="$(xcrun --show-sdk-path)"
114115
# Set MACOSX_DEPLOYMENT_TARGET and -Werror=unguarded-availability to
115116
# make sure we don't break downstream distributors (like uv):
@@ -122,8 +123,8 @@ jobs:
122123
- name: Linux
123124
if: runner.os == 'Linux'
124125
run: |
125-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
126-
export PATH="$(llvm-config-${{ env.LLVM_VERSION }} --bindir):$PATH"
126+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
127+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
127128
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
128129
make all --jobs 4
129130
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
@@ -133,6 +134,11 @@ jobs:
133134
needs: interpreter
134135
runs-on: ubuntu-24.04
135136
timeout-minutes: 90
137+
strategy:
138+
fail-fast: false
139+
matrix:
140+
llvm:
141+
- 20
136142
steps:
137143
- uses: actions/checkout@v4
138144
with:
@@ -142,8 +148,8 @@ jobs:
142148
python-version: '3.11'
143149
- name: Build with JIT enabled and GIL disabled
144150
run: |
145-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
146-
export PATH="$(llvm-config-${{ env.LLVM_VERSION }} --bindir):$PATH"
151+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
152+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
147153
./configure --enable-experimental-jit --with-pydebug --disable-gil
148154
make all --jobs 4
149155
- name: Run tests
@@ -156,6 +162,11 @@ jobs:
156162
needs: interpreter
157163
runs-on: ubuntu-24.04
158164
timeout-minutes: 90
165+
strategy:
166+
fail-fast: false
167+
matrix:
168+
llvm:
169+
- 20
159170
steps:
160171
- uses: actions/checkout@v4
161172
with:
@@ -165,8 +176,8 @@ jobs:
165176
python-version: '3.11'
166177
- name: Build with JIT
167178
run: |
168-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
169-
export PATH="$(llvm-config-${{ env.LLVM_VERSION }} --bindir):$PATH"
179+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
180+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
170181
./configure --enable-experimental-jit --with-pydebug
171182
make all --jobs 4
172183
- name: Run tests without optimizations

Python/jit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ patch_x86_64_trampoline(unsigned char *location, int ordinal, jit_state *state)
542542
*/
543543
trampoline[0] = 0xFF;
544544
trampoline[1] = 0x25;
545-
*(uint32_t *)(trampoline + 2) = 0;
546-
*(uint64_t *)(trampoline + 6) = value;
545+
memset(trampoline + 2, 0, 4);
546+
memcpy(trampoline + 6, &value, 8);
547547

548548
// Patch the call site to call the trampoline instead
549549
patch_32r(location, (uintptr_t)trampoline - 4);

0 commit comments

Comments
 (0)