Skip to content

Conversation

@dscho
Copy link
Member

@dscho dscho commented Nov 24, 2022

With the upgrade to mingw-w64-git v2.39.0-rc0, this build started failing, see e.g. here.

The culprit is that pesky libssp-0.dll which used to be required for -fstack-protector (i.e. GCC's stack-smashing protector), but is no longer needed when compiling with a newer mingw-w64-gcc.

The fix is a little tricky because we essentially have to make sure that git.exe does not require the libssp-0.dll before excluding that file.

A recent GCC update made that library obsolete (it used to be required
to make `-fstack-protector` work). However, we had not re-built
`git.exe` with that newer GCC version, therefore we still needed to ship
it.

Now that Git v2.39.0-rc0 is available, we have a new `git.exe` that no
longer requires `libssp-0.dll`, and since it was the last user of that
library, now the `check-for-missing-dlls` check fails, complaining that
the library should no longer be included.

We have to be careful to keep the script working even when a `git.exe`
is shipped that is built using an older GCC: every once in a blue moon,
the Git for Windows project needs to release MinGit backports, and those
are traditionally done using the very snapshot of the Git for Windows
SDK with which that release train was started. And that snapshot will
still have an older GCC.

To accommodate for that, we do not simply exclude the `.dll` but ensure
that the `git.exe` does not need it. If it needs it, we include it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Currently there is only a non-intuitive way to check for missing DLLs in
the MinGit flavor of Git for Windows. Let's add an intuitive way.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Nov 24, 2022
@dscho dscho merged commit 38a1847 into git-for-windows:main Nov 24, 2022
@dscho dscho deleted the only-ship-libssp-when-needed branch November 24, 2022 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant