diff -ruN '--exclude=*.o' '--exclude=*.a' '--exclude=Makefile' a/include/backend.h b/include/backend.h --- a/include/backend.h 2025-08-23 08:43:56.000000000 +0000 +++ b/include/backend.h 2026-04-25 09:28:52.366519852 +0000 @@ -70,7 +70,7 @@ int run_hip_kernel_memset32 (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 offset, const u32 value, const u64 size); int run_hip_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, hipDeviceptr_t buf, const u64 size); -#if defined (__APPLE__) +#if defined (__APPLE__) && defined (WITH_METAL) int run_metal_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, mtl_mem_t buf, const u64 num); int run_metal_kernel_utf8toutf16le (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, mtl_mem_t buf, const u64 num); int run_metal_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, mtl_mem_t buf, const u64 offset, const u8 value, const u64 size); diff -ruN '--exclude=*.o' '--exclude=*.a' '--exclude=Makefile' a/include/ext_metal.h b/include/ext_metal.h --- a/include/ext_metal.h 2025-08-23 08:43:56.000000000 +0000 +++ b/include/ext_metal.h 2026-04-25 09:28:52.074512112 +0000 @@ -6,7 +6,7 @@ #ifndef HC_EXT_METAL_H #define HC_EXT_METAL_H -#if defined (__APPLE__) +#if defined (__APPLE__) && defined (WITH_METAL) #include #include @@ -228,6 +228,6 @@ int hc_mtlFinish (void *hashcat_ctx, mtl_command_queue command_queue); -#endif // __APPLE__ +#endif // __APPLE__ && WITH_METAL #endif // HC_EXT_METAL_H diff -ruN '--exclude=*.o' '--exclude=*.a' '--exclude=Makefile' a/src/autotune.c b/src/autotune.c --- a/src/autotune.c 2025-08-23 08:43:56.000000000 +0000 +++ b/src/autotune.c 2026-04-25 09:28:52.088512483 +0000 @@ -243,7 +243,7 @@ if (run_hip_kernel_atinit (hashcat_ctx, device_param, device_param->hip_d_pws_buf, kernel_power_max) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_atinit (hashcat_ctx, device_param, device_param->metal_d_pws_buf, kernel_power_max) == -1) return -1; @@ -276,7 +276,7 @@ if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_rules_c, device_param->hip_d_rules, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoD (hashcat_ctx, device_param->metal_command_queue, device_param->metal_d_rules_c, 0, device_param->metal_d_rules, 0, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t)) == -1) return -1; @@ -636,7 +636,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_tmps, device_param->size_tmps) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_bzero (hashcat_ctx, device_param, device_param->metal_d_pws_buf, device_param->size_pws) == -1) return -1; diff -ruN '--exclude=*.o' '--exclude=*.a' '--exclude=Makefile' a/src/backend.c b/src/backend.c --- a/src/backend.c 2025-08-23 08:43:56.000000000 +0000 +++ b/src/backend.c 2026-04-25 09:29:31.659560555 +0000 @@ -67,7 +67,7 @@ if ((src->is_hip == true) && (dst->is_hip == true)) return false; - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) // Metal can't have aliases if ((src->is_metal == true) && (dst->is_metal == true)) return false; @@ -119,7 +119,7 @@ KERN_RUN_AUX4, }; -#if defined (__APPLE__) +#if defined (__APPLE__) && defined (WITH_METAL) static mtl_pipeline metal_pipeline_with_id (hc_device_param_t *device_param, const int kern_run) { switch (kern_run) @@ -217,7 +217,7 @@ return NULL; } -#if defined (__APPLE__) +#if defined (__APPLE__) && defined (WITH_METAL) int metal_query_max_local_size_bytes (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) { size_t max_local_size_bytes = 0; @@ -403,7 +403,7 @@ if (alias_device->is_hip == true) continue; - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) // this lets Metal devices survive over OpenCL if (alias_device->is_metal == true) continue; @@ -438,7 +438,7 @@ { if (src->is_cuda != dst->is_cuda) return false; if (src->is_hip != dst->is_hip) return false; - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (src->is_metal != dst->is_metal) return false; #endif if (src->is_opencl != dst->is_opencl) return false; @@ -1051,7 +1051,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, &pw_idx, device_param->metal_d_pws_idx, gidd * sizeof (pw_idx_t), sizeof (pw_idx_t)) == -1) return -1; @@ -1084,7 +1084,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, pw->i, device_param->metal_d_pws_comp_buf, off * sizeof (u32), cnt * sizeof (u32)) == -1) return -1; @@ -1135,7 +1135,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, dest, device_param->metal_d_pws_idx, gidd * sizeof (pw_idx_t), (cnt * sizeof (pw_idx_t))) == -1) return -1; @@ -1173,7 +1173,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, dest, device_param->metal_d_pws_comp_buf, off * sizeof (u32), cnt * sizeof (u32)) == -1) return -1; @@ -1226,7 +1226,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_tm_c, size_tm) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_bzero (hashcat_ctx, device_param, device_param->metal_d_tm_c, size_tm) == -1) return -1; @@ -1250,7 +1250,7 @@ if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_bfs_c, device_param->hip_d_tm_c, size_tm) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoD (hashcat_ctx, device_param->metal_command_queue, device_param->metal_d_bfs_c, 0, device_param->metal_d_tm_c, 0, size_tm) == -1) return -1; @@ -1360,7 +1360,7 @@ if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_pws_buf, device_param->hip_d_pws_amp_buf, pws_cnt * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoD (hashcat_ctx, device_param->metal_command_queue, device_param->metal_d_pws_buf, 0, device_param->metal_d_pws_amp_buf, 0, pws_cnt * sizeof (pw_t)) == -1) return -1; @@ -1392,7 +1392,7 @@ if (run_hip_kernel_utf8toutf16le (hashcat_ctx, device_param, device_param->hip_d_pws_buf, pws_cnt) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_utf8toutf16le (hashcat_ctx, device_param, device_param->metal_d_pws_buf, pws_cnt) == -1) return -1; @@ -1428,7 +1428,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->hooks_buf, device_param->metal_d_hooks, 0, pws_cnt * hashconfig->hook_size) == -1) return -1; @@ -1483,7 +1483,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_hooks, 0, device_param->hooks_buf, pws_cnt * hashconfig->hook_size) == -1) return -1; @@ -1589,7 +1589,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->h_tmps, device_param->metal_d_tmps, 0, pws_cnt * hashconfig->tmp_size) == -1) return -1; @@ -1618,7 +1618,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_tmps, 0, device_param->h_tmps, pws_cnt * hashconfig->tmp_size) == -1) return -1; @@ -1680,7 +1680,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->hooks_buf, device_param->metal_d_hooks, 0, pws_cnt * hashconfig->hook_size) == -1) return -1; @@ -1735,7 +1735,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, pws_cnt * hashconfig->hook_size) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_hooks, 0, device_param->hooks_buf, pws_cnt * hashconfig->hook_size) == -1) return -1; @@ -1829,7 +1829,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->h_tmps, device_param->metal_d_tmps, 0, pws_cnt * hashconfig->tmp_size) == -1) return -1; @@ -1858,7 +1858,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_tmps, 0, device_param->h_tmps, pws_cnt * hashconfig->tmp_size) == -1) return -1; @@ -1998,7 +1998,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_bzero (hashcat_ctx, device_param, device_param->metal_d_hooks, pws_cnt * hashconfig->hook_size) == -1) return -1; @@ -2224,7 +2224,7 @@ return 0; } -#if defined (__APPLE__) +#if defined (__APPLE__) && defined (WITH_METAL) int run_metal_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, mtl_mem_t mem, const u64 num) { u64 num_elements = num; @@ -2852,7 +2852,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { mtl_command_encoder metal_command_encoder = NULL; @@ -3320,7 +3320,7 @@ if (hc_hipLaunchKernel (hashcat_ctx, hip_function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, hip_args, NULL) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { id metal_command_encoder = NULL; @@ -3464,7 +3464,7 @@ if (hc_hipLaunchKernel (hashcat_ctx, hip_function, num_elements / kernel_threads, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, device_param->kernel_params_tm, NULL) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { const size_t global_work_size[3] = { num_elements, 1, 1 }; @@ -3526,7 +3526,7 @@ if (hc_hipLaunchKernel (hashcat_ctx, hip_function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, device_param->kernel_params_amp, NULL) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { num_elements = round_up_multiple_32 (num_elements, kernel_threads); @@ -3627,7 +3627,7 @@ if (hc_hipLaunchKernel (hashcat_ctx, hip_function, num_elements, 1, 1, kernel_threads, 1, 1, 0, device_param->hip_stream, device_param->kernel_params_decompress, NULL) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { num_elements = round_up_multiple_32 (num_elements, kernel_threads); @@ -3721,7 +3721,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_idx, 0, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; @@ -3785,7 +3785,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_idx, 0, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; @@ -3883,7 +3883,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_idx, 0, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; @@ -3947,7 +3947,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_idx, 0, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; @@ -4009,7 +4009,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_idx, 0, device_param->pws_idx, pws_cnt * sizeof (pw_idx_t)) == -1) return -1; @@ -4071,7 +4071,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { // what to do here? @@ -4277,7 +4277,7 @@ if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_rules_c, device_param->hip_d_rules + (innerloop_pos * sizeof (kernel_rule_t)), innerloop_left * sizeof (kernel_rule_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoD (hashcat_ctx, device_param->metal_command_queue, device_param->metal_d_rules_c, 0, device_param->metal_d_rules, innerloop_pos * sizeof (kernel_rule_t), innerloop_left * sizeof (kernel_rule_t)) == -1) return -1; @@ -4409,7 +4409,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_combs_c, 0, device_param->combs_buf, innerloop_left * sizeof (pw_t)) == -1) return -1; @@ -4439,7 +4439,7 @@ if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->hip_d_combs, innerloop_left * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoD (hashcat_ctx, device_param->metal_command_queue, device_param->metal_d_combs_c, 0, device_param->metal_d_combs, 0, innerloop_left * sizeof (pw_t)) == -1) return -1; @@ -4469,7 +4469,7 @@ if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->hip_d_combs, innerloop_left * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoD (hashcat_ctx, device_param->metal_command_queue, device_param->metal_d_combs_c, 0, device_param->metal_d_combs, 0, innerloop_left * sizeof (pw_t)) == -1) return -1; @@ -4602,7 +4602,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->combs_buf, innerloop_left * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_combs_c, 0, device_param->combs_buf, innerloop_left * sizeof (pw_t)) == -1) return -1; @@ -4632,7 +4632,7 @@ if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_combs_c, device_param->hip_d_combs, innerloop_left * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoD (hashcat_ctx, device_param->metal_command_queue, device_param->metal_d_combs_c, 0, device_param->metal_d_combs, 0, innerloop_left * sizeof (pw_t)) == -1) return -1; @@ -4664,7 +4664,7 @@ if (hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_bfs_c, device_param->hip_d_bfs, innerloop_left * sizeof (bf_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoD (hashcat_ctx, device_param->metal_command_queue, device_param->metal_d_bfs_c, 0, device_param->metal_d_bfs, 0, innerloop_left * sizeof (bf_t)) == -1) return -1; @@ -5074,7 +5074,7 @@ int rc_metal_init = -1; - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (user_options->backend_ignore_metal == false) { MTL_PTR *mtl = (MTL_PTR *) hcmalloc (sizeof (MTL_PTR)); @@ -5151,7 +5151,7 @@ if ((rc_cuda_init == -1) && (rc_hip_init == -1) && (rc_ocl_init == -1) && (rc_metal_init == -1)) { - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) event_log_error (hashcat_ctx, "ATTENTION! No OpenCL, Metal, HIP or CUDA compatible platform found."); #else event_log_error (hashcat_ctx, "ATTENTION! No OpenCL, HIP or CUDA compatible platform found."); @@ -5507,7 +5507,7 @@ if ((backend_ctx->cuda == NULL) && (backend_ctx->hip == NULL) && (backend_ctx->ocl == NULL) && (backend_ctx->mtl == NULL)) { - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) event_log_error (hashcat_ctx, "ATTENTION! No OpenCL, Metal, HIP or CUDA compatible platform found."); #else event_log_error (hashcat_ctx, "ATTENTION! No OpenCL, HIP or CUDA compatible platform found."); @@ -6592,7 +6592,7 @@ int metal_devices_cnt = 0; int metal_devices_active = 0; - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) const bridge_ctx_t *bridge_ctx = hashcat_ctx->bridge_ctx; user_options_t *user_options = hashcat_ctx->user_options; @@ -7365,7 +7365,7 @@ // device_param->device_processors = 2 * 32; //} - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { if (backend_ctx->metal_devices_cnt > 0 && backend_ctx->metal_devices_active > 0) @@ -8430,7 +8430,7 @@ backend_ctx->backend_devices_cnt = backend_ctx->cuda_devices_cnt + backend_ctx->hip_devices_cnt + backend_ctx->metal_devices_cnt + backend_ctx->opencl_devices_cnt; backend_ctx->backend_devices_active = backend_ctx->cuda_devices_active + backend_ctx->hip_devices_active + backend_ctx->metal_devices_active + backend_ctx->opencl_devices_active; - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) // disable Metal devices if at least one OpenCL device is enabled if (backend_ctx->opencl_devices_active > 0) { @@ -8606,7 +8606,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (backend_ctx->mtl) { for (int backend_devices_cnt = 0; backend_devices_cnt < backend_ctx->backend_devices_cnt; backend_devices_cnt++) @@ -9078,7 +9078,7 @@ hcfree (device_param->gcnArchName); } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (device_param->metal_command_queue) @@ -9350,7 +9350,7 @@ return 0; } -#if defined (__APPLE__) +#if defined (__APPLE__) && defined (WITH_METAL) static int get_metal_kernel_wgs (hashcat_ctx_t *hashcat_ctx, mtl_pipeline pipeline, u32 *result) { return hc_mtlGetMaxTotalThreadsPerThreadgroup (hashcat_ctx, pipeline, result); @@ -9441,7 +9441,7 @@ return 0; } -#if defined (__APPLE__) +#if defined (__APPLE__) && defined (WITH_METAL) static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const char *kernel_name, char *source_file, char *cached_file, const char *build_options_buf, const bool cache_disable, cl_program *opencl_program, CUmodule *cuda_module, hipModule_t *hip_module, mtl_library *metal_library) #else static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const char *kernel_name, char *source_file, char *cached_file, const char *build_options_buf, const bool cache_disable, cl_program *opencl_program, CUmodule *cuda_module, hipModule_t *hip_module, MAYBE_UNUSED void *metal_library) @@ -9885,7 +9885,7 @@ hcfree (binary); } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { mtl_library metal_lib = NULL; @@ -10109,7 +10109,7 @@ hcfree (mod_error_log); } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { mtl_library metal_lib = NULL; @@ -10344,7 +10344,7 @@ return 0; } -#if defined (__APPLE__) +#if defined (__APPLE__) && defined (WITH_METAL) static int backend_session_setup_metal_kernel_shared (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) { // GPU memset @@ -11976,7 +11976,7 @@ return 0; } -#if defined (__APPLE__) +#if defined (__APPLE__) && defined (WITH_METAL) static int backend_session_setup_metal_kernel_types (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, int kern_type) { const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; @@ -13450,7 +13450,7 @@ if (device_param->is_cuda == true) memcpy (runtime_name, "CUDA", 4); if (device_param->is_hip == true) memcpy (runtime_name, "HIP", 3); - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) memcpy (runtime_name, "Metal", 5); #endif if (device_param->is_opencl == true) memcpy (runtime_name, "OpenCL", 6); @@ -13613,7 +13613,7 @@ vector_width = 1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { // Metal does not support this query @@ -13656,7 +13656,7 @@ vector_width = 1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { // Metal does not support this query @@ -14009,7 +14009,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { // set some limits with Metal @@ -14464,7 +14464,7 @@ generate_cached_kernel_shared_filename (folder_config->cache_dir, device_name_chksum_amp_mp, cached_file, device_param->is_metal); - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) const bool rc_load_kernel = load_kernel (hashcat_ctx, device_param, "shared_kernel", source_file, cached_file, build_options_buf, cache_disable, &device_param->opencl_program_shared, &device_param->cuda_module_shared, &device_param->hip_module_shared, &device_param->metal_library_shared); #else const bool rc_load_kernel = load_kernel (hashcat_ctx, device_param, "shared_kernel", source_file, cached_file, build_options_buf, cache_disable, &device_param->opencl_program_shared, &device_param->cuda_module_shared, &device_param->hip_module_shared, NULL); @@ -14489,7 +14489,7 @@ rc = backend_session_setup_hip_kernel_shared (hashcat_ctx, device_param); } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { rc = backend_session_setup_metal_kernel_shared (hashcat_ctx, device_param); @@ -14634,7 +14634,7 @@ * load kernel */ - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) const bool rc_load_kernel = load_kernel (hashcat_ctx, device_param, "main_kernel", source_file, cached_file, build_options_module_buf, cache_disable, &device_param->opencl_program, &device_param->cuda_module, &device_param->hip_module, &device_param->metal_library); #else const bool rc_load_kernel = load_kernel (hashcat_ctx, device_param, "main_kernel", source_file, cached_file, build_options_module_buf, cache_disable, &device_param->opencl_program, &device_param->cuda_module, &device_param->hip_module, NULL); @@ -14687,7 +14687,7 @@ generate_cached_kernel_mp_filename (hashconfig->opti_type, hashconfig->opts_type, folder_config->cache_dir, device_name_chksum_amp_mp, cached_file, device_param->is_metal); - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) const bool rc_load_kernel = load_kernel (hashcat_ctx, device_param, "mp_kernel", source_file, cached_file, build_options_buf, cache_disable, &device_param->opencl_program_mp, &device_param->cuda_module_mp, &device_param->hip_module_mp, &device_param->metal_library_mp); #else const bool rc_load_kernel = load_kernel (hashcat_ctx, device_param, "mp_kernel", source_file, cached_file, build_options_buf, cache_disable, &device_param->opencl_program_mp, &device_param->cuda_module_mp, &device_param->hip_module_mp, NULL); @@ -14740,7 +14740,7 @@ generate_cached_kernel_amp_filename (user_options_extra->attack_kern, folder_config->cache_dir, device_name_chksum_amp_mp, cached_file, device_param->is_metal); - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) const bool rc_load_kernel = load_kernel (hashcat_ctx, device_param, "amp_kernel", source_file, cached_file, build_options_buf, cache_disable, &device_param->opencl_program_amp, &device_param->cuda_module_amp, &device_param->hip_module_amp, &device_param->metal_library_amp); #else const bool rc_load_kernel = load_kernel (hashcat_ctx, device_param, "amp_kernel", source_file, cached_file, build_options_buf, cache_disable, &device_param->opencl_program_amp, &device_param->cuda_module_amp, &device_param->hip_module_amp, NULL); @@ -15047,7 +15047,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { HC_MTL_CREATEBUFFER(hashcat_ctx, bitmap_ctx->bitmap_size, NULL, bitmap_s1_a); @@ -15307,7 +15307,7 @@ device_param->kernel_params[24] = &device_param->hip_d_kernel_param; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params[ 0] = NULL; // device_param->metal_d_pws_buf; @@ -15391,7 +15391,7 @@ device_param->kernel_params_mp[0] = &device_param->hip_d_combs; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_mp[0] = device_param->metal_d_combs.buf_ptr; @@ -15417,7 +15417,7 @@ device_param->kernel_params_mp[0] = &device_param->hip_d_combs; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_mp[0] = device_param->metal_d_combs.buf_ptr; @@ -15449,7 +15449,7 @@ device_param->kernel_params_mp[2] = &device_param->hip_d_markov_css_buf; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_mp[1] = device_param->metal_d_root_css_buf.buf_ptr; @@ -15494,7 +15494,7 @@ device_param->kernel_params_mp_l[2] = &device_param->hip_d_markov_css_buf; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_mp_l[1] = device_param->metal_d_root_css_buf.buf_ptr; @@ -15537,7 +15537,7 @@ device_param->kernel_params_mp_r[2] = &device_param->hip_d_markov_css_buf; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_mp_r[0] = device_param->metal_d_bfs.buf_ptr; @@ -15581,7 +15581,7 @@ device_param->kernel_params_amp[4] = &device_param->hip_d_bfs_c; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_amp[0] = NULL; // device_param->metal_d_pws_buf; @@ -15616,7 +15616,7 @@ device_param->kernel_params_tm[1] = &device_param->hip_d_tm_c; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_tm[0] = device_param->metal_d_bfs_c.buf_ptr; @@ -15673,7 +15673,7 @@ // : &device_param->hip_d_pws_amp_buf; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_decompress[0] = NULL; // device_param->metal_d_pws_idx; @@ -15711,7 +15711,7 @@ rc = backend_session_setup_hip_kernel_types (hashcat_ctx, device_param, kern_type); } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { rc = backend_session_setup_metal_kernel_types (hashcat_ctx, device_param, kern_type); @@ -15906,7 +15906,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { // zero some data buffers @@ -16272,7 +16272,7 @@ if (device_param->is_cuda == true) local_size_bytes = cuda_query_max_local_size_bytes (hashcat_ctx, device_param); if (device_param->is_hip == true) local_size_bytes = hip_query_max_local_size_bytes (hashcat_ctx, device_param); if (device_param->is_opencl == true) local_size_bytes = opencl_query_max_local_size_bytes (hashcat_ctx, device_param); - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) local_size_bytes = metal_query_max_local_size_bytes (hashcat_ctx, device_param); #endif } @@ -16567,7 +16567,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_hooks, device_param->size_hooks) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { HC_MTL_CREATEBUFFER(hashcat_ctx, size_pws, NULL, pws_buf); @@ -16670,7 +16670,7 @@ device_param->kernel_params[ 5] = &device_param->hip_d_hooks; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params[ 0] = device_param->metal_d_pws_buf.buf_ptr; @@ -16717,7 +16717,7 @@ //CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp, 0, sizeof (cl_mem), device_param->kernel_params_mp[0]); if (CL_rc == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_mp[0] = (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) @@ -16757,7 +16757,7 @@ //CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_mp_l, 0, sizeof (cl_mem), device_param->kernel_params_mp_l[0]); if (CL_rc == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_mp_l[0] = (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) @@ -16800,7 +16800,7 @@ //CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_amp, 1, sizeof (cl_mem), device_param->kernel_params_amp[1]); if (CL_rc == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_amp[0] = device_param->metal_d_pws_buf.buf_ptr; @@ -16845,7 +16845,7 @@ //CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->opencl_kernel_decompress, 2, sizeof (cl_mem), device_param->kernel_params_decompress[2]); if (CL_rc == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params_decompress[0] = device_param->metal_d_pws_idx.buf_ptr; @@ -17116,7 +17116,7 @@ device_param->hip_function_aux4 = NULL; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { hc_mtlReleaseMemObject (hashcat_ctx, &device_param->metal_d_pws_buf); @@ -17418,7 +17418,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_root_css_buf, 0, mask_ctx->root_css_buf, device_param->size_root_css) == -1) return -1; @@ -17474,7 +17474,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_markov_css_buf, mask_ctx->markov_css_buf, device_param->size_markov_css) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_root_css_buf, 0, mask_ctx->root_css_buf, device_param->size_root_css) == -1) return -1; diff -ruN '--exclude=*.o' '--exclude=*.a' '--exclude=Makefile' a/src/ext_metal.m b/src/ext_metal.m --- a/src/ext_metal.m 2025-08-23 08:43:56.000000000 +0000 +++ b/src/ext_metal.m 2026-04-25 09:28:52.075512139 +0000 @@ -3,6 +3,9 @@ * License.....: MIT */ +#ifdef WITH_METAL + + #include "common.h" #include "types.h" #include "memory.h" @@ -1927,3 +1930,5 @@ return 0; } + +#endif // WITH_METAL diff -ruN '--exclude=*.o' '--exclude=*.a' '--exclude=Makefile' a/src/hashes.c b/src/hashes.c --- a/src/hashes.c 2025-08-23 08:43:56.000000000 +0000 +++ b/src/hashes.c 2026-04-25 09:28:52.140513862 +0000 @@ -366,7 +366,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { rc = hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, tmps, device_param->metal_d_tmps, plain->gidvid * hashconfig->tmp_size, hashconfig->tmp_size); @@ -599,7 +599,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, &num_cracked, device_param->metal_d_result, 0, sizeof (u32)) == -1) return -1; @@ -656,7 +656,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { rc = hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, cracked, device_param->metal_d_plain_bufs, 0, num_cracked * sizeof (plain_t)); @@ -751,7 +751,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { rc = run_metal_kernel_memset32 (hashcat_ctx, device_param, device_param->metal_d_digests_shown, salt_buf->digests_offset * sizeof (u32), 0, salt_buf->digests_cnt * sizeof (u32)); @@ -811,7 +811,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_result, sizeof (u32)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_bzero (hashcat_ctx, device_param, device_param->metal_d_result, sizeof (u32)) == -1) return -1; diff -ruN '--exclude=*.o' '--exclude=*.a' '--exclude=Makefile' a/src/hwmon.c b/src/hwmon.c --- a/src/hwmon.c 2025-08-23 08:43:56.000000000 +0000 +++ b/src/hwmon.c 2026-04-25 09:28:52.135513729 +0000 @@ -798,7 +798,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (backend_ctx->devices_param[backend_device_idx].is_metal == true || backend_ctx->devices_param[backend_device_idx].is_opencl == true) { if (backend_ctx->devices_param[backend_device_idx].opencl_platform_vendor_id == VENDOR_ID_APPLE) @@ -1256,7 +1256,7 @@ if (hwmon_ctx->hm_device[backend_device_idx].power_get_supported == false) return -1; - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_metal == true)) @@ -1637,7 +1637,7 @@ // nothing to do } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { const u32 device_id = device_param->device_id; diff -ruN '--exclude=*.o' '--exclude=*.a' '--exclude=Makefile' a/src/selftest.c b/src/selftest.c --- a/src/selftest.c 2025-08-23 08:43:56.000000000 +0000 +++ b/src/selftest.c 2026-04-25 09:28:52.085512404 +0000 @@ -36,7 +36,7 @@ device_param->kernel_params[18] = &device_param->hip_d_st_esalts_buf; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params[15] = device_param->metal_d_st_digests_buf.buf_ptr; @@ -111,7 +111,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_buf, 0, &pw, 1 * sizeof (pw_t)) == -1) return -1; @@ -156,7 +156,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_buf, 0, &pw, 1 * sizeof (pw_t)) == -1) return -1; @@ -230,7 +230,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_combs_c, 0, &comb, 1 * sizeof (pw_t)) == -1) return -1; @@ -277,7 +277,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_buf, 0, &pw, 1 * sizeof (pw_t)) == -1) return -1; @@ -338,7 +338,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bfs_c, &bf, 1 * sizeof (bf_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_bfs_c, 0, &bf, 1 * sizeof (bf_t)) == -1) return -1; @@ -444,7 +444,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_buf, 0, &pw, 1 * sizeof (pw_t)) == -1) return -1; @@ -482,7 +482,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_pws_buf, 0, &pw, 1 * sizeof (pw_t)) == -1) return -1; @@ -563,7 +563,7 @@ if (run_hip_kernel_utf8toutf16le (hashcat_ctx, device_param, device_param->hip_d_pws_buf, 1) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_utf8toutf16le (hashcat_ctx, device_param, device_param->metal_d_pws_buf, 1) == -1) return -1; @@ -599,7 +599,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->hooks_buf, device_param->metal_d_hooks, 0, device_param->size_hooks) == -1) return -1; @@ -624,7 +624,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_hooks, 0, device_param->hooks_buf, device_param->size_hooks) == -1) return -1; @@ -695,7 +695,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->h_tmps, device_param->metal_d_tmps, 0, hashconfig->tmp_size) == -1) return -1; @@ -736,7 +736,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_tmps, 0, device_param->h_tmps, hashconfig->tmp_size) == -1) return -1; @@ -770,7 +770,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->hooks_buf, device_param->metal_d_hooks, 0, device_param->size_hooks) == -1) return -1; @@ -795,7 +795,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_hooks, 0, device_param->hooks_buf, device_param->size_hooks) == -1) return -1; @@ -858,7 +858,7 @@ if (hc_hipStreamSynchronize (hashcat_ctx, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->h_tmps, device_param->metal_d_tmps, 0, hashconfig->tmp_size) == -1) return -1; @@ -895,7 +895,7 @@ if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_tmps, device_param->h_tmps, hashconfig->tmp_size) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyHtoD (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, device_param->metal_d_tmps, 0, device_param->h_tmps, hashconfig->tmp_size) == -1) return -1; @@ -974,7 +974,7 @@ if (hc_hipEventRecord (hashcat_ctx, device_param->hip_event3, device_param->hip_stream) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (hc_mtlMemcpyDtoH (hashcat_ctx, device_param->metal_device, device_param->metal_command_queue, num_cracked, device_param->metal_d_result, 0, sizeof (u32)) == -1) return -1; @@ -1027,7 +1027,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_result, device_param->size_results) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { device_param->kernel_params[15] = device_param->metal_d_digests_buf.buf_ptr; @@ -1069,7 +1069,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_rules_c, device_param->size_rules_c) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_bzero (hashcat_ctx, device_param, device_param->metal_d_rules_c, device_param->size_rules_c) == -1) return -1; @@ -1095,7 +1095,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_rules_c, device_param->size_rules_c) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_bzero (hashcat_ctx, device_param, device_param->metal_d_rules_c, device_param->size_rules_c) == -1) return -1; @@ -1119,7 +1119,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_combs_c, device_param->size_combs) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_bzero (hashcat_ctx, device_param, device_param->metal_d_combs_c, device_param->size_combs) == -1) return -1; @@ -1143,7 +1143,7 @@ if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_bfs_c, device_param->size_bfs) == -1) return -1; } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (device_param->is_metal == true) { if (run_metal_kernel_bzero (hashcat_ctx, device_param, device_param->metal_d_bfs_c, device_param->size_bfs) == -1) return -1; diff -ruN '--exclude=*.o' '--exclude=*.a' '--exclude=Makefile' a/src/terminal.c b/src/terminal.c --- a/src/terminal.c 2025-08-23 08:43:56.000000000 +0000 +++ b/src/terminal.c 2026-04-25 09:29:31.673560925 +0000 @@ -1714,7 +1714,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) if (backend_ctx->mtl) { if (user_options->machine_readable == false) @@ -2428,7 +2428,7 @@ } } - #if defined (__APPLE__) + #if defined (__APPLE__) && defined (WITH_METAL) /** * Metal */