[llvm-branch-commits] [openmp] 7fad20e - Revert "[OpenMP] Disabled profiling in `libomp` by default to unblock link errors"

2021-02-04 Thread Shilei Tian via llvm-branch-commits

Author: Shilei Tian
Date: 2021-02-04T08:44:20-05:00
New Revision: 7fad20eccc4f9fe5d03b2e381e26e8eb13a3e3be

URL: 
https://github.com/llvm/llvm-project/commit/7fad20eccc4f9fe5d03b2e381e26e8eb13a3e3be
DIFF: 
https://github.com/llvm/llvm-project/commit/7fad20eccc4f9fe5d03b2e381e26e8eb13a3e3be.diff

LOG: Revert "[OpenMP] Disabled profiling in `libomp` by default to unblock link 
errors"

This reverts commit f5602e0bf31ab590da19fa357980a753dbfd666e.

Added: 


Modified: 
openmp/CMakeLists.txt
openmp/docs/design/Runtimes.rst
openmp/runtime/CMakeLists.txt
openmp/runtime/src/CMakeLists.txt
openmp/runtime/src/kmp_config.h.cmake
openmp/runtime/src/kmp_runtime.cpp

Removed: 




diff  --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index 4787d4b5a321..67600bebdafb 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -86,12 +86,6 @@ option(OPENMP_ENABLE_LIBOMPTARGET "Enable building 
libomptarget for offloading."
${ENABLE_LIBOMPTARGET})
 option(OPENMP_ENABLE_LIBOMPTARGET_PROFILING "Enable time profiling for 
libomptarget."
${ENABLE_LIBOMPTARGET})
-option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF)
-
-# Build host runtime library, after LIBOMPTARGET variables are set since they 
are needed
-# to enable time profiling support in the OpenMP runtime.
-add_subdirectory(runtime)
-
 if (OPENMP_ENABLE_LIBOMPTARGET)
   # Check that the library can actually be built.
   if (APPLE OR WIN32)

diff  --git a/openmp/docs/design/Runtimes.rst b/openmp/docs/design/Runtimes.rst
index ad36e43eccdc..016b88ba324b 100644
--- a/openmp/docs/design/Runtimes.rst
+++ b/openmp/docs/design/Runtimes.rst
@@ -48,10 +48,7 @@ similar to Clang's ``-ftime-trace`` option. This generates a 
JSON file based on
 `Speedscope App`_. Building this feature depends on the `LLVM Support Library`_
 for time trace output. Using this library is enabled by default when building
 using the CMake option ``OPENMP_ENABLE_LIBOMPTARGET_PROFILING``. The output 
will
-be saved to the filename specified by the environment variable. For 
multi-threaded
-applications, profiling in ``libomp`` is also needed. Setting the CMake option
-``OPENMP_ENABLE_LIBOMP_PROFILING=ON`` to enable the feature. Note that this 
will
-turn ``libomp`` into a C++ library.
+be saved to the filename specified by the environment variable.
 
 .. _`Chrome Tracing`: 
https://www.chromium.org/developers/how-tos/trace-event-profiling-tool
 

diff  --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt
index 8828ff8ef455..9fdd04f41646 100644
--- a/openmp/runtime/CMakeLists.txt
+++ b/openmp/runtime/CMakeLists.txt
@@ -34,6 +34,7 @@ if(${OPENMP_STANDALONE_BUILD})
   # Should assertions be enabled?  They are on by default.
   set(LIBOMP_ENABLE_ASSERTIONS TRUE CACHE BOOL
 "enable assertions?")
+  set(LIBOMPTARGET_PROFILING_SUPPORT FALSE)
 else() # Part of LLVM build
   # Determine the native architecture from LLVM.
   string(TOLOWER "${LLVM_TARGET_ARCH}" LIBOMP_NATIVE_ARCH)
@@ -65,11 +66,10 @@ else() # Part of LLVM build
 libomp_get_architecture(LIBOMP_ARCH)
   endif ()
   set(LIBOMP_ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS})
