PowerShell / PowerShell/Win32-OpenSSH

Zlib fails to link with Whole Program Optimization enabled

Open
#2,183 1 comment 0 reactions 1 assignee View on GitHub

@tgauth is already working on this.

Since Nov 27, 2023.

Area-Build Issue-Bug Known-workaround
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce

There's a strong possibility that I'm doing something wrong here with my VS setup. That said, I believe I've faithfully followed the instructions here: https://github.com/PowerShell/Win32-OpenSSH/wiki/Building-OpenSSH-for-Windows-(using-LibreSSL-crypto).

Relevant versions:

Microsoft Visual Studio Enterprise 2022
Version 17.8.0
VisualStudio.17.Release/17.8.0+34309.116
Microsoft .NET Framework
Version 4.8.09032

Visual C++ 2022 00482-20704-71775-AA324
Microsoft Visual C++ 2022

Despite zlib and OpenSSH both referencing PlatformToolset v143, I get a link error with Whole Program Optimization enabled:

Error C1047 The object or library file '...\ZLib\bin\x64\zlib.lib' was created by a different version of the compiler than other objects like 'x64\Release\ssh\clientloop.obj'; rebuild all objects and libraries with the same compiler ssh

The error goes away if I disable this setting.

Expected behavior
It builds
Actual behavior
I get the error:
> Error	C1047	The object or library file '...\ZLib\bin\x64\zlib.lib' was created by a different version of the compiler than other objects like 'x64\Release\ssh\clientloop.obj'; rebuild all objects and libraries with the same compiler	ssh
Error details

No response

Environment data
n/a
Version

9.4.0.0-p1

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.