[cfe-dev] LIT test that links and runs the executable?

Gabor Kozar kozargabor at gmail.com
Mon Nov 24 06:58:51 PST 2014


The issue turned out to be that llvm-lit doesn't propogate the LIB and
LIBPATH environment variables to the test scripts on Windows. The
attached (trivial) patch should fix the issue.

---
Best regards,

Gábor 'ShdNx' Kozár http://gaborkozar.me



On Fri, Oct 24, 2014, at 19:46, Gabor Kozar wrote:
> I've added -v to the clang++ command line, and executed the clang cc1
> command and the linker command manually. That worked fine.
>
> ---
> Best regards,
>
> Gábor 'ShdNx' Kozár http://gaborkozar.me
>
>
>
> On Fri, Oct 24, 2014, at 18:42, Reid Kleckner wrote:
>> I suspect that clang's environment differs between the lit test and
>> your shell. Add -### to see which linker it's trying to invoke.
>>
>> On Fri, Oct 24, 2014 at 9:58 AM, Gabor Kozar
>> <kozargabor at gmail.com> wrote:
>>> In our fork of clang, we a bunch of tests that require the compiled
>>> test program to be executed. I tried creating a lit test with a RUN
>>> command like so:
>>>
>>>
>>> // RUN: %clang %s ... -o %t.exe // RUN: %t.exe
>>>
>>>
>>> This works fine on Linux, but on Windows I get:
>>>
>>>
>>> Command 0 Stderr: clang.EXE: error: unable to execute command:
>>> program not executable clang.EXE: error: linker command failed with
>>> exit code 1 (use -v to see invocation)
>>>
>>>
>>> (The test script never even gets to the second RUN line.)
>>>
>>> Running the clang command manually (that llvm-lit -v outputs) works
>>> fine. Any idea what could be the issue?
>>>
>>> ---
>>> Best regards,
>>>
>>> Gábor 'ShdNx' Kozár http://gaborkozar.me
>>>
>>>
>>>
>>> _________________________________________________
>>> cfe-dev mailing list cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>
>
> _________________________________________________
> cfe-dev mailing list cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141124/3ac3425e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lit-linking-fix.patch
Type: application/octet-stream
Size: 1188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141124/3ac3425e/attachment.obj>


More information about the cfe-dev mailing list