[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem with ftbfs on armel and mipsel with cmake 3.16.3



On Wednesday, June 3, 2020 4:58:08 PM EDT Håvard Flaget Aasen wrote:
> The beginning of the error message is:
> CMake Error at
> /usr/share/cmake-3.16/Modules/CMakeCompilerIdDetection.cmake:26 (list):
>   list sub-command REMOVE_ITEM requires two or more arguments.

That part of the module says
list(REMOVE_ITEM lang_files ${nonlang_files})
so the error probably has to do with ${nonlang_files} being empty. I reproduced 
on mipsel emulated with qemu-user-static (a wonderful gem [1]), I didn't try 
this on real hardware.

It looks like the part to define nonlang_files immediately preceding is 
file(GLOB nonlang_files
      "${CMAKE_ROOT}/Modules/Compiler/*-${nonlang}-DetermineCompiler.cmake")

Rolling back to CMake to 3.15.4 was the same, but CMake 3.13.2 worked. So I 
looked as to what the difference would be between those paths and got files.diff.
I've attached the diff on CMakeCompilerIdDetection.cmake. Both of these 
together seem to be ARM and MIPS-specific, so are probably related to the issue 
somehow.

I'm CC'ing the CMake folks should they have a clue.

[1] https://wiki.debian.org/QemuUserEmulation
--- CMakeCompilerIdDetection-3.13.cmake 2020-06-03 22:16:34.014977295 +0000
+++ CMakeCompilerIdDetection-3.15.cmake 2020-06-03 22:17:14.334981254 +0000
@@ -57,12 +57,14 @@
       HP
       Compaq
       zOS
+      XLClang
       XL
       VisualAge
       PGI
       Cray
       TI
       Fujitsu
+      GHS
     )
     if (lang STREQUAL C)
       list(APPEND ordered_compilers
@@ -72,21 +74,20 @@
     endif()
     list(APPEND ordered_compilers
       SCO
+      ARMCC
       AppleClang
+      ARMClang
       Clang
       GNU
       MSVC
       ADSP
       IAR
-      ARMCC
     )
     if (lang STREQUAL C)
       list(APPEND ordered_compilers
         SDCC
       )
     endif()
-    list(APPEND ordered_compilers
-      MIPSpro)

     #Currently the only CUDA compilers are NVIDIA
     if(lang STREQUAL CUDA)
@@ -97,6 +98,8 @@
       foreach(Id ${ordered_compilers})
         string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "# define ${CID_PREFIX}COMPILER_IS_${Id} 0\n")
       endforeach()
+      # Hard-code definitions for compilers that are no longer supported.
+      string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "# define ${CID_PREFIX}COMPILER_IS_MIPSpro 0\n")
     endif()

     set(pp_if "#if")
@@ -135,9 +138,6 @@
 /* These compilers are either not known or too old to define an
   identification macro.  Try to identify the platform and guess that
   it is the native compiler.  */
-#elif defined(__sgi)
-# define ${CID_PREFIX}COMPILER_ID \"MIPSpro\"
-
 #elif defined(__hpux) || defined(__hpua)
 # define ${CID_PREFIX}COMPILER_ID \"HP\"
--- $(ls /usr/share/cmake-3.16/Modules/Compiler/ | grep DetermineCompiler)   2020-06-03 22:30:47.193727765 +0000
+++ $(ls /usr/share/cmake-3.13/Modules/Compiler/ | grep DetermineCompiler)   2020-06-03 22:30:16.825801414 +0000
@@ -1,5 +1,6 @@
 ADSP-DetermineCompiler.cmake
 ARMCC-DetermineCompiler.cmake
+ARMClang-DetermineCompiler.cmake
 AppleClang-DetermineCompiler.cmake
 Borland-DetermineCompiler.cmake
 Bruce-C-DetermineCompiler.cmake
@@ -18,7 +19,6 @@
 HP-CXX-DetermineCompiler.cmake
 IAR-DetermineCompiler.cmake
 Intel-DetermineCompiler.cmake
-MIPSpro-DetermineCompiler.cmake
 MSVC-DetermineCompiler.cmake
 NVIDIA-DetermineCompiler.cmake
 OpenWatcom-DetermineCompiler.cmake
@@ -35,5 +35,7 @@
 Watcom-DetermineCompiler.cmake
 XL-C-DetermineCompiler.cmake
 XL-CXX-DetermineCompiler.cmake
+XLClang-C-DetermineCompiler.cmake
+XLClang-CXX-DetermineCompiler.cmake
 zOS-C-DetermineCompiler.cmake
 zOS-CXX-DetermineCompiler.cmake

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: