[compiler-rt] [compiler-rt] freadlink fix 2 for #83679. (PR #110372)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 28 15:10:59 PDT 2024


expcov wrote:

@devnexen I have successfully built libclang_rt on the freadlink_macos_fix2 branch.
However, an error occurs during the build of runtimes-clobber.

```
[100%] Built target yaml2obj
[100%] Built target llvm_gtest
[100%] Built target llvm_gtest_main
[100%] Built target runtimes-clobber
[100%] Performing configure step for 'runtimes'
Not searching for unused variables given on the command line.
loading initial cache file /Users/kenji/develop/expcov/freadlink_macos_fix2/build/projects/runtimes/tmp/runtimes-cache-Release.cmake
-- Warning: Did not find file Compiler/-ASM
-- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES) 
-- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES) 
CMake Error at /Users/kenji/develop/expcov/freadlink_macos_fix2/llvm/cmake/modules/CheckProblematicConfigurations.cmake:14 (if):
  if given arguments:

    "STREQUAL" "MSVC"

  Unknown arguments specified
Call Stack (most recent call first):
  /Users/kenji/develop/expcov/freadlink_macos_fix2/llvm/cmake/modules/HandleLLVMOptions.cmake:10 (include)
  CMakeLists.txt:166 (include)


-- Configuring incomplete, errors occurred!
make[2]: *** [runtimes/runtimes-stamps/runtimes-configure] Error 1
make[1]: *** [runtimes/CMakeFiles/runtimes.dir/all] Error 2
make: *** [all] Error 2
```

I think the following fixes are needed to correct this problem.

```
diff --git a/llvm/cmake/modules/CheckProblematicConfigurations.cmake b/llvm/cmake/modules/CheckProblematicConfigurations.cmake
index e133873d756c..c39414fc385b 100644
--- a/llvm/cmake/modules/CheckProblematicConfigurations.cmake
+++ b/llvm/cmake/modules/CheckProblematicConfigurations.cmake
@@ -11,7 +11,7 @@ endmacro()
 
 # MSVC and /arch:AVX is untested and have created problems before. See:
 # https://github.com/llvm/llvm-project/issues/54645
-if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
   string(TOLOWER "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}" _FLAGS)
   if(_FLAGS MATCHES "/arch:avx[0-9]*")
     log_problematic("Compiling LLVM with MSVC and the /arch:AVX flag is known to cause issues with parts of LLVM.\nSee https://github.com/llvm/llvm-project/issues/54645 for details.\nUse clang-cl if you want to enable AVX instructions.")
```

I have an error when building libunwind, I will exclude it and try the build again.

https://github.com/llvm/llvm-project/pull/110372


More information about the llvm-commits mailing list