<div dir="ltr"><div><div>I'm not really sure. I'm still finding my way around llvm-lit.<br></div><br>Here's the script that lit uses for that command (designated-init-in-header.m) :<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">// RUN: %clang_cc1 -objcmt-migrate-designated-init -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -x objective-c %S/<a href="http://file1.m.in">file1.m.in</a> -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o %t1.remap<br>// RUN: %clang_cc1 -objcmt-migrate-designated-init -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -x objective-c %S/<a href="http://file2.m.in">file2.m.in</a> -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o %t2.remap<br>// RUN: c-arcmt-test %t1.remap %t2.remap | arcmt-test -verify-transformed-files %S/header1.h.result %S/file2.m.in.result<br></blockquote><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 25, 2014 at 11:20 AM, Jonathan Roelofs <span dir="ltr"><<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Are the tests using mktemp/mkstemp?<br>
<br>
<br>
Jon<span class=""><br>
<br>
On 9/25/14 10:11 AM, Jeffrey Brusseau wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Scratch the part where is quoted command used to test the error. I exported<br>
TMPDIR not TMP and It was the bash script I ran afterwards not the make command.<br>
So it was:<br>
<br>
    export TMPDIR=/FOO<br>
<br>
    ./run.bash<br>
<br>
<br>
On Thu, Sep 25, 2014 at 11:06 AM, Jeffrey Brusseau <<a href="mailto:bobajeff82@gmail.com" target="_blank">bobajeff82@gmail.com</a><br></span><span class="">
<mailto:<a href="mailto:bobajeff82@gmail.com" target="_blank">bobajeff82@gmail.com</a>>> wrote:<br>
<br>
    Ran another test this time I ran the first test manually in bash via a<br>
    script I made:<br>
<br>
    This is the run.bash file:<br>
<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>Release+Asserts/bin/clang<br>
        -cc1 -internal-isystem<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>Release+Asserts/bin/../lib/<u></u>clang/3.6.0/include<br>
        -objcmt-migrate-designated-<u></u>init -objcmt-migrate-readwrite-<u></u>property<br>
        -objcmt-migrate-instancetype -x objective-c<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/llvm/tools/<u></u>clang/test/ARCMT/designated-<u></u>init-in-header/<a href="http://file1.m.in" target="_blank">file1.m.in</a><br></span>
        <<a href="http://file1.m.in" target="_blank">http://file1.m.in</a>> -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o<span class=""><br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>tools/clang/test/ARCMT/<u></u>designated-init-in-header/<u></u>Output/designated-init-in-<u></u>header.m.tmp1.remap<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>Release+Asserts/bin/clang<br>
        -cc1 -internal-isystem<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>Release+Asserts/bin/../lib/<u></u>clang/3.6.0/include<br>
        -objcmt-migrate-designated-<u></u>init -objcmt-migrate-readwrite-<u></u>property<br>
        -objcmt-migrate-instancetype -x objective-c<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/llvm/tools/<u></u>clang/test/ARCMT/designated-<u></u>init-in-header/<a href="http://file2.m.in" target="_blank">file2.m.in</a><br></span>
        <<a href="http://file2.m.in" target="_blank">http://file2.m.in</a>> -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o<span class=""><br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>tools/clang/test/ARCMT/<u></u>designated-init-in-header/<u></u>Output/designated-init-in-<u></u>header.m.tmp2.remap<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>Release+Asserts/bin/c-arcmt-<u></u>test<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>tools/clang/test/ARCMT/<u></u>designated-init-in-header/<u></u>Output/designated-init-in-<u></u>header.m.tmp1.remap<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>tools/clang/test/ARCMT/<u></u>designated-init-in-header/<u></u>Output/designated-init-in-<u></u>header.m.tmp2.remap<br>
        |<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/build/<u></u>Release+Asserts/bin/arcmt-test<br>
        -verify-transformed-files<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/llvm/tools/<u></u>clang/test/ARCMT/designated-<u></u>init-in-header/header1.h.<u></u>result<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/llvm/tools/<u></u>clang/test/ARCMT/designated-<u></u>init-in-header/<a href="http://file2.m.in" target="_blank">file2.m.in</a>.<u></u>result<br>
<br>
<br>
    It ran perfectly after exporting the LD_LIBRARY_PATH to libclang:<br>
<br>
        export<br>
        LD_LIBRARY_PATH=$LD_LIBRARY_<u></u>PATH:/data/data/com.<u></u>spartacusrex.spartacuside/<u></u>files/build/Release+Asserts<br>
<br>
<br>
    So then I tried to recreate the error by changing the $TMPDIR environment<br>
    variable and lo and behold it's the exact error you get from the same test.<br>
<br>
        export TMP=/FOO<br>
<br>
        make ENABLE_OPTIMIZED=1 check-all<br>
<br>
<br>
    output<br>
<br>
        Error by clang_<u></u>getRemappingsFromFileList<br>