+  # Time profiling support
+  set(LIBOMPTARGET_PROFILING_SUPPORT ${OPENMP_ENABLE_LIBOMPTARGET_PROFILING})
 endif()
 
-# Time profiling support
-set(LIBOMP_PROFILING_SUPPORT ${OPENMP_ENABLE_LIBOMP_PROFILING})
-
 # FUJITSU A64FX is a special processor because its cache line size is 256.
 # We need to pass this information into kmp_config.h.
 if(LIBOMP_ARCH STREQUAL "aarch64")

diff  --git a/openmp/runtime/src/CMakeLists.txt 
b/openmp/runtime/src/CMakeLists.txt
index 822f9ca2b825..2e927df84f5c 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -50,14 +50,6 @@ if(${LIBOMP_USE_HWLOC})
   include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)
 endif()
 
-# Building with time profiling support requires LLVM directory includes.
-if(LIBOMP_PROFILING_SUPPORT)
-  include_directories(
-${LLVM_MAIN_INCLUDE_DIR}
-${LLVM_INCLUDE_DIR}
-  )
-endif()
-
 # Getting correct source files to build library
 set(LIBOMP_CXXFILES)
 set(LIBOMP_ASMFILES)
@@ -143,7 +135,7 @@ libomp_get_ldflags(LIBOMP_CONFIGURED_LDFLAGS)
 
 libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
 # Build libomp library. Add LLVMSupport dependency if building in-tree with 
libomptarget profiling enabled.
-if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMPTARGET_PROFILING))
   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${CMAKE_DL_LIBS})
@@ -152,8 +144,6 @@ else()
 LINK_LIBS ${LIBOMP_CONFIGURED_LIBFLAGS} ${CMAKE_DL_LIBS}
 LINK_COMPONENTS Support
 )
-  # libomp must be a 

[llvm-branch-commits] [clang] bc2dad1 - [clang][aarch64][WOA64][docs] Release note for longjmp crash with /guard:cf

2021-02-04 Thread Peter Waller via llvm-branch-commits

Author: Peter Waller
Date: 2021-02-04T14:35:14Z
New Revision: bc2dad1671598a87423c61c355d03db49ce76907

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

LOG: [clang][aarch64][WOA64][docs] Release note for longjmp crash with /guard:cf

Add a release note workaround for PR47463.

Bug: https://bugs.llvm.org/show_bug.cgi?id=47463

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

Added: 


Modified: 
clang/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 9efd4c01f053..c17d84de320c 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -153,6 +153,11 @@ Windows Support
 - Implicitly add ``.exe`` suffix for MinGW targets, even when cross compiling.
   (This matches a change from GCC 8.)
 
+- Windows on Arm64: programs using the C standard library's setjmp and longjmp
+  functions may crash with a "Security check failure or stack buffer overrun"
+  exception. To workaround (with reduced security), compile with
+  /guard:cf,nolongjmp.
+
 C Language Changes in Clang
 ---
 



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


[llvm-branch-commits] [openmp] 66c7b44 - [OpenMP] Fix building using LLVM_ENABLE_RUNTIMES

2021-02-04 Thread Shilei Tian via llvm-branch-commits

Author: Giorgis Georgakoudis
Date: 2021-02-04T10:24:40-05:00
New Revision: 66c7b449acf402bdc87b69db5778b7b43958d217

URL: 
https://github.com/llvm/llvm-project/commit/66c7b449acf402bdc87b69db5778b7b43958d217
DIFF: 
https://github.com/llvm/llvm-project/commit/66c7b449acf402bdc87b69db5778b7b43958d217.diff

LOG: [OpenMP] Fix building using LLVM_ENABLE_RUNTIMES

Fix when time profiling is enabled.

Related to: D94855

Reviewed By: JonChesterfield

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

(cherry picked from commit bb40e6731843de92f1c73ad6efceb8a89e045ea6)

