Skip to content

blake2-config.h HAVE_SSE4_1 typo fix #102027

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

Closed
nono303 opened this issue Feb 18, 2023 · 4 comments
Closed

blake2-config.h HAVE_SSE4_1 typo fix #102027

nono303 opened this issue Feb 18, 2023 · 4 comments
Labels
build The build process and cross-build extension-modules C modules in the Modules dir topic-SSL type-bug An unexpected behavior, bug, or error

Comments

@nono303
Copy link

nono303 commented Feb 18, 2023

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

@nono303 nono303 added the type-bug An unexpected behavior, bug, or error label Feb 18, 2023
@arhadthedev arhadthedev added extension-modules C modules in the Modules dir build The build process and cross-build topic-SSL labels Feb 18, 2023
@terryjreedy
Copy link
Member

terryjreedy commented Feb 18, 2023

@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?

@arhadthedev
Copy link
Member

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

@arhadthedev arhadthedev reopened this Feb 26, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 22, 2023
This fixes the ssse3 / sse2 detection when sse4 is available.

(cherry picked from commit ea93bde)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Yhg1s pushed a commit that referenced this issue Mar 22, 2023
This fixes the ssse3 / sse2 detection when sse4 is available.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 22, 2023
This fixes the ssse3 / sse2 detection when sse4 is available.

(cherry picked from commit ea93bde)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Yhg1s pushed a commit that referenced this issue Mar 24, 2023
gh-102027: Fix macro name (GH-102124)

This fixes the ssse3 / sse2 detection when sse4 is available.

(cherry picked from commit ea93bde)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Yhg1s pushed a commit that referenced this issue Mar 24, 2023
gh-102027: Fix macro name (GH-102124)

This fixes the ssse3 / sse2 detection when sse4 is available.

(cherry picked from commit ea93bde)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
@Yhg1s Yhg1s closed this as completed Mar 24, 2023
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this issue Mar 27, 2023
This fixes the ssse3 / sse2 detection when sse4 is available.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
warsaw pushed a commit to warsaw/cpython that referenced this issue Apr 11, 2023
This fixes the ssse3 / sse2 detection when sse4 is available.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
@YWtheGod
Copy link

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.

@terryjreedy
Copy link
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
Labels
build The build process and cross-build extension-modules C modules in the Modules dir topic-SSL type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants