diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp index 722aef614ff..6f856d1efc4 100644 --- a/src/compiler/clc/clc_helpers.cpp +++ b/src/compiler/clc/clc_helpers.cpp @@ -893,6 +893,12 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx, c->getPreprocessorOpts().addMacroUndef("__SPIR__"); c->getPreprocessorOpts().addMacroUndef("__SPIRV__"); + // clang defines those unconditionally, we need to fix that. + if (!args->features.int64) + c->getPreprocessorOpts().addMacroUndef("__opencl_c_int64"); + if (!args->features.images) + c->getPreprocessorOpts().addMacroUndef("__IMAGE_SUPPORT__"); + #if LLVM_VERSION_MAJOR >= 14 c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-all"); c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_byte_addressable_store"); diff --git a/src/gallium/frontends/rusticl/core/program.rs b/src/gallium/frontends/rusticl/core/program.rs index 0a3703ce6b2..eb6d2230309 100644 --- a/src/gallium/frontends/rusticl/core/program.rs +++ b/src/gallium/frontends/rusticl/core/program.rs @@ -276,9 +276,6 @@ fn prepare_options(options: &str, dev: &Device) -> Vec { options.push_str(" -cl-std=CL"); options.push_str(dev.clc_version.api_str()); } - if !dev.image_supported() { - options.push_str(" -U__IMAGE_SUPPORT__"); - } options.push_str(" -D__OPENCL_VERSION__="); options.push_str(dev.cl_version.clc_str());