[PATCH] D99755: Remove clang/runtime and `COMPILER_RT_INSTALL_PATH`

2021-04-04 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 updated this revision to Diff 335154.
Ericson2314 added a comment.

Put on top of D99860 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99755/new/

https://reviews.llvm.org/D99755

Files:
  clang/CMakeLists.txt
  clang/runtime/CMakeLists.txt
  clang/runtime/compiler-rt/clang_linux_test_input.c
  llvm/runtimes/CMakeLists.txt

Index: llvm/runtimes/CMakeLists.txt
===
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -1,6 +1,6 @@
 # TODO: This file assumes the Clang toolchain so it'd be better if it lived in
-# Clang, except there already is clang/runtime directory which contains
-# similar although simpler functionality. We should figure out how to merge
+# Clang, except there already is runtimes directory which contains
+# similar functionality. We should figure out how to merge
 # the two files.
 
 # TODO: Selecting runtimes should be always performed inside the runtimes
Index: clang/runtime/compiler-rt/clang_linux_test_input.c
===
--- clang/runtime/compiler-rt/clang_linux_test_input.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// This file is used to check if we can produce working executables
-// for i386 and x86_64 archs on Linux.
-#include 
-int main(){}
Index: clang/runtime/CMakeLists.txt
===
--- clang/runtime/CMakeLists.txt
+++ /dev/null
@@ -1,167 +0,0 @@
-# TODO: Set the install directory.
-
-include(ExternalProject)
-
-set(known_subdirs
-  "libcxx"
-  )
-
-foreach (dir ${known_subdirs})
-  if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/CMakeLists.txt)
-add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${dir})
-  endif()
-endforeach()
-
-function(get_ext_project_build_command out_var target)
-  if (CMAKE_GENERATOR MATCHES "Make")
-# Use special command for Makefiles to support parallelism.
-set(${out_var} "$(MAKE)" "${target}" PARENT_SCOPE)
-  else()
-set(${out_var} ${CMAKE_COMMAND} --build . --target ${target}
---config $ PARENT_SCOPE)
-  endif()
-endfunction()
-
-set(COMPILER_RT_SRC_ROOT ${LLVM_MAIN_SRC_DIR}/projects/compiler-rt)
-# Fallback to the external path, if the other one isn't available.
-# This is the same behavior (try "internal", then check the LLVM_EXTERNAL_...
-# variable) as in add_llvm_external_project
-if(NOT EXISTS ${COMPILER_RT_SRC_ROOT})
-  # We don't want to set it if LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR is ""
-  if(LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR)
-set(COMPILER_RT_SRC_ROOT ${LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR})
-  endif()
-endif()
-
-if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
-
-  # Add compiler-rt as an external project.
-  set(COMPILER_RT_PREFIX ${CMAKE_BINARY_DIR}/projects/compiler-rt)
-
-  set(STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/compiler-rt-stamps/)
-  set(BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/compiler-rt-bins/)
-
-  add_custom_target(compiler-rt-clear
-COMMAND ${CMAKE_COMMAND} -E remove_directory ${BINARY_DIR}
-COMMAND ${CMAKE_COMMAND} -E remove_directory ${STAMP_DIR}
-COMMENT "Clobberring compiler-rt build and stamp directories"
-)
-
-  # Find all variables that start with COMPILER_RT and populate a variable with
-  # them.
-  get_cmake_property(variableNames VARIABLES)
-  foreach(variableName ${variableNames})
-if(variableName MATCHES "^COMPILER_RT")
-  string(REPLACE ";" "\;" value "${${variableName}}")
-  list(APPEND COMPILER_RT_PASSTHROUGH_VARIABLES
--D${variableName}=${value})
-endif()
-  endforeach()
-
-  set(compiler_rt_configure_deps)
-  if(TARGET cxx-headers)
-list(APPEND compiler_rt_configure_deps "cxx-headers")
-  endif()
-  if(LLVM_INCLUDE_TESTS)
-list(APPEND compiler_rt_configure_deps LLVMTestingSupport)
-  endif()
-
-  ExternalProject_Add(compiler-rt
-DEPENDS llvm-config clang ${compiler_rt_configure_deps}
-PREFIX ${COMPILER_RT_PREFIX}
-SOURCE_DIR ${COMPILER_RT_SRC_ROOT}
-STAMP_DIR ${STAMP_DIR}
-BINARY_DIR ${BINARY_DIR}
-CMAKE_ARGS ${CLANG_COMPILER_RT_CMAKE_ARGS}
-   -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
-   -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++
-   -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
-   -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-   -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-   -DLLVM_CONFIG_PATH=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-config
-   -DLLVM_LIT_ARGS=${LLVM_LIT_ARGS}
-   -DCOMPILER_RT_OUTPUT_DIR=${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}
-   -DCOMPILER_RT_EXEC_OUTPUT_DIR=${LLVM_RUNTIME_OUTPUT_INTDIR}
-   -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}
-   

