On 28 May 2014 17:44, Justin Bogner <mail at justinbogner.com>
wrote:> In the autoconf system, I'm pretty sure compiler-rt's build is
triggered
> by a Makefile in clang, tools/clang/runtime/compiler-rt/Makefile. This
> Makefile comments "We currently only try to generate runtime libraries
> on x86", so I guess that's the place to start if you want to get
it to
> build on ARM.
Hi Justin,
I'm having a go at autoconf-driven RT on ARM.
Without any change, autoconf doesn't even know compiler-rt is there.
Then, I added this:
ifeq ($(ARCH),ARM)
RuntimeLibrary.linux.Configs += builtins-ARM.a # rest to come once
this is working
endif
And I do get the build system to recognise, complain about ld not
supporting x86 on darwin:
warning: clang_darwin.mk: dropping arch 'i386' from lib '10.4'
(ld
does not support it)
warning: clang_darwin.mk: dropping arch 'x86_64' from lib '10.4'
(ld
does not support it)
and then the following error:
make[5]: Entering directory `/work/llvm/src/projects/compiler-rt'
make[5]: Nothing to be done for `clang_linux'.
make[5]: Leaving directory `/work/llvm/src/projects/compiler-rt'
llvm[4]: Copying runtime library linux/builtins-ARM to build dir
cp: cannot stat
‘/work/llvm/build/tools/clang/runtime/compiler-rt/clang_linux/builtins-ARM/libcompiler_rt.a’:
No such file or directory
make[4]: ***
[/work/llvm/build/Release+Asserts/lib/clang/3.5.0/lib/linux/libclang_rt.builtins-ARM.a]
Error 1
rm /work/llvm/build/Release+Asserts/lib/clang/3.5.0/lib/linux/.dir
make[4]: Leaving directory
`/work/llvm/build/tools/clang/runtime/compiler-rt'
I'm guessing the "nothing to be done" is the real culprit here,
and comes from:
BuildRuntimeLibraries:
$(Verb) $(MAKE) -C $(COMPILERRT_SRC_ROOT) \
ProjSrcRoot=$(COMPILERRT_SRC_ROOT) \
ProjObjRoot=$(PROJ_OBJ_DIR) \
CC="$(ToolDir)/clang" \
LLVM_ANDROID_TOOLCHAIN_DIR="$(LLVM_ANDROID_TOOLCHAIN_DIR)" \
$(COMPILERRT_MAKE_FLAGS) \
$(RuntimeDirs:%=clang_%)
which executes the compiler-rt Makefile, which is where the
compiler-rt files are built.
This is what comes out:
make -C /work/llvm/src/projects/compiler-rt \
ProjSrcRoot=/work/llvm/src/projects/compiler-rt \
ProjObjRoot=/work/llvm/build/tools/clang/runtime/compiler-rt \
CC="/work/llvm/build/Release+Asserts/bin/clang" \
LLVM_ANDROID_TOOLCHAIN_DIR="" \
\
clang_linux
When I run "make info-platforms" in compiler-rt,
"clang_linux" is one
of them, so I added some ARM stuff to make/platform/clang_linux.mk to
no avail.
I'm also curious as to why the ld error mentioned above is on
clang_darwin.mk not clang_linux.mk, since this is clearly what it
should be running...
Any ideas? I'm not the most knowledgeable on autoconf/cmake stuff, as
you can see. :)
Thanks!
--renato