Skip to content

Commit bdf9bd8

Browse files
committed
fix: ELF load command address/offset not properly aligned
Related esptool issue: https://github.com/espressif/esptool/actions/runs/20955204267/job/60330279537
1 parent 694f52f commit bdf9bd8

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/workflows/build-wheels-platforms.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ jobs:
127127
-e MIN_IDF_MINOR_VERSION=${{ needs.get-supported-versions.outputs.min_idf_minor_version }} \
128128
-e GH_TOKEN="${GH_TOKEN}" \
129129
-e PIP_NO_CACHE_DIR=1 \
130+
-e LDFLAGS="-Wl,-z,max-page-size=0x1000" \
130131
python:${{ matrix.python-version }}-bookworm \
131132
bash -c "
132133
set -e
@@ -152,6 +153,7 @@ jobs:
152153
-e MIN_IDF_MINOR_VERSION=${{ needs.get-supported-versions.outputs.min_idf_minor_version }} \
153154
-e GH_TOKEN="${GH_TOKEN}" \
154155
-e PIP_NO_CACHE_DIR=1 \
156+
-e LDFLAGS="-Wl,-z,max-page-size=0x1000" \
155157
python:${{ matrix.python-version }}-bullseye \
156158
bash -c "
157159
set -e

.github/workflows/build-wheels-python-dependent.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ jobs:
134134
-e PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 \
135135
-e GH_TOKEN="${GH_TOKEN}" \
136136
-e PIP_NO_CACHE_DIR=1 \
137+
-e LDFLAGS="-Wl,-z,max-page-size=0x1000" \
137138
python:${{ matrix.python-version }}-bookworm \
138139
bash -c "
139140
set -e
@@ -157,6 +158,7 @@ jobs:
157158
-e PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 \
158159
-e GH_TOKEN="${GH_TOKEN}" \
159160
-e PIP_NO_CACHE_DIR=1 \
161+
-e LDFLAGS="-Wl,-z,max-page-size=0x1000" \
160162
python:${{ matrix.python-version }}-bullseye \
161163
bash -c "
162164
set -e

repair_wheels.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,15 @@ def repair_wheel_macos(wheel_path: Path, temp_dir: Path) -> subprocess.Completed
119119

120120

121121
def repair_wheel_linux(wheel_path: Path, temp_dir: Path) -> subprocess.CompletedProcess[str]:
122-
"""Repair Linux wheel using auditwheel."""
122+
"""Repair Linux wheel using auditwheel.
123+
124+
Uses --strip option to strip debugging symbols which can help with
125+
ELF alignment issues on ARM (fixes "ELF load command address/offset not properly aligned" errors).
126+
"""
123127
result = subprocess.run(
124-
["auditwheel", "repair", str(wheel_path), "-w", str(temp_dir)], capture_output=True, text=True
128+
["auditwheel", "repair", str(wheel_path), "-w", str(temp_dir), "--strip"],
129+
capture_output=True,
130+
text=True,
125131
)
126132
return result
127133

0 commit comments

Comments
 (0)