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