[GH-ISSUE #2830] OpenCL on Mesa generates wrong macro flags #1810

Closed
opened 2026-10-15 04:25:08 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @tycho on GitHub (Oct 22, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2830

There's a space missing after -D__MESA__, so the flags it generated for me included -D__MESA__-D__GPU__ which is obviously wrong. This would fix it:

diff --git a/src/common-opencl.c b/src/common-opencl.c
index dbb56ce1d..cc298f0a9 100644
--- a/src/common-opencl.c
+++ b/src/common-opencl.c
@@ -1034,7 +1034,7 @@ static char *include_source(char *pathname, int sequential_id, char *opts)
                full_path,
                global_opts,
                get_platform_vendor_id(get_platform_id(sequential_id)) == DEV_MESA ?
-                   "-D__MESA__" : opencl_get_dev_info(sequential_id),
+                   "-D__MESA__ " : opencl_get_dev_info(sequential_id),
 #ifdef __APPLE__
                "-D__OS_X__ ",
 #else
Originally created by @tycho on GitHub (Oct 22, 2017). Original GitHub issue: https://github.com/openwall/john/issues/2830 There's a space missing after `-D__MESA__`, so the flags it generated for me included `-D__MESA__-D__GPU__` which is obviously wrong. This would fix it: ```diff diff --git a/src/common-opencl.c b/src/common-opencl.c index dbb56ce1d..cc298f0a9 100644 --- a/src/common-opencl.c +++ b/src/common-opencl.c @@ -1034,7 +1034,7 @@ static char *include_source(char *pathname, int sequential_id, char *opts) full_path, global_opts, get_platform_vendor_id(get_platform_id(sequential_id)) == DEV_MESA ? - "-D__MESA__" : opencl_get_dev_info(sequential_id), + "-D__MESA__ " : opencl_get_dev_info(sequential_id), #ifdef __APPLE__ "-D__OS_X__ ", #else ```
Author
Owner

@magnumripper commented on GitHub (Oct 22, 2017):

Committed in your name in 7ff9741e1, thanks!

<!-- gh-comment-id:338499726 --> @magnumripper commented on GitHub (Oct 22, 2017): Committed in your name in 7ff9741e1, thanks!
Author
Owner

@tycho commented on GitHub (Oct 22, 2017):

Thanks @magnumripper !

<!-- gh-comment-id:338499786 --> @tycho commented on GitHub (Oct 22, 2017): Thanks @magnumripper !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1810
No description provided.