[Mesa-dev] [PATCH] clover: Pass unquoted compiler arguments to Clang

Vedran Miletić vedran at miletic.net
Mon Jun 6 10:24:38 UTC 2016


On 06/06/2016 02:04 AM, Francisco Jerez wrote:
> Vedran Miletić <vedran at miletic.net> writes:
>>
>> 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.
>
> But the OpenCL spec doesn't impose any explicit requirements on the
> formatting of the option string (unless I'm missing something), so
> strictly speaking both interpretations are equally broken.  It wasn't my
> intention to argue against implementing the same behaviour as the
> proprietary CL stacks as temporary solution, but the fact that this is
> unspecified is certainly an OpenCL spec bug.
>

Agree that the spec is incomplete. Additional problem is that Clang is 
unable to handle the incorrectly split arguments, in which case Clang 
IMHO does the correct thing. Mesa is right now breaking the user/app 
supplied compiler args into an array before passing it to Clang and that 
breaking is done in a wrong way.

I am not claiming that it's Clover's job to unquote args, even though it 
would be convenient for Clang if it was.

Regards,
Vedran

>> 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.
>>

-- 
Vedran Miletić
vedran.miletic.net


More information about the mesa-dev mailing list