Revert "[runtimes] Fix building initial libunwind+libcxxabi+libcxx with compiler implied -lunwind"

This reverts commit 7c3d19ab7bcb79636bd65ee55a0fefef224fcb25.

This commit was reported as causing build problems for the amdgpu
buildbot in https://reviews.llvm.org/D113253#3137097.

GitOrigin-RevId: efbe9ae23f05aeaca667b925a1efbe12094d0987
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dafc6ce..5ab8a30 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -773,13 +773,6 @@
     target_add_link_flags_if_supported(${target} PRIVATE "/nodefaultlib")
   endif()
 
-  if (LIBCXX_SUPPORTS_UNWINDLIB_NONE_FLAG AND LIBCXXABI_USE_LLVM_UNWINDER)
-    # If we're linking directly against the libunwind that we're building
-    # in the same invocation, don't try to link in the toolchain's
-    # default libunwind (which may be missing still).
-    target_add_link_flags_if_supported(${target} PRIVATE "--unwindlib=none")
-  endif()
-
   if (LIBCXX_HAS_SYSTEM_LIB)
     target_link_libraries(${target} PRIVATE System)
   endif()
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 167ea81..8ca8b14 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -1,22 +1,9 @@
 include(CMakePushCheckState)
 include(CheckLibraryExists)
-include(CheckLinkerFlag)
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 include(CheckCSourceCompiles)
 
-# The compiler driver may be implicitly trying to link against libunwind.
-# This is normally ok (libcxx relies on an unwinder), but if libunwind is
-# built in the same cmake invocation as libcxx and we've got
-# LIBCXXABI_USE_LLVM_UNWINDER set, we'd be linking against the just-built
-# libunwind (and the compiler implicit -lunwind wouldn't succeed as the newly
-# built libunwind isn't installed yet). For those cases, it'd be good to
-# link with --uwnindlib=none. Check if that option works.
-llvm_check_linker_flag("--unwindlib=none" LIBCXX_SUPPORTS_UNWINDLIB_NONE_FLAG)
-if (LIBCXX_SUPPORTS_UNWINDLIB_NONE_FLAG)
-  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --unwindlib=none")
-endif()
-
 if(WIN32 AND NOT MINGW)
   # NOTE(compnerd) this is technically a lie, there is msvcrt, but for now, lets
   # let the default linking take care of that.