<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang cross compile build fails"
   href="http://llvm.org/bugs/show_bug.cgi?id=21092">21092</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang cross compile build fails
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>llvmc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>m_adnanali_1@hotmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I have firstly compiled clang for host builds and now using the clang for the
host builds I am using the clang for target build using the following command 

cmake ../llvm/ -DCMAKE_CROSSCOMPILING=True
-DCMAKE_INSTALL_PREFIX=/home/adal/clang_3.2_cross_arm/
-DLLVM_TABLEGEN=../build_cmake/bin/llvm-tblgen
-DCLANG_TABLEGEN=../build_cmake/bin/clang-tblgen
-DLLVM_DEFAULT_TARGET_TRIPLE=arm-none-eabi -DLLVM_TARGET_ARCH=ARM
-DLLVM_TARGETS_TO_BUILD=ARM -DCMAKE_CXX_FLAGS='-target armv7r-none-eabi -I
/home/adal/gcc-arm-none-eabi-4_8-2014q2/arm-none-eabi/include/ -mfloat-abi=hard
-mfpu=vfpv3-d16 -ccc-gcc-name
/home/adal/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gcc -L
../build_cmake/lib/' -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++


However the build beaks giving output ... 
 Check for working CXX compiler:
/home/adal/Store/clang_3.2_source_build/clang_cross/build_cmake/bin/clang++ --
broken
CMake Error at
/u-blox/gallery/kitware/cmake/lin_32/2.8.12.1/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54
(message):
  The C++ compiler
  "/home/adal/Store/clang_3.2_source_build/clang_cross/build_cmake/bin/clang++"
  is not able to compile a simple test program.



Preprocessed source(s) and associated run script(s) are located at:

  clang-3: note: diagnostic msg: /tmp/testCXXCompiler-LKHaKf.cpp

  clang++:
 
/home/adal/Store/clang_3.2_source_build/clang_cross/llvm/tools/clang/lib/Driver/Driver.cpp:470:
  void
 
clang::driver::Driver::generateCompilationDiagnostics(clang::driver::Compilation&,
  const clang::driver::Command*): Assertion `I != std::string::npos &&
  "Expected to find -main-file-name"' failed.

  0 clang++ 0x000000000240c490

  1 clang++ 0x000000000240c1b6

  2 libpthread.so.0 0x0000003b1f20eca0

  3 libc.so.6 0x0000003b1e2302c5 gsignal + 53

  4 libc.so.6 0x0000003b1e231d70 abort + 272

  5 libc.so.6 0x0000003b1e229746 __assert_fail + 246

  6 clang++ 0x00000000025f24d4
 
clang::driver::Driver::generateCompilationDiagnostics(clang::driver::Compilation&,
  clang::driver::Command const*) + 2448

  7 clang++ 0x0000000001658aaf main + 3395

  8 libc.so.6 0x0000003b1e21d9c4 __libc_start_main + 244

  9 clang++ 0x0000000001656859

  Stack dump:

  0.    Program arguments:
  /home/adal/Store/clang_3.2_source_build/clang_cross/build_cmake/bin/clang++
  -target arm-none-eabi -I
  /home/adal/gcc-arm-none-eabi-4_8-2014q2/arm-none-eabi/include/
  -mfloat-abi=hard -mfpu=vfpv3-d16 -ccc-gcc-name
  /home/adal/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gcc -L
  ../build_cmake/lib/ -o
  CMakeFiles/cmTryCompileExec1717709649.dir/testCXXCompiler.cxx.o -c
 
/home/adal/Store/clang_3.2_source_build/clang_cross/build_cmake_cross_ARM/CMakeFiles/CMakeTmp/testCXXCompiler.cxx


  make.exe[1]: ***
  [CMakeFiles/cmTryCompileExec1717709649.dir/testCXXCompiler.cxx.o] Aborted

  make.exe[1]: Leaving directory
 
`/home/adal/Store/clang_3.2_source_build/clang_cross/build_cmake_cross_ARM/CMakeFiles/CMakeTmp'


  make.exe: *** [cmTryCompileExec1717709649/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>