[PATCH] D99755: Remove clang/runtime and `COMPILER_RT_INSTALL_PATH`

2021-04-04 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 added a comment.

See also D99860 . We may still want to remove 
`clang/runtime`, but I don't think it's necessary. I will turn this revision 
into one on top of that just for for removing `clang/runtime`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99755/new/

https://reviews.llvm.org/D99755

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D99755: Remove clang/runtime and `COMPILER_RT_INSTALL_PATH`

2021-04-04 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 updated this revision to Diff 335149.
Ericson2314 added a comment.

Remove stray `COMPILER_RT_INSTALL_PATH`

I am uncertain about is the redefining of `CMAKE_INSTALL_PREIX` in
`compiler-rt/cmake/base-config-ix.cmake`. This occurs under
`LLVM_TREE_AVAILABLE`. If this is just for separate compiler-rt builds
(separate invocation of CMake, that is), this is fine. But if on the other hand
this is for combination builds in a single CMake run, then this sort of
redefinition is no good as it will effect more than compiler-rt.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99755/new/

https://reviews.llvm.org/D99755

Files:
  clang/CMakeLists.txt
  clang/runtime/CMakeLists.txt
  clang/runtime/compiler-rt/clang_linux_test_input.c
  compiler-rt/cmake/Modules/AddCompilerRT.cmake
  compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
  compiler-rt/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/cmake/base-config-ix.cmake
  compiler-rt/include/CMakeLists.txt
  compiler-rt/lib/dfsan/CMakeLists.txt
  llvm/runtimes/CMakeLists.txt

Index: llvm/runtimes/CMakeLists.txt
===
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -1,6 +1,6 @@
 # TODO: This file assumes the Clang toolchain so it'd be better if it lived in
-# Clang, except there already is clang/runtime directory which contains
-# similar although simpler functionality. We should figure out how to merge
+# Clang, except there already is runtimes directory which contains
+# similar functionality. We should figure out how to merge
 # the two files.
 
 # TODO: Selecting runtimes should be always performed inside the runtimes
Index: compiler-rt/lib/dfsan/CMakeLists.txt
===
--- compiler-rt/lib/dfsan/CMakeLists.txt
+++ compiler-rt/lib/dfsan/CMakeLists.txt
@@ -62,4 +62,4 @@
DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
 add_dependencies(dfsan dfsan_abilist)
 install(FILES ${dfsan_abilist_filename}
-DESTINATION ${COMPILER_RT_INSTALL_PATH}/share)
+DESTINATION share)
Index: compiler-rt/include/CMakeLists.txt
===
--- compiler-rt/include/CMakeLists.txt
+++ compiler-rt/include/CMakeLists.txt
@@ -69,22 +69,22 @@
 install(FILES ${SANITIZER_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
+  DESTINATION include/sanitizer)
 # Install fuzzer headers.
 install(FILES ${FUZZER_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer)
+  DESTINATION include/fuzzer)
 # Install xray headers.
 install(FILES ${XRAY_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray)
+  DESTINATION include/xray)
 # Install profile headers.
 install(FILES ${PROFILE_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile)
+  DESTINATION include/profile)
 
 if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
   add_custom_target(install-compiler-rt-headers
Index: compiler-rt/cmake/base-config-ix.cmake
===
--- compiler-rt/cmake/base-config-ix.cmake
+++ compiler-rt/cmake/base-config-ix.cmake
@@ -42,7 +42,7 @@
   # Setup the paths where compiler-rt runtimes and headers should be stored.
   set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION})
   set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
-  set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
+  set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
   option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests."
  ${LLVM_INCLUDE_TESTS})
   option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered"
@@ -68,8 +68,6 @@
 "Path where built compiler-rt libraries should be stored.")
   set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH
 "Path where built compiler-rt executables should be stored.")
-  set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH
-"Path where built compiler-rt libraries should be installed.")
   option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF)
   option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF)
   # Use a host compiler to compile/link tests.