Added: 


Modified: 
openmp/CMakeLists.txt
openmp/runtime/src/CMakeLists.txt

Removed: 




diff  --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index 67600bebdafb..f89857dc98d6 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -55,11 +55,6 @@ set(OPENMP_TEST_FLAGS "" CACHE STRING
 set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING
   "OpenMP compiler flag to use for testing OpenMP runtime libraries.")
 
-
-# Build host runtime library.
-add_subdirectory(runtime)
-
-
 set(ENABLE_LIBOMPTARGET ON)
 # Currently libomptarget cannot be compiled on Windows or MacOS X.
 # Since the device plugins are only supported on Linux anyway,
@@ -86,6 +81,11 @@ option(OPENMP_ENABLE_LIBOMPTARGET "Enable building 
libomptarget for offloading."
${ENABLE_LIBOMPTARGET})
 option(OPENMP_ENABLE_LIBOMPTARGET_PROFILING "Enable time profiling for 
libomptarget."
${ENABLE_LIBOMPTARGET})
+
+# Build host runtime library, after LIBOMPTARGET variables are set since they 
are needed
+# to enable time profiling support in the OpenMP runtime.
+add_subdirectory(runtime)
+
 if (OPENMP_ENABLE_LIBOMPTARGET)
   # Check that the library can actually be built.
   if (APPLE OR WIN32)

diff  --git a/openmp/runtime/src/CMakeLists.txt 
b/openmp/runtime/src/CMakeLists.txt
index 2e927df84f5c..9c5dba55b705 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -50,6 +50,15 @@ if(${LIBOMP_USE_HWLOC})
   include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)
 endif()
 
+# Building with time profiling support for libomptarget requires
+# LLVM directory includes.
+if(LIBOMPTARGET_PROFILING_SUPPORT)
+  include_directories(
+${LLVM_MAIN_INCLUDE_DIR}
+${LLVM_INCLUDE_DIR}
+  )
+endif()
+
 # Getting correct source files to build library
 set(LIBOMP_CXXFILES)
 set(LIBOMP_ASMFILES)



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


[llvm-branch-commits] [openmp] 92a5106 - [OpenMP] Disabled profiling in `libomp` by default to unblock link errors

2021-02-04 Thread Shilei Tian via llvm-branch-commits

Author: Shilei Tian
Date: 2021-02-04T10:25:01-05:00
New Revision: 92a5106e8055bab7da46095a83290862728b

URL: 
https://github.com/llvm/llvm-project/commit/92a5106e8055bab7da46095a83290862728b
DIFF: 
https://github.com/llvm/llvm-project/commit/92a5106e8055bab7da46095a83290862728b.diff

LOG: [OpenMP] Disabled profiling in `libomp` by default to unblock link errors

Link error occurred when time profiling in libomp is enabled by default
because `libomp` is assumed to be a C library but the dependence on
`libLLVMSupport` for profiling is a C++ library. Currently the issue blocks all
OpenMP tests in Phabricator.

This patch set a new CMake option `OPENMP_ENABLE_LIBOMP_PROFILING` to
enable/disable the feature. By default it is disabled. Note that once time
profiling is enabled for `libomp`, it becomes a C++ library.

Reviewed By: jdoerfert

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

(cherry picked from commit c571b168349fdf22d1dc8b920bcffa3d5161f0a2)

Added: 


Modified: 
openmp/CMakeLists.txt
openmp/docs/design/Runtimes.rst
openmp/runtime/CMakeLists.txt
openmp/runtime/src/CMakeLists.txt
openmp/runtime/src/kmp_config.h.cmake
openmp/runtime/src/kmp_runtime.cpp

Removed: 




