Skip to content

Commit a0dda02

Browse files
committed
build-and-deploy(i686): rebase the .dll base addresses
This is necessary to avoid the dreaded i686 problems described in https://github.com/git-for-windows/git/wiki/32-bit-issues whose symptoms can look like this: 1 [main] perl 5307 child_info_fork::abort: address space needed by 'Cwd.dll' (0x1F0000) is already occupied For an example where this symptom raises its ugly head see e.g. https://github.com/git-for-windows/git-for-windows-automation/actions/runs/3747937026/jobs/6364819440 Let's use the common strategy to run the `rebaseall` script. This is a slightly edited copy of the same step in MSYS2-packages' `build-and-deploy` workflow: https://github.com/git-for-windows/MSYS2-packages/blob/6628f78d1359/.github/workflows/build-and-deploy.yml#L60-L76 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 74b1df8 commit a0dda02

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,35 @@ jobs:
154154
shell: bash
155155
run: pacman -Syyu --noconfirm
156156

157+
- name: rebase `.dll` base addresses
158+
if: env.ARCHITECTURE == 'i686' && !contains('msys2-runtime gnupg', env.PACKAGE_TO_BUILD)
159+
shell: powershell
160+
run: |
161+
cd C:\git-sdk-32-full
162+
if (!$?) { exit(1); }
163+
164+
$env:MSYSTEM = "MINGW32"
165+
$env:PATH = "$(Get-Location)\usr\bin;" + $env:PATH
166+
$env:MSYS2_PATH_TYPE = "minimal"
167+
168+
# Disable pacman's post-transaction hook that would mess everything up, if it exists
169+
sh.exe -lc "set -x && rm -f /usr/share/libalpm/hooks/rebase.hook"
170+
171+
sh.exe -lc "set -x && find /usr/lib/perl5/*_perl -name \*.dll >perl-dlls.txt"
172+
type perl-dlls.txt
173+
dash -x /usr/bin/rebaseall -p -T perl-dlls.txt
174+
175+
# Work around for:
176+
# - address space needed by 'Cwd.dll' is already occupied
177+
# - address space needed by 'Dumper.dll' is already occupied
178+
# etc
179+
bash -lc "set -x && rebase -b 0x61500000 /usr/lib/perl5/core_perl/auto/*/{*,*/*}.dll"
180+
# Work around for:
181+
# - address space needed by 'Cwd.dll' is already occupied
182+
bash -lc "set -x && rebase -v -b 0x63f00000 /usr/lib/perl5/core_perl/auto/Cwd/Cwd.dll"
183+
# verify the base address
184+
bash -lc "set -x && rebase -v -i /usr/lib/perl5/core_perl/auto/Cwd/Cwd.dll"
185+
157186
- name: Get GPG key(s)
158187
shell: bash
159188
env:

0 commit comments

Comments
 (0)