Skip to content

blake2-config.h HAVE_SSE4_1 typo fix #102027

Description

@nono303

Bug report

Unable to compile cpython on Windows with AVX enable

  1. adding <EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet> for </ClCompile> in vcxproj files (result /arch:AVX in cl.exe cmd line)
  2. MSBuild.exe C:\sdk\src\python\PCbuild\pcbuild.proj /nologo /nr:false /m:16 /p:Turbo=true /p:CL_MPCount=16 /p:RunCodeAnalysis=false /p:DebugType=None /p:DebugSymbols=true /p:WindowsTargetPlatformVersion=10.0.22621.0 /p:PlatformToolset=v143 /clp:EnableMPLogging;Summary;ShowCommandLine /v:d /p:Configuration=Release /p:Platform="x64" /p:IncludeExtensions=true /p:IncludeExternals=true /p:IncludeTests=false /p:IncludeCTypes=true /p:IncludeSSL=true /p:IncludeTkinter=false /p:IncludeUwp=true /t:RebuildAll /p:EXTERNALS_DIR="C:\sdk\release\vs17_x64-avx" /p:ExternalsSrcDir="C:\sdk\src" /p:_DLLSuffix=-81_3-x64 /p:SqliteVersionStrToParse=3.40.1.0 /nowarn:C4244
  3. result:

C:\sdk\src\python\Modules_blake2\impl\blake2-config.h(67,1): fatal error C1189: #error: "This code requires at least SSE2." (compiling source file ..\Modules_blake2\blake2s_impl.c) [C:\sdk\src\python\PCbuild\pythoncore.vcxproj]
C:\sdk\src\python\Modules_blake2\impl\blake2-config.h(67,1): fatal error C1189: #error: "This code requires at least SSE2." (compiling source file ..\Modules_blake2\blake2b_impl.c) [C:\sdk\src\python\PCbuild\pythoncore.vcxproj]

It's just a typo issue in Modules/_blake2/impl/blake2-config.h

diff --git "a/Modules/_blake2/impl/blake2-config.h" "b/Modules/_blake2/impl/blake2-config.h"
index f5dd6faa9e..c09cb4bcf0 100644
--- "a/Modules/_blake2/impl/blake2-config.h"
+++ "b/Modules/_blake2/impl/blake2-config.h"
@@ -53,7 +53,7 @@
 #endif
 #endif
 
-#ifdef HAVE_SSE41
+#ifdef HAVE_SSE4_1
 #ifndef HAVE_SSSE3
 #define HAVE_SSSE3
 #endif

The patch fix the issue
Seems to be present on every branch

Your environment

  • CPython versions tested on: branch 3.8 / tag 3.8.16
  • Operating system and architecture: Win64 vs17 AVX

Linked PRs

Activity

  1. terryjreedy commented on Feb 18, 2023

    @terryjreedy
    Member

    @tiran Can you verify that the proposed blake2 typo fix is correct?

    EDIT: Looking at the file, I see that lines 49-51 being, in main,

    #ifdef HAVE_AVX
    #ifndef HAVE_SSE4_1
    #define HAVE_SSE4_1
    

    makes it likely that line 56 should be #ifndef HAVE_SSE4_1 instead of #ifndef HAVE_SSE41.

    @ambv Do build issues like this get backported to 'security' versions?

  2. arhadthedev commented on Feb 26, 2023

    @arhadthedev
    Member

    @nono303 We close bugfix issues after the corresponding PR is backported to previous versions, just to not lose track.

  3. added a commit that references this issue on Mar 22, 2023
  4. added a commit that references this issue on Mar 22, 2023
  5. added a commit that references this issue on Mar 22, 2023
  6. added 2 commits that reference this issue on Mar 24, 2023
  7. added a commit that references this issue on Mar 27, 2023
  8. added a commit that references this issue on Apr 11, 2023
  9. YWtheGod commented on Mar 13, 2024

    @YWtheGod

    But this fix hasn't merged into branch 3.9 and lower, people who want to build version before 3.10 still got this bug.

  10. terryjreedy commented on Mar 13, 2024

    @terryjreedy
    Member

    This is standard. Non-security bugfixs are essentially never backported by us to versions that only get security-fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildextension-modulesC modules in the Modules dirtopic-SSLtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions