[LLVMdev] Building Compiler-RT on Windows

138 views
Skip to first unread message

Daniel Dilts

unread,
Feb 20, 2015, 10:06:20 AM2/20/15
to LLVM Developers Mailing List
Has anyone built Compiler-RT on Windows?  I am attempting to compile it for ARM, but I get errors from CMake.  It appears to be trying to pass VC++ flags to Clang.  I am using a version of Clang built from trunk.



PS D:\llvm\arm_test\compiler-rt-build> cmake -G Ninja -DCMAKE_C_COMPILER=clang.exe -DCMAKE_CXX_COMPILER=clang++.exe -DCM
AKE_RC_COMPILER=rc.exe -DCMAKE_CXX_FLAGS="" -DCMAKE_C_FLAGS="" ..\compiler-rt
-- The C compiler identification is Clang 3.7.0
clang.exe: error: no such file or directory: '/nologo'
clang.exe: error: no such file or directory: '/showIncludes'
-- The CXX compiler identification is Clang 3.7.0
clang.exe: error: no such file or directory: '/nologo'
clang.exe: error: no such file or directory: '/showIncludes'
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "d:/llvm/build/Release/bin/clang.exe" is not able to compile
  a simple test program.
  It fails with the following output:
   Change Dir: D:/llvm/arm_test/compiler-rt-build/CMakeFiles/CMakeTmp

  Run Build Command:"d:/llvm/ninja/ninja.exe" "cmTryCompileExec2171879632"
  [1/2] Building C object
  CMakeFiles\cmTryCompileExec2171879632.dir\testCCompiler.c.obj
  FAILED: d:\llvm\build\Release\bin\clang.exe /nologo /D_DEBUG /MDd /Zi /Ob0
  /Od /RTC1 /showIncludes
  /FoCMakeFiles\cmTryCompileExec2171879632.dir\testCCompiler.c.obj
  /FdCMakeFiles\cmTryCompileExec2171879632.dir\ -c testCCompiler.c
  clang.exe: error: no such file or directory: '/nologo'
  clang.exe: error: no such file or directory: '/D_DEBUG'
  clang.exe: error: no such file or directory: '/MDd'
  clang.exe: error: no such file or directory: '/Zi'
  clang.exe: error: no such file or directory: '/Ob0'
  clang.exe: error: no such file or directory: '/Od'
  clang.exe: error: no such file or directory: '/RTC1'
  clang.exe: error: no such file or directory: '/showIncludes'
  clang.exe: error: no such file or directory:
  '/FoCMakeFiles\cmTryCompileExec2171879632.dir\testCCompiler.c.obj'
  clang.exe: error: no such file or directory:
  '/FdCMakeFiles\cmTryCompileExec2171879632.dir\'
  ninja: build stopped: subcommand failed.


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

-- Configuring incomplete, errors occurred!
See also "D:/llvm/arm_test/compiler-rt-build/CMakeFiles/CMakeOutput.log".
See also "D:/llvm/arm_test/compiler-rt-build/CMakeFiles/CMakeError.log".

Alexey Samsonov

unread,
Feb 20, 2015, 1:05:06 PM2/20/15
to Daniel Dilts, LLVM Developers Mailing List
It looks like your command fails early in CMake TryCompile tests. Does (your version of) CMake supports using Clang on Windows at all?

_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




--
Alexey Samsonov
vono...@gmail.com

Daniel Dilts

unread,
Feb 20, 2015, 2:34:21 PM2/20/15
to Alexey Samsonov, LLVM Developers Mailing List
I am using CMake 3.1.2.

Timur Iskhodzhanov

unread,
Feb 20, 2015, 3:59:39 PM2/20/15
to Daniel Dilts, Alexey Samsonov, Saleem Abdulrasool, LLVM Developers Mailing List
[+Saleem]

Daniel Dilts

unread,
Feb 23, 2015, 5:43:21 PM2/23/15
to Timur Iskhodzhanov, LLVM Developers Mailing List
While looking closer at the CMake build system, it appears that you cannot use CMake to cross compile Compiler-RT on Windows.  In lib\builtins\CMakeLists.txt it has a "if (NOT WIN32)" that should make it so that it doesn't use the target specific file lists if compiling on Windows.

Saleem Abdulrasool

unread,
Feb 26, 2015, 12:15:16 AM2/26/15
to Timur Iskhodzhanov, LLVM Developers Mailing List
On Fri, Feb 20, 2015 at 12:54 PM, Timur Iskhodzhanov <timu...@google.com> wrote:
[+Saleem]


On Fri Feb 20 2015 at 10:31:04 PM Daniel Dilts <dilt...@gmail.com> wrote:
I am using CMake 3.1.2.

On Fri, Feb 20, 2015 at 10:00 AM, Alexey Samsonov <vono...@gmail.com> wrote:
It looks like your command fails early in CMake TryCompile tests. Does (your version of) CMake supports using Clang on Windows at all?

On Fri, Feb 20, 2015 at 7:02 AM, Daniel Dilts <dilt...@gmail.com> wrote:
Has anyone built Compiler-RT on Windows?  I am attempting to compile it for ARM, but I get errors from CMake.  It appears to be trying to pass VC++ flags to Clang.  I am using a version of Clang built from trunk.

This is unclear to me.  Are you trying to build it for Windows ARM?  Or some other ARM environment?



--
Saleem Abdulrasool
compnerd (at) compnerd (dot) org

Daniel Dilts

unread,
Feb 26, 2015, 12:45:11 PM2/26/15
to Saleem Abdulrasool, LLVM Developers Mailing List
I am attempting to build for bare-metal ARM.

Saleem Abdulrasool

unread,
Feb 28, 2015, 3:50:57 PM2/28/15
to Daniel Dilts, LLVM Developers Mailing List
On Thu, Feb 26, 2015 at 9:39 AM, Daniel Dilts <dilt...@gmail.com> wrote:
I am attempting to build for bare-metal ARM.

I found that cross-compiling compiler-rt was best achieved by either using the Make based build, or by writing your own CMakeList.txt outside of the included build system.  Note that you will need a sys root if you are trying to build the sanitizers or the profiler.
Reply all
Reply to author
Forward
0 new messages