Problem running clang on ARM

Hi all,

I am in the process of developing a installer utility for ARM target which can compile any source files to ARM native executable. This installer utility should be present on target itself (whether this is feasible or not?). For achieving this i compiled llvm with clang for target. I copied the binaries to target and when it tried to compile a sample c code i am getting the following error.

# …/bin/clang hello.c
clang: warning: not using the clang compiler for the ‘arm’ architecture
clang: error: unable to make temporary file: /tmp/cc: can’t make unique filename: No such file or directory
clang: error: unable to make temporary file: /tmp/cc: can’t make unique filename: No such file or directory

Hi all,

I am in the process of developing a installer utility for ARM target which
can compile any source files to ARM native executable. This installer
utility should be present on target itself (whether this is feasible or
not?). For achieving this i compiled llvm with clang for target. I copied
the binaries to target and when it tried to compile a sample c code i am
getting the following error.

*# ../bin/clang hello.c
clang: warning: not using the clang compiler for the 'arm' architecture

This warning means that clang is using gcc to compile your source file.
You probably don't want that. I don't know how well clang works on arm but
you can use "-ccc-clang-archs arm" (see clang --help-hidden) to disable
this behavior.

clang: error: unable to make temporary file: /tmp/cc: can't make unique
filename: No such file or directory
clang: error: unable to make temporary file: /tmp/cc: can't make unique
filename: No such file or directory
# *

my target device doesnot hav /tmp and it doesnot have write permission for
creating any directory on root "/". is there anyway to tell clang to create
temporary files in some other location other than "/tmp" ? can anyone help
me in resolving this issue? pls let me know in case if any more information
is required.

Setting the TMPDIR environment variable may be helpful.

e.g.
TMPDIR=/foo/bar/tmp clang hello.c