[LLVMdev] Cross-compile to ARM using Code Sourcery Lite Toolchain

Jim Grosbach grosbach at apple.com
Tue Jul 12 08:05:14 PDT 2011


(cc:llvmdev  Keeping on the list to get more eyes on the problem and for archival purposes).

Configure will be re-run, yes. LLVM includes some tools which need to be built for the host, even when cross compiling (e.g., tblgen). In a cross-build, these are built in the BuiltTools directory and that's where you're seeing configure being re-run.

>From the below snippet it appears that your host compiler is being run incorrectly. That could happen for any number of reasons. I would suggest having a look in config.log (in the BuildTools directory since that's where it's failing) as the error message suggests to find more information about why.

My best guess is that configure is finding the wrong compiler for building for your host, either because your cross compile tools are first on the path and have conflicting generic names (gcc, g++, etc. instead of a fully qualified name with the triple as prefix) or there's something broken in the host tools installation.


On Jul 11, 2011, at 9:03 PM, Whee Cheng Ong wrote:

> Hi Jim
> Thanks for your suggestion of building llvm in a dedicated directory.
> However, it (build_llvm) does not work, and for some reasons, it
> appear to re-run configure when make is called, using different host
> and target configurations:
> fusion at fusion-desktop:~/Desktop/Samsung/OpenCL/src/build_llvm$ make
> checking build system type... i686-pc-linux-gnu
> checking host system type... i686-pc-linux-gnu
> checking target system type... i686-pc-linux-gnu
> checking type of operating system we're going to host on... Linux
> checking type of operating system we're going to target... Linux
> checking target architecture... x86
> checking for i686-pc-linux-gnu-gcc... no
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... configure: error: cannot run
> C compiled programs.
> If you meant to cross compile, use `--host'.
> See `config.log' for more details.
> make[1]: Entering directory
> `/home/fusion/Desktop/Samsung/OpenCL/src/build_llvm/BuildTools'
> make[1]: *** No targets specified and no makefile found.  Stop.
> make[1]: Leaving directory
> `/home/fusion/Desktop/Samsung/OpenCL/src/build_llvm/BuildTools'
> make: *** [cross-compile-build-tools] Error 1
> Any ideas how this came about? Included are the config.log files in
> different directories.
> Thanks for looking into my problem.
> regards
> wheecheng
> On Mon, Jul 11, 2011 at 10:58 PM, Jim Grosbach <grosbach at apple.com> wrote:
>> Hello,
>> Have you tried building in a dedicated build directory rather than directly in your source tree? Especially for cross compilers, that's likely to give you better results. That is,
>> $ mkdir build-llvm
>> $ cd build-llvm
>> $ ../<llvm-src-dir/configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi --enable-optimized=no --enable-assertions=yes
>> $ make
>> I've used that recipe before with good results.
>> -Jim
>> On Jul 10, 2011, at 10:59 PM, Whee Cheng Ong wrote:
>>> Hello
>>> I am new to LLVM and would like to cross-compile LLVM 2.9 on x86
>>> (Ubuntu) to ARM using Code Sourcery LIte toolchain for ARM EABI
>>> (2011.03-41).
>>> This is the command I used to configure:
>>> ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi
>>> --target=arm-none-linux-gnueabi
>>> followed by:
>>> make -C llvm.2.9 ENABLE_OPTIMIZED=0
>>> I encountered the following errors:
>>> configure:error: Already configured in /llvm2.9
>>> make[1]: Entering directory '/llvm2.9/BuildTools'
>>> make[1]: *** No targets specified and no makefile found. Stop.
>>> make[1]" Leaving directory '/llvm2.9/BuildTools'
>>> make: *** [cross-compile-build-tools] Error 1
>>> make: Leaving directory 'llvm2.9'
>>> How can I resolve the errors and is there anything I missed out while
>>> trying to cross-compile LLVM on x86 to ARM?
>>> Thanks in advance for looking into my problem.
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> <config.BuildTools.log><config.build_llvm.log>

More information about the llvm-dev mailing list