Skip to content

Commit ba35cb9

Browse files
authored
Merge pull request #6 from git-for-windows/rebaseall-in-i686-msys-builds
build-and-deploy(i686): address the dreaded `.dll` base address problem
2 parents 74b1df8 + a0dda02 commit ba35cb9

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)