[Openmp-commits] [openmp] 57662cb - [OpenMP] Disable building `libomptarget` on 32-bit systems

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 18 10:40:13 PST 2023


Author: Shilei Tian
Date: 2023-01-18T13:40:08-05:00
New Revision: 57662cb2e375f32008b2373506aeb6f5631f827a

URL: https://github.com/llvm/llvm-project/commit/57662cb2e375f32008b2373506aeb6f5631f827a
DIFF: https://github.com/llvm/llvm-project/commit/57662cb2e375f32008b2373506aeb6f5631f827a.diff

LOG: [OpenMP] Disable building `libomptarget` on 32-bit systems

There are plenty of assumptions in `libomptarget` and the device runtime
about the pointer size or `size_t`, etc. 32-bit systems are not supported. There
is no point to refine whole things to make it portable. This patch simply disables
building on 32-bit systems.

Fix #60121.

Reviewed By: jdoerfert

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

Added: 
    

Modified: 
    openmp/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index 287d15dc59ac..a87ea2fb57c5 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -74,7 +74,8 @@ set(ENABLE_LIBOMPTARGET ON)
 # Currently libomptarget cannot be compiled on Windows or MacOS X.
 # Since the device plugins are only supported on Linux anyway,
 # there is no point in trying to compile libomptarget on other OSes.
-if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP17_FLAG)
+# 32-bit systems are not supported either.
+if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP17_FLAG OR NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
   set(ENABLE_LIBOMPTARGET OFF)
 endif()
 
@@ -100,6 +101,8 @@ if (OPENMP_ENABLE_LIBOMPTARGET)
     message(FATAL_ERROR "libomptarget cannot be built on Windows and MacOS X!")
   elseif (NOT OPENMP_HAVE_STD_CPP17_FLAG)
     message(FATAL_ERROR "Host compiler must support C++17 to build libomptarget!")
+  elseif (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
+    message(FATAL_ERROR "libomptarget on 32-bit systems are not supported!")
   endif()
 
   add_subdirectory(libomptarget)


        


More information about the Openmp-commits mailing list