@@ -92,12 +90,12 @@
   set(COMPILER_RT_LIBRARY_OUTPUT_DIR
 ${COMPILER_RT_OUTPUT_DIR})
   set(COMPILER_RT_LIBRARY_INSTALL_DIR
-

[PATCH] D99755: Remove clang/runtime and `COMPILER_RT_INSTALL_PATH`

2021-04-02 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 added a comment.

So unfortunately it seems the `clang/runtime`'s use was triggered by 
`LLVM_BUILD_EXTERNAL_COMPILER_RT`, which is in use in a few places still? (And 
not just Apple ones.)

On the other hand, since this is doing an *external* CMake for compiler-rt, I 
fail to see why `COMPILER_RT_INSTALL_PATH` is needed; why not just pass a 
different `CMAKE_INSTALL_PREFIX`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99755/new/

https://reviews.llvm.org/D99755

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D99755: Remove clang/runtime and `COMPILER_RT_INSTALL_PATH`

2021-04-02 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 updated this revision to Diff 334955.
Ericson2314 added a comment.

Remove add_subdirectory(runtime) for deleted dir


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99755/new/

https://reviews.llvm.org/D99755

Files:
  clang/CMakeLists.txt
  clang/runtime/CMakeLists.txt
  clang/runtime/compiler-rt/clang_linux_test_input.c
  compiler-rt/cmake/Modules/AddCompilerRT.cmake
  compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
  compiler-rt/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/cmake/base-config-ix.cmake
  compiler-rt/include/CMakeLists.txt
  compiler-rt/lib/dfsan/CMakeLists.txt
  llvm/runtimes/CMakeLists.txt

Index: llvm/runtimes/CMakeLists.txt
===
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -1,6 +1,6 @@
 # TODO: This file assumes the Clang toolchain so it'd be better if it lived in
-# Clang, except there already is clang/runtime directory which contains
-# similar although simpler functionality. We should figure out how to merge
+# Clang, except there already is runtimes directory which contains
+# similar functionality. We should figure out how to merge
 # the two files.
 
 # TODO: Selecting runtimes should be always performed inside the runtimes
Index: compiler-rt/lib/dfsan/CMakeLists.txt
===
--- compiler-rt/lib/dfsan/CMakeLists.txt
+++ compiler-rt/lib/dfsan/CMakeLists.txt
@@ -62,4 +62,4 @@
DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
 add_dependencies(dfsan dfsan_abilist)
 install(FILES ${dfsan_abilist_filename}
-DESTINATION ${COMPILER_RT_INSTALL_PATH}/share)
+DESTINATION share)
Index: compiler-rt/include/CMakeLists.txt
===
--- compiler-rt/include/CMakeLists.txt
+++ compiler-rt/include/CMakeLists.txt
@@ -69,22 +69,22 @@
 install(FILES ${SANITIZER_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
+  DESTINATION include/sanitizer)
 # Install fuzzer headers.
 install(FILES ${FUZZER_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer)
+  DESTINATION include/fuzzer)
 # Install xray headers.
 install(FILES ${XRAY_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray)
+  DESTINATION include/xray)
 # Install profile headers.
 install(FILES ${PROFILE_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile)
+  DESTINATION include/profile)
 
 if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
   add_custom_target(install-compiler-rt-headers
Index: compiler-rt/cmake/base-config-ix.cmake
===
--- compiler-rt/cmake/base-config-ix.cmake
+++ compiler-rt/cmake/base-config-ix.cmake
@@ -92,12 +92,12 @@
   set(COMPILER_RT_LIBRARY_OUTPUT_DIR
 ${COMPILER_RT_OUTPUT_DIR})
   set(COMPILER_RT_LIBRARY_INSTALL_DIR
-${COMPILER_RT_INSTALL_PATH})
+"")
 else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
   set(COMPILER_RT_LIBRARY_OUTPUT_DIR
 ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
   set(COMPILER_RT_LIBRARY_INSTALL_DIR
-${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR})
+lib/${COMPILER_RT_OS_DIR})
 endif()
 
 if(APPLE)
Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -386,7 +386,7 @@
 function(get_compiler_rt_install_dir arch install_dir)
   if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
 get_compiler_rt_target(${arch} target)
-set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/lib/${target} PARENT_SCOPE)
+set(${install_dir} lib/${target} PARENT_SCOPE)
   else()
 set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE)
   endif()
