[Clover] Handle -g passed as a compile option
Submitted by Vedran Miletić
Assigned to mes..@..op.org
Link to original bug (#100218)
Description
Clover uses clang::CompilerInvocation::CreateFromArgs() which is roughly equivalent to clang -cc1 frontend and does not support GCC-like options, including -g, which is sometimes passed by OpenCL programs. Section 5.6.3 of OpenCL 1.1 spec [1] says: "This specification defines a standard set of options that must be supported by an OpenCL compiler when building program executables online or offline. These may be extended by a set of vendor-or platform-specific options."
Since -g is not mentioned in the spec, we can either:
- Fail with "Clover does not support -g", which is what we do now but could be made more explicit.
- Ignore it, that is s/-g//.
- Figure out how to enable it and then s/-g/-whatever/ before passing it to clang.
[1] https://www.khronos.org/registry/OpenCL/specs/opencl-1.1.pdf
Version: git