Running make check-all on android after cross-compiling to it.

Jeffrey Brusseau bobajeff82 at gmail.com
Thu Sep 25 11:15:31 PDT 2014


I'm not really sure. I'm still finding my way around llvm-lit.

Here's the script that lit uses for that command
(designated-init-in-header.m) :

> // RUN: %clang_cc1 -objcmt-migrate-designated-init
> -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -x
> objective-c %S/file1.m.in -triple x86_64-apple-darwin11 -fobjc-arc
> -migrate -o %t1.remap
> // RUN: %clang_cc1 -objcmt-migrate-designated-init
> -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -x
> objective-c %S/file2.m.in -triple x86_64-apple-darwin11 -fobjc-arc
> -migrate -o %t2.remap
> // RUN: c-arcmt-test %t1.remap %t2.remap | arcmt-test
> -verify-transformed-files %S/header1.h.result %S/file2.m.in.result
>


On Thu, Sep 25, 2014 at 11:20 AM, Jonathan Roelofs <
jonathan at codesourcery.com> wrote:

> Are the tests using mktemp/mkstemp?
>
>
> Jon
>
> On 9/25/14 10:11 AM, Jeffrey Brusseau wrote:
>
>> 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:
>>
>>     export TMPDIR=/FOO
>>
>>     ./run.bash
>>
>>
>> On Thu, Sep 25, 2014 at 11:06 AM, Jeffrey Brusseau <bobajeff82 at gmail.com
>> <mailto:bobajeff82 at gmail.com>> wrote:
>>
>>     Ran another test this time I ran the first test manually in bash via a
>>     script I made:
>>
>>     This is the run.bash file:
>>
>>         /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/file1.m.in
>>         <http://file1.m.in> -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
>>         /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/file2.m.in
>>         <http://file2.m.in> -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
>>         /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
>>
>>
>>     It ran perfectly after exporting the LD_LIBRARY_PATH to libclang:
>>
>>         export
>>         LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/data/com.
>> spartacusrex.spartacuside/files/build/Release+Asserts
>>
>>
>>     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.
>>
>>         export TMP=/FOO
>>
>>         make ENABLE_OPTIMIZED=1 check-all
>>
>>
>>     output
>>
>>         Error by clang_getRemappingsFromFileList
>>
>>         Could not create file: /FOO/heaader1.h-30ac2..h
>>         Could not create file: /FOO/file2.m.in-2c5017.in
>>         <http://file2.m.in-2c5017.in>
>>         error: no files to verify from stdin
>>
>>
>>
>>     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.
>>
>>
>>     On Sun, Sep 21, 2014 at 11:11 AM, Jeffrey Brusseau <
>> bobajeff82 at gmail.com
>>     <mailto:bobajeff82 at gmail.com>> wrote:
>>
>>         It looks like the tests are somehow making clang write to /tmp
>> even
>>         though $TEMP and $TMPDIR are set to
>>         /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.
>>
>>         Can anyone help me figure out what's going on?
>>
>>         On Wed, Sep 17, 2014 at 2:30 PM, Jeffrey Brusseau <
>> bobajeff82 at gmail.com
>>         <mailto:bobajeff82 at gmail.com>> wrote:
>>
>>             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.
>>
>>             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:
>>
>>                  source /data/data/com.spartacusrex.
>> spartacuside/files/python27.sh
>>
>>             In ~/python27.sh I have:
>>                  export PYTHONHOME=/data/data/com.
>> android.python27/files/python
>>                  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
>>                  export PATH=$PYTHONHOME/bin:$PATH
>>                  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
>>
>>             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):
>>
>>                  LLVM_SRC_ROOT   := $(call realpath,
>>             /data/data/com.spartacusrex.spartacuside/files/llvm)
>>                  LLVM_OBJ_ROOT   := $(call realpath,
>>             /data/data/com.spartacusrex.spartacuside/files/build)
>>                  PYTHON     :=
>>             /data/data/com.android.python27/files/python/bin/python
>>
>>             In addition I needed to change the path to sh in
>>             llvm/autoconf/mkinstalldirs to the correct location in
>> android.
>>
>>                  #! /system/bin/sh
>>
>>             So that got it to run. But I still ran into a bunch of errors
>> like:
>>             shell-init: error retrieving current directory: getcwd: cannot
>>             access parent directories: Permission denied
>>             error: Could not create file: /tmp/******
>>
>>             The full output of make check all is in the file I attached.
>>
>>             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?
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
> --
> Jon Roelofs
> jonathan at codesourcery.com
> CodeSourcery / Mentor Embedded
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140925/d211fe9e/attachment.html>


More information about the llvm-commits mailing list