Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Win32 defines to configure.ac to ensure they are globally defined #15704

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Mar 30, 2019

#9245 no longer needs this, since the main _WIN32_WINNT got bumped by something else.

So rather than just lose it, might as well get it merged in independently.

I'm not aware of any practical effects, but it seems safer to use the same API versions everywhere.

@laanwj
Copy link
Member

laanwj commented Mar 30, 2019

I think this needs analogous MSVC build system changes.

@luke-jr
Copy link
Member Author

luke-jr commented Mar 30, 2019

Fixed

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 30, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko maflcko changed the title Move Win32 defines to configure.ac to ensure they are globally defined build: Move Win32 defines to configure.ac to ensure they are globally defined Mar 30, 2019
@maflcko maflcko changed the title build: Move Win32 defines to configure.ac to ensure they are globally defined Move Win32 defines to configure.ac to ensure they are globally defined Mar 30, 2019
@sipsorcery
Copy link
Contributor

tACK e38c194 with msvc x64.

(haven't tested the mingw build)

@practicalswift
Copy link
Contributor

FWIW: I've verified that a disassembly of the bitcoind binary built on a Ubuntu 18.04 machine with this patch applied is identical to a disassembly of the bitcoind binary built against master (as expected).

@fanquake fanquake requested a review from ken2812221 April 3, 2019 14:56
@bitcoin bitcoin deleted a comment from DrahtBot Sep 30, 2019
@maflcko
Copy link
Member

maflcko commented Sep 30, 2019

@luke-jr Needs rebase

@luke-jr
Copy link
Member Author

luke-jr commented Oct 14, 2019

Rebased

@fanquake
Copy link
Member

Concept ACK

@luke-jr
Copy link
Member Author

luke-jr commented Mar 26, 2020

Rebased (macOS native Travis failing is "normal" now, right?)

@bitcoin bitcoin deleted a comment from DrahtBot Mar 26, 2020
@hebasto
Copy link
Member

hebasto commented Mar 26, 2020

@luke-jr

... macOS native Travis failing is "normal" now, right?

Fixed in #18438.

@maflcko
Copy link
Member

maflcko commented Mar 26, 2020

Open-Close to re-run ci. See #15847 (comment)

@maflcko maflcko closed this Mar 26, 2020
@maflcko maflcko reopened this Mar 26, 2020
@DrahtBot
Copy link
Contributor

Gitian builds

File commit 7f9dedb
(master)
commit 9f3c700
(master and this pull)
bitcoin-0.19.99-aarch64-linux-gnu-debug.tar.gz 8aa34845a916014d... 23303000f0b5188f...
bitcoin-0.19.99-aarch64-linux-gnu.tar.gz 0fb3dd16db30ea00... 0c27113827028b32...
bitcoin-0.19.99-arm-linux-gnueabihf-debug.tar.gz 797f185a8e62f6fe... f1fc0efc24d7ae81...
bitcoin-0.19.99-arm-linux-gnueabihf.tar.gz 871094b510da0ac7... 8b57425f10b09806...
bitcoin-0.19.99-osx-unsigned.dmg a159b1b99b607907... 0412b6088a2a57d1...
bitcoin-0.19.99-osx64.tar.gz 1fb6370553afcb22... 282732517f302b7b...
bitcoin-0.19.99-riscv64-linux-gnu-debug.tar.gz 0b86916151aea5a3... 503a1e400eb736f1...
bitcoin-0.19.99-riscv64-linux-gnu.tar.gz 4efb63771485711b... 1c6b0d8864e2a125...
bitcoin-0.19.99-win64-debug.zip dd825e6168d39c90... da019700489cbb7f...
bitcoin-0.19.99-win64-setup-unsigned.exe d1f790ad8c257da0... 75715436f1e5202d...
bitcoin-0.19.99-win64.zip 49dc4119ae2a01c4... 01c54170da20557e...
bitcoin-0.19.99-x86_64-linux-gnu-debug.tar.gz 2a144f502390b6e3... 5e9967340800b007...
bitcoin-0.19.99-x86_64-linux-gnu.tar.gz af6a5d2d555569a4... b723bcca07a16af3...
bitcoin-0.19.99.tar.gz 900859565b6ee1fe... f2b3f76cf3dca4b3...
bitcoin-core-linux-0.20-res.yml 70c720b679a19c93... a20fc7454865e0f0...
bitcoin-core-osx-0.20-res.yml 5766a2f7c8d8547a... 0e18bba67b5f4ffd...
bitcoin-core-win-0.20-res.yml a95a890f0d0cb882... f81ff95c1bb4bb04...
linux-build.log 8510c43606df6b17... bf7cdc495ec6276c...
osx-build.log b2fce58471126628... 317e66cb99d4dcbc...
win-build.log 630e3d23ee0657f4... 949ca0d5dc8aca2f...
bitcoin-core-linux-0.20-res.yml.diff fd82f4133c1676fb...
bitcoin-core-osx-0.20-res.yml.diff c79b3e99c65bfa8e...
bitcoin-core-win-0.20-res.yml.diff 728981f0a31171d4...
linux-build.log.diff e4719bcf8c1fe6a2...
osx-build.log.diff 89b8fdc525014cca...
win-build.log.diff 2b0aebdbb53a8ca7...

@luke-jr
Copy link
Member Author

luke-jr commented Aug 20, 2020

Rebased

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 1ccb9f3 - checked that the binaries produced are the same.

If anyone wants to read into the origins/effects of these definitions, here are a couple articles:
Where did WIN32_LEAN_AND_MEAN come from?
What's the difference between WINVER, _WIN32_WINNT, _WIN32_WINDOWS, and _WIN32_IE?.

While reviewing I did check the time & lines saved in preprocessing by passing WIN32_LEAN_AND_MEAN. i.e:

#include <windows.h>

int main() {
	return 0;
}
# x86_64-w64-mingw32-g++ (GCC) 10-win32 20200525
# mingw-w64 7.0.0

time x86_64-w64-mingw32-g++ -E test.cpp | wc -l
80856 lines
avg time of 0.40s

time x86_64-w64-mingw32-g++ -E test.cpp -DWIN32_LEAN_AND_MEAN
54995 lines
avg time of 0.13s

# also checked with more of our defines
time x86_64-w64-mingw32-g++ -E test.cpp -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN -D_MT -DWIN32 -D_WINDOWS -D_FILE_OFFSET_BITS=64 | wc -l
56884 lines
avg time ~ the same as -DWIN32_LEAN_AND_MEAN

I might follow up with some documentation additions to configure.ac.

@fanquake fanquake merged commit 8e0f341 into bitcoin:master Aug 25, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Aug 25, 2020
…y are globally defined

1ccb9f3 Move Win32 defines to configure.ac to ensure they are globally defined (Luke Dashjr)

Pull request description:

  bitcoin#9245 no longer needs this, since the main `_WIN32_WINNT` got bumped by something else.

  So rather than just lose it, might as well get it merged in independently.

  I'm not aware of any practical effects, but it seems safer to use the same API versions everywhere.

ACKs for top commit:
  fanquake:
    ACK 1ccb9f3 - checked that the binaries produced are the same.

Tree-SHA512: 273e9186579197be01b443b6968e26b9a8031d356fabc5b73aa967fcdb837df195b7ce0fc4e4529c85d9b86da6f2d7ff1bf56a3ff0cbbcd8cee8a9c2bf70a244
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 2, 2020
Summary:
```
[...]

I'm not aware of any practical effects, but it seems safer to use the
same API versions everywhere.
```

Backport of core [[bitcoin/bitcoin#15704 | PR15704]].

Depends on D7741.

Test Plan:
```
cmake -GNinja .. \
  -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Win64.cmake \
  -DBUILD_BITCOIN_SEEDER=OFF
ninja
```

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7742
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants