build: don't try and use -fstack-clash-protection on Windows #21421

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:skip_stack_clash_windows changing 1 files +10 −5
  1. fanquake commented at 2:33 AM on March 12, 2021: member

    This has never worked with any of the mingw-w64 compilers we use, and the -O0 is causing issues for builders applying spectre mitigations (see IRC logs).

    Recent discussion on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 would also indicate that this should just not be used on Windows.

  2. build: don't try and use -fstack-clash-protection on Windows
    This has never worked with any of the mingw-w64 compilers we use, and
    the -O0 is causing issues for builders applying spectre mitigations.
    
    Recent discussion on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458
    also indicates that this should just not be used on Windows.
    7b3434f800
  3. fanquake added the label Windows on Mar 12, 2021
  4. fanquake added the label Build system on Mar 12, 2021
  5. in configure.ac:872 in 7b3434f800
     872 | -  AX_CHECK_COMPILE_FLAG([-fstack-clash-protection],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-clash-protection"],[],["-O0"],
     873 | -    [AC_LANG_SOURCE([[class D {public: unsigned char buf[32768];}; int main() {D d; return 0;}]])])
     874 | +  case $host in
     875 | +    *mingw*)
     876 | +      dnl stack-clash-protection doesn't currently work, and likely should just be skipped for Windows.
     877 | +      dnl See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 for more details.
    


    hebasto commented at 9:49 AM on March 12, 2021:

    I'm confused by this comment as it contradicts the one from bugzilla:

    ... Windows has been doing stack clash protection since day #1


    fanquake commented at 9:59 AM on March 12, 2021:

    How does it contradict it? The two Bugzilla comments say that Windows has it's own mechanisms to handle this (and has done since day #1), hence the -fstack-clash-protection option would seem pointless, and should either be a NOP, or potentially throw an error when being applied to Windows builds.


    hebasto commented at 2:37 AM on March 23, 2021:

    Re-reading again. That makes sense now.

  6. MarcoFalke added the label Needs gitian build on Mar 12, 2021
  7. MarcoFalke added the label Needs Guix build on Mar 12, 2021
  8. DrahtBot commented at 6:02 AM on March 16, 2021: member

    <!--9cd9c72976c961c55c7acef8f6ba82cd-->

    Guix builds

    File commit e0bc27a14ceb18bfe3dd9ebdae6bef447c4ec922<br>(master) commit bbf7e6853d90aa7776e9a3bbacbbf5dd5d7f1023<br>(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz 3b30f4198b68fadf... 82bd95a23f283d85...
    *-aarch64-linux-gnu.tar.gz 176d561bd8a2aa0d... f7208a07df70b2c0...
    *-arm-linux-gnueabihf-debug.tar.gz ea017c7dff2b99be... 2018adae09571d64...
    *-arm-linux-gnueabihf.tar.gz 3ce0b418bce0f580... 3cbd4f2003c5328c...
    *-osx-unsigned.dmg 772d2aa9989e8d40... b7609e4d86314cb4...
    *-osx-unsigned.tar.gz 0d8003ee2c879e13... 04169ef0836c0ae5...
    *-osx64.tar.gz 135d20c9d45b8193... 9fc322d432c7abc6...
    *-powerpc64-linux-gnu-debug.tar.gz 0f86fbb3da88d75b... af22e85bbdc7fd68...
    *-powerpc64-linux-gnu.tar.gz 8fffb547da793622... d0c79ff194be797f...
    *-powerpc64le-linux-gnu-debug.tar.gz 25bc9f40d7593a0e... 29e5fba57a510e83...
    *-powerpc64le-linux-gnu.tar.gz 00ffc2de444f9f45... 08c5dc9d5dfa0e75...
    *-riscv64-linux-gnu-debug.tar.gz 13259ba2232c7908... be45f2da08e5fec3...
    *-riscv64-linux-gnu.tar.gz 277fa4286cd1acc3... 831a1a3004fd1522...
    *-win-unsigned.tar.gz 586f395e11db7d10... e5e7747e5301b3e1...
    *-win64-debug.zip a47083334cbdcfa3... 51a2334d130b57aa...
    *-win64-setup-unsigned.exe 926f391d3ea1f345... f32c1724eafaf9de...
    *-win64.zip cbfc8629325db892... 1695e8613ce5d7b3...
    *-x86_64-linux-gnu-debug.tar.gz ed183a137ae13cd4... d9a841621ee0d268...
    *-x86_64-linux-gnu.tar.gz f24558a571c69c68... e48cb24481106a06...
    *.tar.gz 86c28332470cb476... 42ed75d090dd7682...
    guix_build.log 456643eedd9954da... 0ea9a3b92ccb4604...
    guix_build.log.diff cbfea71f3871e8a3...
  9. DrahtBot removed the label Needs Guix build on Mar 16, 2021
  10. laanwj commented at 1:06 PM on March 19, 2021: member

    Concept and code review ACK (but untested) 7b3434f8002d1a8cf0dbd0a0caef28e783b1efd8

  11. DrahtBot commented at 11:01 PM on March 22, 2021: member

    <!--a722867cd34abeea1fadc8d60700f111-->

    Gitian builds

    File commit 63952f73b3041468fe3b25fa54858db7899273fa<br>(master) commit 7dc831a914e93fc617a7b6ea5fe2c3505a3d5743<br>(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz 5484237ee5c3fa99... 9d67b5e3b63e1d28...
    *-aarch64-linux-gnu.tar.gz 2a05550165b38652... 3a89dba8ef253c9e...
    *-arm-linux-gnueabihf-debug.tar.gz bfcf00e42246eae3... af88b638d56f2fee...
    *-arm-linux-gnueabihf.tar.gz 49401c03ceb458b0... b7c71e755b09c0f9...
    *-osx-unsigned.dmg bb46816571411f20... d3b164d923d5736b...
    *-osx64.tar.gz 87297fdb1bd1e468... af3c2442b0474bba...
    *-powerpc64-linux-gnu-debug.tar.gz ef0bc03e9dc3bc9b... d2fbb8d7ad2855ef...
    *-powerpc64-linux-gnu.tar.gz 8b994ad2faf8d00f... b0d69c68190c7486...
    *-powerpc64le-linux-gnu-debug.tar.gz a21bb50f2a1c6444... bd70da78c5d3f615...
    *-powerpc64le-linux-gnu.tar.gz ac3bbefb3bb763cf... b0363c97530eeb3a...
    *-riscv64-linux-gnu-debug.tar.gz d1127ea1c91d13d2... 826890e3a588e501...
    *-riscv64-linux-gnu.tar.gz 2a1d70a226aea599... 5c81ed317e096494...
    *-win64-debug.zip 49bb0d62d4d992b1... d1f478dfccfae62f...
    *-win64-setup-unsigned.exe 2e31a6942609ae70... 5b04d89eebb649b0...
    *-win64.zip eea2a3d2ae87bd94... 95617630c0760764...
    *-x86_64-linux-gnu-debug.tar.gz c6ec5e1f93179f02... ee29f959e84e31a7...
    *-x86_64-linux-gnu.tar.gz 9ec8794caea11319... d4c8fa68c606d785...
    *.tar.gz debbf7a0bedc3e02... 0910f5e31a22fc74...
    bitcoin-core-linux-22-res.yml e8cbff85e5387c08... e6ed49acf2289ea7...
    bitcoin-core-osx-22-res.yml d17361a4da1f9904... 8aefd81c36de17f3...
    bitcoin-core-win-22-res.yml fbc466bbb012a14d... 8f2c59264fe3ed16...
    linux-build.log bda29ffb8f627075... 100dba13f3a1009e...
    osx-build.log 4464f7ec164817d1... 89ac81df16ee9d40...
    win-build.log d947d26c42344b85... 2af8437041065d84...
    bitcoin-core-linux-22-res.yml.diff 219028f55edc21c9...
    bitcoin-core-osx-22-res.yml.diff b4a2c147972086cc...
    bitcoin-core-win-22-res.yml.diff 6d64146c7d9504ca...
    linux-build.log.diff 575498209f269775...
    osx-build.log.diff 4852a04b805a7bab...
    win-build.log.diff f5e2850f5cc73332...
  12. DrahtBot removed the label Needs gitian build on Mar 22, 2021
  13. hebasto approved
  14. hebasto commented at 2:54 AM on March 23, 2021: member

    ACK 7b3434f8002d1a8cf0dbd0a0caef28e783b1efd8, I've verified that this change does not affect builds for HOST=x86_64-w64-mingw32 by comparing sizes of the output *.exe files.

  15. fanquake merged this on Mar 23, 2021
  16. fanquake closed this on Mar 23, 2021

  17. fanquake deleted the branch on Mar 23, 2021
  18. sidhujag referenced this in commit 66e12370c9 on Mar 23, 2021
  19. PastaPastaPasta referenced this in commit be9ab45d5e on Jun 19, 2022
  20. PastaPastaPasta referenced this in commit 00188d6033 on Jun 19, 2022
  21. PastaPastaPasta referenced this in commit b2df26bec3 on Jun 27, 2022
  22. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me