Skip to content
Snippets Groups Projects
Commit a604b33d authored by Eleni Mathioulaki's avatar Eleni Mathioulaki
Browse files

update llvm from Spack upstream

parent 9b0b106e
No related branches found
No related tags found
No related merge requests found
Index: lldb/bindings/python/get-python-config.py
===================================================================
--- lldb/bindings/python/get-python-config.py
+++ lldb/bindings/python/get-python-config.py
@@ -44,15 +44,21 @@
elif args.variable_name == "LLDB_PYTHON_EXE_RELATIVE_PATH":
tried = list()
exe = sys.executable
- prefix = os.path.realpath(sys.prefix)
+ prefix = sys.prefix
while True:
try:
print(relpath_nodots(exe, prefix))
break
except ValueError:
tried.append(exe)
- if os.path.islink(exe):
- exe = os.path.join(os.path.realpath(os.path.dirname(exe)), os.readlink(exe))
+ real_exe_dirname = os.path.realpath(os.path.dirname(exe))
+ real_prefix = os.path.realpath(prefix)
+ if prefix != real_prefix:
+ prefix = real_prefix
+ exe = os.path.join(real_exe_dirname, os.path.basename(exe))
+ continue
+ elif os.path.islink(exe):
+ exe = os.path.join(real_exe_dirname, os.readlink(exe))
continue
else:
print("Could not find a relative path to sys.executable under sys.prefix", file=sys.stderr)
From 3bf63cf3b366d3a57cf5cbad4112a6abf6c0c3b1 Mon Sep 17 00:00:00 2001
From: Marshall Clow <mclow.lists@gmail.com>
Date: Tue, 2 Apr 2019 14:46:36 +0000
Subject: [PATCH] Special case some duration arithmetic for GCC and PPC because
their long double constant folding is broken. Fixes PR#39696.
llvm-svn: 357478
---
libcxx/include/thread | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libcxx/include/thread b/libcxx/include/thread
index df06ff70f8e37f22f4108be8e5e79a38052a11dd..400459ae7f32c4d7cd24b2d85c49d789500e432d 100644
--- a/libcxx/include/thread --- a/libcxx/include/thread
+++ b/libcxx/include/thread +++ b/libcxx/include/thread
@@ -435,7 +435,12 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d) @@ -434,7 +434,12 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
using namespace chrono; using namespace chrono;
if (__d > duration<_Rep, _Period>::zero()) if (__d > duration<_Rep, _Period>::zero())
{ {
+#if ! (defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)) +#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
+ // GCC's long double const folding is incomplete for IBM128 long doubles. + // GCC's long double const folding is incomplete for IBM128 long doubles.
_LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
+#else
+ _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ; + _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
+#else
_LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
+#endif +#endif
nanoseconds __ns; nanoseconds __ns;
if (__d < _Max) if (__d < _Max)
......
-- a/libcxx/include/thread From d9a42ec98adcb1ebc0c3837715df4e5a50c7ccc0 Mon Sep 17 00:00:00 2001
From: "Joel E. Denny" <jdenny.ornl@gmail.com>
Date: Wed, 10 Jun 2020 12:40:43 -0400
Subject: [PATCH] [libc++] Work around gcc/Power9 bug in `include/thread`
This fixes PR39696, which breaks the libcxx build with gcc (I tested
7.5.0) on Power9. This fix was suggested at
https://bugs.llvm.org/show_bug.cgi?id=39696#c38
but never applied. It just reverts 0583d9ea8d5e, which reverses
components of the original fix in 3bf63cf3b366, which is correct.
Fixes https://llvm.org/PR39696
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D81438
---
libcxx/include/thread | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libcxx/include/thread b/libcxx/include/thread
index 22aa4f201295867cff57b7a944e6b7bd67b22ad3..6eff1800acdbef09eae4417eee977fa350c596ea 100644
--- a/libcxx/include/thread
+++ b/libcxx/include/thread +++ b/libcxx/include/thread
@@ -370,7 +370,7 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d) @@ -365,9 +365,9 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
using namespace chrono;
if (__d > duration<_Rep, _Period>::zero())
{ {
-#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__) #if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
+#if ! (defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__))
// GCC's long double const folding is incomplete for IBM128 long doubles. // GCC's long double const folding is incomplete for IBM128 long doubles.
_LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max(); - _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
#else -#else
_LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
+#else
+ _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
#endif
nanoseconds __ns;
if (__d < _Max)
diff --git a/openmp/runtime/cmake/LibompHandleFlags.cmake b/openmp/runtime/cmake/LibompHandleFlags.cmake
index 9e19e59ba17d..f92fa12d851a 100644
--- a/openmp/runtime/cmake/LibompHandleFlags.cmake
+++ b/openmp/runtime/cmake/LibompHandleFlags.cmake
@@ -144,7 +144,8 @@ function(libomp_get_libflags libflags)
endif()
set(libflags_local ${libflags_local} ${LIBOMP_LIBFLAGS})
libomp_setup_flags(libflags_local)
- set(${libflags} ${libflags_local} PARENT_SCOPE)
+ libomp_string_to_list("${libflags_local}" libflags_local_list)
+ set(${libflags} ${libflags_local_list} PARENT_SCOPE)
endfunction()
# Fortran flags
diff --git a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
index e3c2a580396e..5f76992d193e 100644
--- a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+++ b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -249,3 +249,6 @@ if (NOT LIBOMPTARGET_CUDA_TOOLKIT_ROOT_DIR_PRESET AND
endif()
endif()
endif()
+
+find_package(Threads REQUIRED)
+set(OPENMP_PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
index 15e6c3bbaf1f..3e5a73504a08 100644
--- a/openmp/libomptarget/src/CMakeLists.txt
+++ b/openmp/libomptarget/src/CMakeLists.txt
@@ -30,6 +30,7 @@ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMPTARGET_PROFILING))
add_library(omptarget SHARED ${LIBOMPTARGET_SRC_FILES})
target_link_libraries(omptarget
${CMAKE_DL_LIBS}
+ ${OPENMP_PTHREAD_LIB}
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
else()
set(LLVM_LINK_COMPONENTS
@@ -37,6 +38,7 @@ else()
)
add_llvm_library(omptarget SHARED ${LIBOMPTARGET_SRC_FILES}
LINK_LIBS ${CMAKE_DL_LIBS}
+ ${OPENMP_PTHREAD_LIB}
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports"
)
target_compile_definitions(omptarget PUBLIC OMPTARGET_PROFILE_ENABLED)
--- spack-src/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake.org 2022-02-08 14:58:13.000000000 +0900
+++ spack-src/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake 2022-02-08 13:58:53.000000000 +0900
@@ -276,4 +276,5 @@
endif()
endif()
-set(OPENMP_PTHREAD_LIB ${LLVM_PTHREAD_LIB})
+find_package(Threads REQUIRED)
+set(OPENMP_PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
--- spack-src/openmp/libomptarget/src/CMakeLists.txt.org 2022-02-09 08:49:35.000000000 +0900
+++ spack-src/openmp/libomptarget/src/CMakeLists.txt 2022-02-09 08:50:18.000000000 +0900
@@ -36,6 +36,7 @@
endif()
target_link_libraries(omptarget PRIVATE
${CMAKE_DL_LIBS}
+ ${OPENMP_PTHREAD_LIB}
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
# Install libomptarget under the lib destination folder.
--- spack-src/libcxx/include/__config.org 2022-02-03 14:36:11.000000000 +0900
+++ spack-src/libcxx/include/__config 2022-02-04 08:39:59.000000000 +0900
@@ -52,7 +52,11 @@
# elif __cplusplus <= 201703L
# define _LIBCPP_STD_VER 17
# elif __cplusplus <= 202002L
-# define _LIBCPP_STD_VER 20
+# if defined(__FUJITSU) || defined(__CLANG_FUJITSU)
+# define _LIBCPP_STD_VER 17
+# else
+# define _LIBCPP_STD_VER 20
+# endif
# else
# define _LIBCPP_STD_VER 21 // current year, or date of c++2b ratification
# endif
--- a/openmp/libompd/src/CMakeLists.txt
+++ b/openmp/libompd/src/CMakeLists.txt
@@ -44,6 +44,10 @@
${LIBOMP_SRC_DIR}
)
+if(${LIBOMP_USE_HWLOC})
+ include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)
+endif()
+
INSTALL( TARGETS ompd
LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR}
diff --git a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
index 1f2a50667c4f..d3ff232f6bd3 100644
--- a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+++ b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -280,4 +280,5 @@ if (NOT LIBOMPTARGET_CUDA_TOOLKIT_ROOT_DIR_PRESET AND
endif()
endif()
-set(OPENMP_PTHREAD_LIB ${LLVM_PTHREAD_LIB})
+find_package(Threads REQUIRED)
+set(OPENMP_PTHREAD_LIB Threads::Threads)
diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
index 071ec61889a2..b782c3b07e6f 100644
--- a/openmp/libomptarget/src/CMakeLists.txt
+++ b/openmp/libomptarget/src/CMakeLists.txt
@@ -33,6 +33,7 @@ add_llvm_library(omptarget
LINK_LIBS
PRIVATE
${CMAKE_DL_LIBS}
+ ${OPENMP_PTHREAD_LIB}
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports"
NO_INSTALL_RPATH
)
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment