[LLVMbugs] [Bug 21475] New: compiler-rt (git) CMake Error in AArch64 platform with GCC compiler

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 4 04:30:09 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21475

            Bug ID: 21475
           Summary: compiler-rt (git) CMake Error in AArch64 platform with
                    GCC compiler
           Product: compiler-rt
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: yuxing.tang at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13287
  --> http://llvm.org/bugs/attachment.cgi?id=13287&action=edit
the patch file for compiler-rt/cmake/config-ix.cmake in aarch64 platform

I got this Problem when try to build the whole llvm git tree in AArch64
platform. A simple test error in compiler-rt just stop the configuration
progress.

   It seems cmake try to do some compiling test before the real build, but it
failed in aarch64. Form the log. I figure out the possible cause is the wrong
"-march" parameters for gcc. It seems the cmake build system try to push
"-march=aarch64" into the compiler testing command. After checking the current
gcc document and testing gcc-4.8.3 and gcc-4.9.0, I'm sure current gcc release
just recognize "-march=armv8-a", not "-march=aarch64"

  The problem is in compiler-rt/cmake/config-ix.cmake file. If the platform is
aarch32, cmake will push the right parameter "-march=armv8-a". If the platform
is aarch64, the paramter will change to "-march=aarch64", which the gcc cannot
handle. So I produce a simple patch.

********************* possible patch ************************
--- ./llvmGIT/llvm/projects/compiler-rt/cmake/config-ix.cmake   2014-11-04
19:25:39.827152526 +0800
+++ ./llvm/projects/compiler-rt/cmake/config-ix.cmake   2014-10-28
08:25:15.189851798 +0800
@@ -148,7 +148,7 @@
   elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch32")
     test_target_arch(aarch32 "-march=armv8-a")
   elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch64")
-    test_target_arch(aarch64 "-march=aarch64")
+    test_target_arch(aarch64 "-march=armv8-a")
   endif()
   set(COMPILER_RT_OS_SUFFIX "")
 endif()

*************************************************
This patch just work for aarch64/Linux-gcc platform
I have tested this patch has no side effect in x86_64/Linux-gcc. but
aarch64/Linux-llvm or aarch64/MacOS has not been tested.


***************** The Error message log just as below *************

CMake Error at projects/compiler-rt/cmake/config-ix.cmake:87 (message):
  Cannot compile for aarch64:
 ...
 ...  
CMakeFiles/cmTryCompileExec4150267559.dir/simple.cc.o -c
  /home/xxx/SourceCode/llvmGIT/build/CMakeFiles/simple.cc

  /home/xxx/SourceCode/llvmGIT/build/CMakeFiles/simple.cc:1:0: error: unknown
  value ‘aarch64’ for -march
 ...
 ...  
make: *** [cmTryCompileExec4150267559/fast] Error 2

Call Stack (most recent call first):
  projects/compiler-rt/cmake/config-ix.cmake:151 (test_target_arch)
  projects/compiler-rt/CMakeLists.txt:216 (include)


-- Configuring incomplete, errors occurred!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141104/4065e887/attachment.html>


More information about the llvm-bugs mailing list