<br>
        Could not create file: /FOO/heaader1.h-30ac2..h<br>
        Could not create file: /FOO/<a href="http://file2.m.in-2c5017.in" target="_blank">file2.m.in-2c5017.in</a><br></span>
        <<a href="http://file2.m.in-2c5017.in" target="_blank">http://file2.m.in-2c5017.in</a>><span class=""><br>
        error: no files to verify from stdin<br>
<br>
<br>
<br>
    So it appears that however clang is actually being run in the test it's not<br>
    using the correct environment or the variable is being overruled by<br>
    something in the test.<br>
<br>
<br>
    On Sun, Sep 21, 2014 at 11:11 AM, Jeffrey Brusseau <<a href="mailto:bobajeff82@gmail.com" target="_blank">bobajeff82@gmail.com</a><br></span><span class="">
    <mailto:<a href="mailto:bobajeff82@gmail.com" target="_blank">bobajeff82@gmail.com</a>>> wrote:<br>
<br>
        It looks like the tests are somehow making clang write to /tmp even<br>
        though $TEMP and $TMPDIR are set to<br>
        /data/data/com.spartacusrex.<u></u>spartacuside/files/tmp. I've checked<br>
        python's shell and android's system/bin/sh shell and they reflect the<br>
        same values. I've also tested clang by itself (on a simple helloword.c)<br>
        and it seems to use the correct directory for temp files.<br>
<br>
        Can anyone help me figure out what's going on?<br>
<br>
        On Wed, Sep 17, 2014 at 2:30 PM, Jeffrey Brusseau <<a href="mailto:bobajeff82@gmail.com" target="_blank">bobajeff82@gmail.com</a><br></span><div><div class="h5">
        <mailto:<a href="mailto:bobajeff82@gmail.com" target="_blank">bobajeff82@gmail.com</a>>> wrote:<br>
<br>
            I'm trying to run the llvm build tests on android after<br>
            cross-compiling with the NDK toolchain on top of my ubuntu-based<br>
            system. I've run into some issues.<br>
<br>
            First since python is required I needed to install the Python 2.7<br>
            fork of Py4A (because Python3 doesn't seem to play nice with llvm's<br>
            python scripts). I also needed to install the unittest module as<br>
            this distribution of python doesn't come with it for some reason. I<br>
            just copied the lib/python2.7/unitest folder from my NDK toolchain<br>
            over to /sdcard/com.android.python27/<u></u>extras/python/. Plus I needed<br>
            to set the environment variables in Terminal IDE's ~/.bashrc so I added:<br>
<br>
                 source /data/data/com.spartacusrex.<u></u>spartacuside/files/python27.sh<br>
<br>
            In ~/python27.sh I have:<br>
                 export PYTHONHOME=/data/data/com.<u></u>android.python27/files/python<br>
                 export<br>
            PYTHONPATH=/sdcard/com.<u></u>android.python27/extras/<u></u>python:/data/data/com.android.<u></u>python27/files/python/lib/<u></u>python2.7/lib-dynload:/data/<u></u>data/com.android.python27/<u></u>files/python/lib/python2.7<br>
                 export PATH=$PYTHONHOME/bin:$PATH<br>
                 export<br>
            LD_LIBRARY_PATH=$LD_LIBRARY_<u></u>PATH:/data/data/com.android.<u></u>python27/files/python/lib:/<u></u>data/data/com.android.<u></u>python27/files/python/lib/<u></u>python2.7/lib-dynload<br>
<br>
            I also needed to change the LLVM_SRC_ROOT,  LLVM_OBJ_ROOT and PYTHON<br>
            variables in the llvm/Makefile.config to point to my $HOME directory<br>
            in Terminal IDE (the terminal emulator I'm running the tests in):<br>
<br>
                 LLVM_SRC_ROOT   := $(call realpath,<br>
            /data/data/com.spartacusrex.<u></u>spartacuside/files/llvm)<br>
                 LLVM_OBJ_ROOT   := $(call realpath,<br>
            /data/data/com.spartacusrex.<u></u>spartacuside/files/build)<br>
                 PYTHON     :=<br>
            /data/data/com.android.<u></u>python27/files/python/bin/<u></u>python<br>
<br>
            In addition I needed to change the path to sh in<br>
            llvm/autoconf/mkinstalldirs to the correct location in android.<br>
<br>
                 #! /system/bin/sh<br>
<br>
            So that got it to run. But I still ran into a bunch of errors like:<br>
            shell-init: error retrieving current directory: getcwd: cannot<br>
            access parent directories: Permission denied<br>
            error: Could not create file: /tmp/******<br>
<br>
            The full output of make check all is in the file I attached.<br>
<br>
            I think I can get it to work if I'm able to make it use a different<br>
            tmp directory as the /tmp/ directory is nonexistent on Android<br>
            because every app is supposed to have it's own tmp directory. Can<br>
            anyone show me how to change the tmp directory llvm uses for these<br>
            tests?<br>
<br>
<br>
<br>
<br>
<br>
<br></div></div><span class="">
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
Jon Roelofs<br>
<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a><br>
CodeSourcery / Mentor Embedded<br>
</div></div></blockquote></div><br></div>