[runtimes] Remove support for GCC-style 32 bit multilib builds

This patch removes the ability to build the runtimes in the 32 bit
multilib configuration, i.e. using -m32. Instead of doing this, one
should cross-compile the runtimes for the appropriate target triple,
like we do for all other triples.

As it stands, -m32 has several issues, which all seem to be related to
the fact that it's not well supported by the operating systems that
libc++ support. The simplest path towards fixing this is to remove
support for the configuration, which is also the best course of action
if there is little interest for keeping that configuration. If there
is a desire to keep this configuration around, we'll need to do some
work to figure out the underlying issues and fix them.

Differential Revision: https://reviews.llvm.org/D114473

GitOrigin-RevId: fa1c077b41ae1335332d65399802f2c68e82ca7b
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 518ae0e..0d51388 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,7 +108,11 @@
   "Build libc++abi with definitions for operator new/delete. These are normally
    defined in libc++abi, but it is also possible to define them in libc++, in
    which case the definition in libc++abi should be turned off." ON)
-option(LIBCXXABI_BUILD_32_BITS "Build 32 bit libc++abi." ${LLVM_BUILD_32_BITS})
+option(LIBCXXABI_BUILD_32_BITS "Build 32 bit multilib libc++abi. This option is not supported anymore when building the runtimes. Please specify a full triple instead." ${LLVM_BUILD_32_BITS})
+if (LIBCXXABI_BUILD_32_BITS)
+  message(WARNING "LIBCXXABI_BUILD_32_BITS is not supported anymore when building the runtimes, please specify a full triple instead.")
+endif()
+
 option(LIBCXXABI_INCLUDE_TESTS "Generate build targets for the libc++abi unit tests." ${LLVM_INCLUDE_TESTS})
 set(LIBCXXABI_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
     "Define suffix of library directory name (32/64)")
@@ -243,15 +247,6 @@
       "The path to libc++ library." FORCE)
 endif()
 
-# Check that we can build with 32 bits if requested.
-if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32)
-  if (LIBCXXABI_BUILD_32_BITS AND NOT LLVM_BUILD_32_BITS) # Don't duplicate the output from LLVM
-    message(STATUS "Building 32 bits executables and libraries.")
-  endif()
-elseif(LIBCXXABI_BUILD_32_BITS)
-  message(FATAL_ERROR "LIBCXXABI_BUILD_32_BITS=ON is not supported on this platform.")
-endif()
-
 # Declare libc++abi configuration variables.
 # They are intended for use as follows:
 # LIBCXXABI_C_FLAGS: General flags for both the c++ compiler and linker.
@@ -274,8 +269,6 @@
 #===============================================================================
 
 # Configure target flags
-add_target_flags_if(LIBCXXABI_BUILD_32_BITS "-m32")
-
 if(LIBCXXABI_TARGET_TRIPLE)
   add_target_flags_if_supported("--target=${LIBCXXABI_TARGET_TRIPLE}")
 endif()
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index ea4d5c4..6baaf40 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -37,7 +37,6 @@
   message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX being OFF requires LIBCXX_ENABLE_STATIC to be ON")
 endif()
 
-pythonize_bool(LIBCXXABI_BUILD_32_BITS)
 pythonize_bool(LIBCXX_ENABLE_SHARED)
 pythonize_bool(LIBCXXABI_ENABLE_SHARED)
 pythonize_bool(LIBCXXABI_ENABLE_THREADS)
@@ -90,10 +89,6 @@
   serialize_lit_param(target_triple "\"${LIBCXXABI_TARGET_TRIPLE}\"")
 endif()
 
-if (LIBCXXABI_BUILD_32_BITS)
-  serialize_lit_param(enable_32bit True)
-endif()
-
 foreach(param IN LISTS LIBCXXABI_TEST_PARAMS)
   string(REGEX REPLACE "(.+)=(.+)" "\\1" name "${param}")
   string(REGEX REPLACE "(.+)=(.+)" "\\2" value "${param}")
diff --git a/test/test_exception_storage.pass.cpp b/test/test_exception_storage.pass.cpp
index e532338..934cc4b 100644
--- a/test/test_exception_storage.pass.cpp
+++ b/test/test_exception_storage.pass.cpp
@@ -6,9 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// TODO(ldionne): This test fails on Ubuntu Focal on our CI nodes (and only there), in 32 bit mode.
-// UNSUPPORTED: linux && 32bits-on-64bits
-
 #include <algorithm>
 #include <cstdio>
 #include <cstdlib>