diff  --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index f89857dc98d6..b8a2822877e3 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -81,6 +81,7 @@ option(OPENMP_ENABLE_LIBOMPTARGET "Enable building 
libomptarget for offloading."
${ENABLE_LIBOMPTARGET})
 option(OPENMP_ENABLE_LIBOMPTARGET_PROFILING "Enable time profiling for 
libomptarget."
${ENABLE_LIBOMPTARGET})
+option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF)
 
 # Build host runtime library, after LIBOMPTARGET variables are set since they 
are needed
 # to enable time profiling support in the OpenMP runtime.

diff  --git a/openmp/docs/design/Runtimes.rst b/openmp/docs/design/Runtimes.rst
index 016b88ba324b..ad36e43eccdc 100644
--- a/openmp/docs/design/Runtimes.rst
+++ b/openmp/docs/design/Runtimes.rst
@@ -48,7 +48,10 @@ similar to Clang's ``-ftime-trace`` option. This generates a 
JSON file based on
 `Speedscope App`_. Building this feature depends on the `LLVM Support Library`_
 for time trace output. Using this library is enabled by default when building
 using the CMake option ``OPENMP_ENABLE_LIBOMPTARGET_PROFILING``. The output 
will
-be saved to the filename specified by the environment variable.
+be saved to the filename specified by the environment variable. For 
multi-threaded
+applications, profiling in ``libomp`` is also needed. Setting the CMake option
+``OPENMP_ENABLE_LIBOMP_PROFILING=ON`` to enable the feature. Note that this 
will
+turn ``libomp`` into a C++ library.
 
 .. _`Chrome Tracing`: 
https://www.chromium.org/developers/how-tos/trace-event-profiling-tool
 

diff  --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt
index 9fdd04f41646..8828ff8ef455 100644
--- a/openmp/runtime/CMakeLists.txt
+++ b/openmp/runtime/CMakeLists.txt
@@ -34,7 +34,6 @@ if(${OPENMP_STANDALONE_BUILD})
   # Should assertions be enabled?  They are on by default.
   set(LIBOMP_ENABLE_ASSERTIONS TRUE CACHE BOOL
 "enable assertions?")
-  set(LIBOMPTARGET_PROFILING_SUPPORT FALSE)
 else() # Part of LLVM build
   # Determine the native architecture from LLVM.
   string(TOLOWER "${LLVM_TARGET_ARCH}" LIBOMP_NATIVE_ARCH)
@@ -66,10 +65,11 @@ else() # Part of LLVM build
 libomp_get_architecture(LIBOMP_ARCH)
   endif ()
   set(LIBOMP_ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS})
-  # Time profiling support
-  set(LIBOMPTARGET_PROFILING_SUPPORT ${OPENMP_ENABLE_LIBOMPTARGET_PROFILING})
 endif()
 
+# Time profiling support
+set(LIBOMP_PROFILING_SUPPORT ${OPENMP_ENABLE_LIBOMP_PROFILING})
+
 # FUJITSU A64FX is a special processor because its cache line size is 256.
 # We need to pass this information into kmp_config.h.
 if(LIBOMP_ARCH STREQUAL "aarch64")

diff  --git a/openmp/runtime/src/CMakeLists.txt 
b/openmp/runtime/src/CMakeLists.txt
index 9c5dba55b705..822f9ca2b825 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -50,9 +50,8 @@ if(${LIBOMP_USE_HWLOC})
   include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)
 endif()
 
-# Building with time profiling support for libomptarget requires
-# LLVM directory includes.
-if(LIBOMPTARGET_PROFILING_SUPPORT)
+# Building with time profiling support requires LLVM directory includes.
+if(LIBOMP_PROFILING_SUPPORT)
   include_directories(
 ${LLVM_MAIN_INCLUDE_DIR}
 ${LLVM_INCLUDE_DIR}
@@ -144,7 +143,7 @@ libomp_get_ldflags(LIBOMP_CONFIGURED_LDFLAGS)
 
 libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
 # Build libomp library. Add LLVMSupport dependency if building in-tree with 
libomptarget profiling enabled.
-if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMPTARGET_PROFILING))
+if(OPENMP_STAND