Index: compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -508,7 +508,7 @@
 set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR
   ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded)
 set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR
-  ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded)
+  lib/macho_embedded)
   
 set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi")
 set(CFLAGS_i386 "-march=pentium")
Index: compiler-rt/cmake/Modules/AddCompilerRT.cmake

[PATCH] D99755: Remove clang/runtime and `COMPILER_RT_INSTALL_PATH`

2021-04-01 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment.

@beanz do you know if `clang/runtime` is still being used?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99755/new/

https://reviews.llvm.org/D99755

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D99755: Remove clang/runtime and `COMPILER_RT_INSTALL_PATH`

2021-04-01 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 updated this revision to Diff 334780.
Ericson2314 added a comment.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Also remove `clang/runtime` from a TODO comment elsewhere in the tree

I put `runtimes` in there as it's evidentially its spiritual successor.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99755/new/

https://reviews.llvm.org/D99755

Files:
  clang/runtime/CMakeLists.txt
  clang/runtime/compiler-rt/clang_linux_test_input.c
  compiler-rt/cmake/Modules/AddCompilerRT.cmake
  compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
  compiler-rt/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/cmake/base-config-ix.cmake
  compiler-rt/include/CMakeLists.txt
  compiler-rt/lib/dfsan/CMakeLists.txt
  llvm/runtimes/CMakeLists.txt

Index: llvm/runtimes/CMakeLists.txt
===
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -1,6 +1,6 @@
 # TODO: This file assumes the Clang toolchain so it'd be better if it lived in
-# Clang, except there already is clang/runtime directory which contains
-# similar although simpler functionality. We should figure out how to merge
+# Clang, except there already is runtimes directory which contains
+# similar functionality. We should figure out how to merge
 # the two files.
 
 # TODO: Selecting runtimes should be always performed inside the runtimes
Index: compiler-rt/lib/dfsan/CMakeLists.txt
===
--- compiler-rt/lib/dfsan/CMakeLists.txt
+++ compiler-rt/lib/dfsan/CMakeLists.txt
@@ -62,4 +62,4 @@
DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
 add_dependencies(dfsan dfsan_abilist)
 install(FILES ${dfsan_abilist_filename}
-DESTINATION ${COMPILER_RT_INSTALL_PATH}/share)
+DESTINATION share)
Index: compiler-rt/include/CMakeLists.txt
===
--- compiler-rt/include/CMakeLists.txt
+++ compiler-rt/include/CMakeLists.txt
@@ -69,22 +69,22 @@
 install(FILES ${SANITIZER_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
+  DESTINATION include/sanitizer)
 # Install fuzzer headers.
 install(FILES ${FUZZER_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer)
+  DESTINATION include/fuzzer)
 # Install xray headers.
 install(FILES ${XRAY_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray)
+  DESTINATION include/xray)
 # Install profile headers.
 install(FILES ${PROFILE_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile)
+  DESTINATION include/profile)
 
 if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
   add_custom_target(install-compiler-rt-headers
Index: compiler-rt/cmake/base-config-ix.cmake
===
--- compiler-rt/cmake/base-config-ix.cmake
+++ compiler-rt/cmake/base-config-ix.cmake
@@ -92,12 +92,12 @@
   set(COMPILER_RT_LIBRARY_OUTPUT_DIR
 ${COMPILER_RT_OUTPUT_DIR})
   set(COMPILER_RT_LIBRARY_INSTALL_DIR
-${COMPILER_RT_INSTALL_PATH})
+"")
 else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
   set(COMPILER_RT_LIBRARY_OUTPUT_DIR
 ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
   set(COMPILER_RT_LIBRARY_INSTALL_DIR
-${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR})
+lib/${COMPILER_RT_OS_DIR})
 endif()
 
 if(APPLE)
Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -386,7 +386,7 @@
 function(get_compiler_rt_install_dir arch install_dir)
   if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
 get_compiler_rt_target(${arch} target)
-set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/lib/${target} PARENT_SCOPE)
+set(${install_dir} lib/${target} PARENT_SCOPE)
   else()
 set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE)
   endif()
Index: compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -508,7 +508,7 @@
 set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR
   ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded)
 set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR
-  ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded)
+  lib/macho_embedded)
   
 

[PATCH] D99755: Remove clang/runtime and `COMPILER_RT_INSTALL_PATH`

2021-04-01 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 added inline comments.



