This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: blake2: compile error with -march=bdver2
Type: compile error Stage: resolved
Components: Extension Modules Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: Joseph Mitzen, christian.heimes, devurandom, floppymaster, ned.deily
Priority: high Keywords:

Created on 2017-02-08 17:29 by floppymaster, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
build.log floppymaster, 2017-02-08 17:29 build log
Messages (8)
msg287356 - (view) Author: Mike Gilbert (floppymaster) * Date: 2017-02-08 17:29
When compiling python-3.6.0 with -march=bdver2, the blake2 module fails to build.

In file included from /var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s-round.h:70:0,
                 from /var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s.c:40,
                 from /var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/blake2s_impl.c:32:
/var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s-load-xop.h:29:4: error: expected identifier or '(' before 'return'
    return _mm_blendv_epi8(t0, s1, mask);
    ^
/var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s-load-xop.h:30:1: error: expected identifier or '(' before '}' token
 }*/
 ^
/var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s-load-xop.h:30:3: error: expected identifier or '(' before '/' token
 }*/
   ^
In file included from /var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/blake2s_impl.c:32:0:
/var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s.c: In function 'blake2s_init0':
/var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s.c:167:38: error: 'blake2s_IV' undeclared (first use in this function)
   for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i];
                                      ^
/var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s.c:167:38: note: each undeclared identifier is reported only once for each function it appears in
/var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s.c: In function 'PyBlake2_blake2s_init_param':
/var/tmp/portage/dev-lang/python-3.6.0/work/Python-3.6.0/Modules/_blake2/impl/blake2s.c:176:44: error: 'blake2s_IV' undeclared (first use in this function)
   const uint8_t * v = ( const uint8_t * )( blake2s_IV );
                                            ^
msg287357 - (view) Author: Mike Gilbert (floppymaster) * Date: 2017-02-08 17:30
Downstream bug report: https://bugs.gentoo.org/show_bug.cgi?id=608586
msg287406 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2017-02-09 11:59
It's a bug in Blake2's reference implementation with nested C++ comments (/* /* */ */). https://github.com/BLAKE2/BLAKE2/commit/259e61dedee5383eac1a90db6ef88f9ccdcf6002#diff-ac1a341ec0ed38dc5d219572f4282287 fixed the bug. For Python 3.6.1 I'm going to update Python's copy of blake2.
msg287407 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2017-02-09 12:01
I don't have time to fix the issue right away. Python's copy of blake2 needs some manual massaging and tweaking.
msg289963 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-03-22 03:31
This didn't make it in time for 3.6.1; deferred to 3.6.2.
msg295655 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-06-10 18:58
What's the status of this issue?  If it's not going to be fixed prior to 3.6.2rc1, I'm going to downgrade it from "release blocker" as we've already released 3.6.1 without it.
msg309043 - (view) Author: Joseph Mitzen (Joseph Mitzen) Date: 2017-12-25 21:18
Is this ever going to get merged? The gentoo bug report link includes a patch that simply removes the nested comments, which is all that is needed to get the code to compile properly on Bulldozer processors. There's no "manual massaging" or anything else necessary to fix the bug. I've tested it out and it works.
msg309098 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2017-12-27 19:25
The issue has been fixed on Nov 1st in PR https://github.com/python/cpython/pull/4173 (master) and https://github.com/python/cpython/pull/4214 (3.6.4).
History
Date User Action Args
2022-04-11 14:58:43adminsetgithub: 73690
2017-12-27 19:25:19christian.heimessetstatus: open -> closed
resolution: fixed
messages: + msg309098

stage: needs patch -> resolved
2017-12-25 21:18:28Joseph Mitzensetnosy: + Joseph Mitzen
messages: + msg309043
2017-07-30 12:08:18devurandomsetnosy: + devurandom
2017-06-13 02:37:17ned.deilysetpriority: release blocker -> high
2017-06-10 18:58:23ned.deilysetmessages: + msg295655
2017-03-22 03:31:29ned.deilysetmessages: + msg289963
2017-02-09 12:01:08christian.heimessetpriority: normal -> release blocker

type: compile error
assignee: christian.heimes
versions: + Python 3.7
nosy: + ned.deily

messages: + msg287407
stage: needs patch
2017-02-09 11:59:34christian.heimessetnosy: + christian.heimes
messages: + msg287406
2017-02-08 17:30:00floppymastersetmessages: + msg287357
2017-02-08 17:29:23floppymastercreate