[Mesa-dev] [PATCH] clover: Pass unquoted compiler arguments to Clang
Vedran Miletić
vedran at miletic.net
Sun Jun 5 22:53:59 UTC 2016
On 06/04/2016 10:13 AM, Francisco Jerez wrote:
> Vedran Miletić <vedran at miletic.net> writes:
>
>> OpenCL apps can quote arguments they pass to the OpenCL compiler, most
>> commonly include paths containing spaces. If the OpenCL compiler was
>> called via a shell, the shell would remove (single or double) quotes
>> before passing the argument to the compiler. Since we call Clang as a
>> library, we have to remove quotes before passing the argument.
>
> Sigh, it's a shame that the OpenCL spec doesn't specify what format the
> option string should have, whether quotes have any special
> interpretation at all, whether escape sequences are supported, etc.
> Might be worth reporting the problem at Khronos -- Or have you found any
> evidence in the spec that the parsing logic you implement below is the
> correct one?
>
Aside from working just like NVIDIA and AMD proprietary stacks, no.
However, what we do right now is most certainly broken. Consider the
following argument
-I"/foo bar/baz"
which is going to be sent to Clang as two arguments broken over space,
while it should be one. We should split arguments correctly, and whether
or not we remove quotes in the process or we expect Clang to handle them
is the easier part of the job.
Regards,
Vedran
--
Vedran Miletić
vedran.miletic.net
More information about the mesa-dev
mailing list