Comment at: compiler-rt/cmake/base-config-ix.cmake:95
   set(COMPILER_RT_LIBRARY_INSTALL_DIR
-${COMPILER_RT_INSTALL_PATH})
+"")
 else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)

I'm a bit confused we'd ever want too install libs directly in 
`${CMAKE_INSTALL_PREFIX}`, but that is technically the existing behavior, with 
the default value for `COMPILER_RT_INSTALL_PATH`, so I kept it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99755/new/

https://reviews.llvm.org/D99755

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D99755: Remove clang/runtime and `COMPILER_RT_INSTALL_PATH`

2021-04-01 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 created this revision.
Herald added a subscriber: mgorny.
Ericson2314 requested review of this revision.
Herald added projects: clang, Sanitizers.
Herald added subscribers: Sanitizers, cfe-commits.

This patch removes those in order to simplify things for D99484 
.

As @phosek said in https://reviews.llvm.org/D99484#2662806

> I'm not sure if we still need `COMPILER_RT_INSTALL_PATH`. That
> variable is only used by `clang/runtime/CMakeLists.txt` which
> predates `runtimes/CMakeLists.txt` and was AFAIK only ever used by
> Apple. I think  we should consider removing
> `COMPILER_RT_INSTALL_PATH`. We'll need to check if
> `clang/runtime/CMakeLists.txt` is still being used or not.

I think it's easiest to have that conversation in a dedicated patch, so
I went and opened this right away.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99755

Files:
  clang/runtime/CMakeLists.txt
  clang/runtime/compiler-rt/clang_linux_test_input.c
  compiler-rt/cmake/Modules/AddCompilerRT.cmake
  compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
  compiler-rt/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/cmake/base-config-ix.cmake
  compiler-rt/include/CMakeLists.txt
  compiler-rt/lib/dfsan/CMakeLists.txt

Index: compiler-rt/lib/dfsan/CMakeLists.txt
===
--- compiler-rt/lib/dfsan/CMakeLists.txt
+++ compiler-rt/lib/dfsan/CMakeLists.txt
@@ -62,4 +62,4 @@
DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
 add_dependencies(dfsan dfsan_abilist)
 install(FILES ${dfsan_abilist_filename}
-DESTINATION ${COMPILER_RT_INSTALL_PATH}/share)
+DESTINATION share)
Index: compiler-rt/include/CMakeLists.txt
===
--- compiler-rt/include/CMakeLists.txt
+++ compiler-rt/include/CMakeLists.txt
@@ -69,22 +69,22 @@
 install(FILES ${SANITIZER_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
+  DESTINATION include/sanitizer)
 # Install fuzzer headers.
 install(FILES ${FUZZER_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer)
+  DESTINATION include/fuzzer)
 # Install xray headers.
 install(FILES ${XRAY_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray)
+  DESTINATION include/xray)
 # Install profile headers.
 install(FILES ${PROFILE_HEADERS}
   COMPONENT compiler-rt-headers
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile)
+  DESTINATION include/profile)
 
 if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs.
   add_custom_target(install-compiler-rt-headers
Index: compiler-rt/cmake/base-config-ix.cmake
===
--- compiler-rt/cmake/base-config-ix.cmake
+++ compiler-rt/cmake/base-config-ix.cmake
@@ -92,12 +92,12 @@
   set(COMPILER_RT_LIBRARY_OUTPUT_DIR
 ${COMPILER_RT_OUTPUT_DIR})
   set(COMPILER_RT_LIBRARY_INSTALL_DIR
-${COMPILER_RT_INSTALL_PATH})
+"")
 else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
   set(COMPILER_RT_LIBRARY_OUTPUT_DIR
 ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
   set(COMPILER_RT_LIBRARY_INSTALL_DIR
-${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR})
+lib/${COMPILER_RT_OS_DIR})
 endif()
 
 if(APPLE)
Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -386,7 +386,7 @@
 function(get_compiler_rt_install_dir arch install_dir)
   if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
 get_compiler_rt_target(${arch} target)
-set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/lib/${target} PARENT_SCOPE)
+set(${install_dir} lib/${target} PARENT_SCOPE)
   else()
 set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE)
   endif()
Index: compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
===
--- compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -508,7 +508,7 @@
 set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR
   ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded)
 set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR
-  ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded)
+  lib/macho_embedded)
   
 set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi")
 set(CFLAGS_i386 "-march=pentium")
Index: compiler-rt/cmake/Modules/AddCompilerRT.cmake