[llvm-branch-commits] [clang] 911756e - [PATCH] Reorganize gtest integration

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: serge-sans-paille
Date: 2022-05-03T10:05:27+02:00
New Revision: 911756e62f00720c3403b62054d815a8ac4dd308

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

LOG: [PATCH] Reorganize gtest integration

Added: 


Modified: 
clang/CMakeLists.txt

Removed: 




diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 594e6d0887429..7d8a2d0a9fceb 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -159,12 +159,6 @@ if(CLANG_BUILT_STANDALONE)
 set(LLVM_UTILS_PROVIDED ON)
 set(CLANG_TEST_DEPS FileCheck count not)
   endif()
-  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
-  AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-  AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} utils/unittest)
-  endif()
 else()
   # Seek installed Lit.
   find_program(LLVM_LIT
@@ -574,7 +568,11 @@ endif()
 
 
 if( CLANG_INCLUDE_TESTS )
-  if(EXISTS 
${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
+  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
+  AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+  AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
+add_subdirectory(${UNITTEST_DIR} utils/unittest)
 add_subdirectory(unittests)
 list(APPEND CLANG_TEST_DEPS ClangUnitTests)
 list(APPEND CLANG_TEST_PARAMS



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] bcc526e - [PATCH] Prefer gcc toolchains with libgcc_s.so when not static linking libgcc

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: serge-sans-paille
Date: 2022-05-03T10:10:07+02:00
New Revision: bcc526e516e00f5cd4427f5977f0baa2e2d393f4

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

LOG: [PATCH] Prefer gcc toolchains with libgcc_s.so when not static linking 
libgcc

Fedora ships cross-compilers on all platforms, so a user could end up
with a gcc x86_64 cross-compiler installed on an x86_64 system. clang
maintains a list of supported triples for each target and when all
else is equal will prefer toolchains with triples that appear earlier
in the list.

The cross-compiler triple on Fedora is x86_64-linux-gnu and this comes
before the Fedora system compiler's triple: x86_64-redhat-linux in
the triples list, so the cross compiler is always preferred. This
is a problem, because the cross compiler is missing libraries, like
libgcc_s.so, that clang expects to be there so linker invocations
will fail.

This patch fixes this by checking for the existence of libgcc_s.so
when it is required and taking that into account when selecting a
toolchain.

Added: 

clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o

clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o

clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so

Modified: 
clang/lib/Driver/ToolChains/Gnu.cpp
clang/lib/Driver/ToolChains/Gnu.h
clang/test/Driver/linux-ld.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Gnu.cpp 
b/clang/lib/Driver/ToolChains/Gnu.cpp
index 0a0d4676ff6f2..e888ff843b8e8 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2643,6 +2643,8 @@ void 
Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
TargetTriple.getVendor() == llvm::Triple::Freescale ||
TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}};
 
+  bool NeedLibgccShared = !Args.hasArg(options::OPT_static_libgcc) &&
+  !Args.hasArg(options::OPT_static);
   for (auto &Suffix : Suffixes) {
 if (!Suffix.Active)
   continue;
@@ -2660,8 +2662,17 @@ void 
Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
   continue; // Saw this path before; no need to look at it again.
   if (CandidateVersion.isOlderThan(4, 1, 1))
 continue;
-  if (CandidateVersion <= Version)
-continue;
+
+  bool CandidateHasLibGccShared = false;
+  if (CandidateVersion <= Version) {
+if (NeedLibgccShared && !HasLibGccShared) {
+  CandidateHasLibGccShared =
+D.getVFS().exists(LI->path() + "/libgcc_s.so");
+
+}
+if (HasLibGccShared || !CandidateHasLibGccShared)
+  continue;
+  }
 
   if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(),
NeedsBiarchSuffix))
@@ -2675,6 +2686,7 @@ void 
Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
   GCCInstallPath = (LibDir + "/" + LibSuffix + "/" + VersionText).str();
   GCCParentLibPath = (GCCInstallPath + "/../" + Suffix.ReversePath).str();
   IsValid = true;
+  HasLibGccShared = CandidateHasLibGccShared;
 }
   }
 }

diff  --git a/clang/lib/Driver/ToolChains/Gnu.h 
b/clang/lib/Driver/ToolChains/Gnu.h
index 4eb7ab0215ab8..d692fb031eb8f 100644
--- a/clang/lib/Driver/ToolChains/Gnu.h
+++ b/clang/lib/Driver/ToolChains/Gnu.h
@@ -190,6 +190,7 @@ class LLVM_LIBRARY_VISIBILITY Generic_GCC : public 
ToolChain {
   /// Driver, and has logic for fuzzing that where appropriate.
   class GCCInstallationDetector {
 bool IsValid;
+bool HasLibGccShared;
 llvm::Triple GCCTriple;
 const Driver &D;
 
@@ -216,7 +217,8 @@ class LLVM_LIBRARY_VISIBILITY Generic_GCC : public 
ToolChain {
 const std::string GentooConfigDir = "/etc/env.d/gcc";
 
   public:
-explicit GCCInstallationDetector(const Driver &D) : IsValid(false), D(D) {}
+explicit GCCInstallationDetector(const Driver &D)
+: IsValid(false), HasLibGccShared(false), D(D) {}
 void init(const llvm::Triple &TargetTriple, const llvm::opt::ArgList &Args,
   ArrayRef ExtraTripleAliases = None);
 

diff  --git 
a/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o
 
b/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o
new file mode 100644
index 0..e69de29bb2d1d

diff  --git 
a/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o
 
b/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o
new file mode 100644
index 0..e69de29bb2d1d

diff  --git 
a/clang/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so
 
b/clang/test

[llvm-branch-commits] [flang] 29a49ed - [PATCH] Disable use of sphinx_markdown_tables

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: Tom Stellard
Date: 2022-05-03T10:10:12+02:00
New Revision: 29a49ed780fcfd34a1fb12fe05ef02af8394b58a

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

LOG: [PATCH] Disable use of sphinx_markdown_tables

Added: 


Modified: 
flang/docs/conf.py

Removed: 




diff  --git a/flang/docs/conf.py b/flang/docs/conf.py
index 7ad291526b697..da72db5a0850f 100644
--- a/flang/docs/conf.py
+++ b/flang/docs/conf.py
@@ -54,7 +54,7 @@ def visit_document(self, node):
   else:
 source_parsers = {'.md': CustomCommonMarkParser}
   source_suffix['.md'] = 'markdown'
-  extensions.append('sphinx_markdown_tables')
+  #extensions.append('sphinx_markdown_tables')
 
   # Setup AutoStructify for inline .rst toctrees in index.md
   from recommonmark.transform import AutoStructify



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] c8a5a0d - [PATCH] Remove monorepo requirement

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: Tom Stellard
Date: 2022-05-03T10:10:12+02:00
New Revision: c8a5a0dfe1d2416b22ba5e2cd8485fa36d91ddf7

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

LOG: [PATCH] Remove monorepo requirement

Added: 


Modified: 
libcxx/CMakeLists.txt

Removed: 




diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 9ad93a39b43f3..7b0ba82b15e80 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -1,10 +1,3 @@
-# See https://libcxx.llvm.org/docs/BuildingLibcxx.html for instructions on how
-# to build libcxx with CMake.
-
-if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../libcxxabi")
-  message(FATAL_ERROR "libc++ now requires being built in a monorepo layout 
with libcxxabi available")
-endif()
-
 
#===
 # Setup Project
 
#===



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxxabi] 9a1c187 - [PATCH] Remove monorepo requirement

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: Tom Stellard
Date: 2022-05-03T10:10:12+02:00
New Revision: 9a1c187a0823bcc0c119e1ed12ab1d71d52056b1

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

LOG: [PATCH] Remove monorepo requirement

Added: 


Modified: 
libcxxabi/CMakeLists.txt

Removed: 




diff  --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 8d583df2ef78a..08eb27ab99a09 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -1,9 +1,5 @@
 # See www/CMake.html for instructions on how to build libcxxabi with CMake.
 
-if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../libcxx")
-  message(FATAL_ERROR "libc++abi now requires being built in a monorepo layout 
with libcxx available")
-endif()
-
 
#===
 # Setup Project
 
#===



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] 5ea33d0 - [PATCH] CMake: Check for gtest headers even if lit.py is not present

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: Tom Stellard
Date: 2022-05-03T10:10:13+02:00
New Revision: 5ea33d0fd269cf90a8d3c69eeb0ac57ab5d8a790

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

LOG: [PATCH] CMake: Check for gtest headers even if lit.py is not present

This makes it possible to build the unittests even withotu a full
checkout of the llvm source tree.

Added: 


Modified: 
lld/CMakeLists.txt

Removed: 




diff  --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index f51c864af8375..f98d45b59b199 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -108,6 +108,15 @@ if(LLD_BUILT_STANDALONE)
   set(LLVM_UTILS_PROVIDED ON)
 endif()
 
+   # Check for gtest
+set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
+AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
+  add_subdirectory(${UNITTEST_DIR} utils/unittest)
+endif()
+
+   # Check for lit
 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   # Note: path not really used, except for checking if lit was found
   set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
@@ -117,12 +126,6 @@ if(LLD_BUILT_STANDALONE)
 set(LLVM_UTILS_PROVIDED ON)
 set(LLD_TEST_DEPS FileCheck not)
   endif()
-  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
-  AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-  AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} utils/unittest)
-  endif()
 else()
   # Seek installed Lit.
   find_program(LLVM_LIT



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] bddd410 - [PATCH] Portable asm/ptrace.h include

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: serge-sans-paille
Date: 2022-05-03T10:10:13+02:00
New Revision: bddd41020a71e79a69e470c527214c688dab6314

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

LOG: [PATCH] Portable asm/ptrace.h include

Added: 


Modified: 
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h 
b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
index 14f669a3ce98f..6e3a0d1e94d44 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
@@ -16,7 +16,8 @@
 #include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
 #include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
 
-#include 
+#include 
+#include 
 
 namespace lldb_private {
 namespace process_linux {



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 26e4d61 - [PATCH] ToolChain: Add -lgcc_s to the linker flags when using libc++

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: serge-sans-paille
Date: 2022-05-03T10:05:28+02:00
New Revision: 26e4d61303313930e5f37dfd62a10406eb8133bd

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

LOG: [PATCH] ToolChain: Add -lgcc_s to the linker flags when using libc++

The libc++ build for Fedora does not include an implementation of
libunwind, so we need to explicitly link against something that
provides this implementation.

Added: 


Modified: 
clang/lib/Driver/ToolChain.cpp
clang/test/Driver/netbsd.cpp

Removed: 




diff  --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index d45a90048dcbe..991ad560d1519 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -968,6 +968,7 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
   switch (Type) {
   case ToolChain::CST_Libcxx:
 CmdArgs.push_back("-lc++");
+CmdArgs.push_back("-lgcc_s");
 break;
 
   case ToolChain::CST_Libstdcxx:

diff  --git a/clang/test/Driver/netbsd.cpp b/clang/test/Driver/netbsd.cpp
index 4af7d8373d672..ff18c627f5605 100644
--- a/clang/test/Driver/netbsd.cpp
+++ b/clang/test/Driver/netbsd.cpp
@@ -131,7 +131,7 @@
 // ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi"
 // ARM-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
 // ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|}}crt0.o" 
"{{.*}}/usr/lib{{/|}}eabi{{/|}}crti.o"
-// ARM-7: "{{.*}}/usr/lib{{/|}}crtbegin.o" "{{.*}}.o" "-lc++" "-lm" "-lc"
+// ARM-7: "{{.*}}/usr/lib{{/|}}crtbegin.o" "{{.*}}.o" "-lc++" "-lgcc_s" 
"-lm" "-lc"
 // ARM-7: "{{.*}}/usr/lib{{/|}}crtend.o" "{{.*}}/usr/lib{{/|}}crtn.o"
 
 // AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd"
@@ -250,7 +250,7 @@
 // S-ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi"
 // S-ARM-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|}}crt0.o" 
"{{.*}}/usr/lib{{/|}}eabi{{/|}}crti.o"
-// S-ARM-7: "{{.*}}/usr/lib{{/|}}crtbegin.o" "{{.*}}.o" "-lc++" "-lm" "-lc"
+// S-ARM-7: "{{.*}}/usr/lib{{/|}}crtbegin.o" "{{.*}}.o" "-lc++" "-lgcc_s" 
"-lm" "-lc"
 // S-ARM-7: "{{.*}}/usr/lib{{/|}}crtend.o" "{{.*}}/usr/lib{{/|}}crtn.o"
 
 // S-AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd"



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] cb8e6e7 - [PATCH] Make -funwind-tables the default on all archs

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: serge-sans-paille
Date: 2022-05-03T10:05:28+02:00
New Revision: cb8e6e7bde2ea74d07a3307cc089270d7283ebfe

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

LOG: [PATCH] Make -funwind-tables the default on all archs

Added: 


Modified: 
clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains/Gnu.cpp

Removed: 




diff  --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index 991ad560d1519..0926e6846cb22 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -259,7 +259,7 @@ std::string ToolChain::getInputFilename(const InputInfo 
&Input) const {
 }
 
 bool ToolChain::IsUnwindTablesDefault(const ArgList &Args) const {
-  return false;
+  return true;
 }
 
 Tool *ToolChain::getClang() const {

diff  --git a/clang/lib/Driver/ToolChains/Gnu.cpp 
b/clang/lib/Driver/ToolChains/Gnu.cpp
index 183828dcaa734..0a0d4676ff6f2 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2818,7 +2818,7 @@ bool Generic_GCC::IsUnwindTablesDefault(const ArgList 
&Args) const {
   case llvm::Triple::x86_64:
 return true;
   default:
-return false;
+return true;
   }
 }
 



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] ba26d24 - [PATCH] CMake: Make LIBOMP_HEADERS_INSTALL_PATH a cache variable when bulding standalone

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: Tom Stellard
Date: 2022-05-03T10:10:13+02:00
New Revision: ba26d248aa9280016d34259413df9c37b76f7819

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

LOG: [PATCH] CMake: Make LIBOMP_HEADERS_INSTALL_PATH a cache variable when 
bulding standalone

This way it can be overriden on the command line.

Added: 


Modified: 
openmp/runtime/src/CMakeLists.txt

Removed: 




diff  --git a/openmp/runtime/src/CMakeLists.txt 
b/openmp/runtime/src/CMakeLists.txt
index 4068a5862b4a3..6125f8dca7673 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -350,7 +350,7 @@ add_dependencies(libomp-micro-tests libomp-test-deps)
 # We want to install libomp in DESTDIR/CMAKE_INSTALL_PREFIX/lib
 # We want to install headers in DESTDIR/CMAKE_INSTALL_PREFIX/include
 if(${OPENMP_STANDALONE_BUILD})
-  set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}")
+  set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}" CACHE PATH 
"Install path for OpenMP headers")
 else()
   string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION 
${PACKAGE_VERSION})
   set(LIBOMP_HEADERS_INSTALL_PATH 
"${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include")



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 71f281e - [PATCH] Don't install static libraries

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: Tom Stellard
Date: 2022-05-03T10:05:28+02:00
New Revision: 71f281ee2bbdeb12bf8cd9e435edc824e24a05e4

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

LOG: [PATCH] Don't install static libraries

Added: 


Modified: 
clang/cmake/modules/AddClang.cmake

Removed: 




diff  --git a/clang/cmake/modules/AddClang.cmake 
b/clang/cmake/modules/AddClang.cmake
index 9bbbfc032b7df..dd611c0cf164d 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -114,7 +114,7 @@ macro(add_clang_library name)
 if(TARGET ${lib})
   target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS})
 
-  if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
+  if (ARG_SHARED AND (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR 
ARG_INSTALL_WITH_TOOLCHAIN))
 get_target_export_arg(${name} Clang export_to_clangtargets UMBRELLA 
clang-libraries)
 install(TARGETS ${lib}
   COMPONENT ${lib}



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [polly] bb2b2a3 - [PATCH] Portability of subproject extension

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: serge-sans-paille
Date: 2022-05-03T10:10:13+02:00
New Revision: bb2b2a3fc2695539d40bf41824cc86a364064dd0

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

LOG: [PATCH] Portability of subproject extension

Added: 


Modified: 
polly/lib/CMakeLists.txt

Removed: 




diff  --git a/polly/lib/CMakeLists.txt b/polly/lib/CMakeLists.txt
index c6c1a18e90046..ed0f7aaf38b1f 100644
--- a/polly/lib/CMakeLists.txt
+++ b/polly/lib/CMakeLists.txt
@@ -53,7 +53,6 @@ endif ()
 # the sources them to be recompiled for each of them.
 add_llvm_pass_plugin(Polly
   NO_MODULE
-  SUBPROJECT Polly
   Analysis/DependenceInfo.cpp
   Analysis/PolyhedralInfo.cpp
   Analysis/ScopDetection.cpp



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] e9e80a6 - [PATCH] Import compact_unwind_encoding.h from libunwind

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: serge-sans-paille
Date: 2022-05-03T10:10:13+02:00
New Revision: e9e80a636ee4e52959899f6be4f136e127db1c83

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

LOG: [PATCH] Import compact_unwind_encoding.h from libunwind

This avoids an implicit cross package dependency

Added: 
lld/include/mach-o/compact_unwind_encoding.h

Modified: 


Removed: 




diff  --git a/lld/include/mach-o/compact_unwind_encoding.h 
b/lld/include/mach-o/compact_unwind_encoding.h
new file mode 100644
index 0..5301b1055ef93
--- /dev/null
+++ b/lld/include/mach-o/compact_unwind_encoding.h
@@ -0,0 +1,477 @@
+//===-- mach-o/compact_unwind_encoding.h 
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//
+// Darwin's alternative to DWARF based unwind encodings.
+//
+//===--===//
+
+
+#ifndef __COMPACT_UNWIND_ENCODING__
+#define __COMPACT_UNWIND_ENCODING__
+
+#include 
+
+//
+// Compilers can emit standard DWARF FDEs in the __TEXT,__eh_frame section
+// of object files. Or compilers can emit compact unwind information in
+// the __LD,__compact_unwind section.
+//
+// When the linker creates a final linked image, it will create a
+// __TEXT,__unwind_info section.  This section is a small and fast way for the
+// runtime to access unwind info for any given function.  If the compiler
+// emitted compact unwind info for the function, that compact unwind info will
+// be encoded in the __TEXT,__unwind_info section. If the compiler emitted
+// DWARF unwind info, the __TEXT,__unwind_info section will contain the offset
+// of the FDE in the __TEXT,__eh_frame section in the final linked image.
+//
+// Note: Previously, the linker would transform some DWARF unwind infos into
+//   compact unwind info.  But that is fragile and no longer done.
+
+
+//
+// The compact unwind endoding is a 32-bit value which encoded in an
+// architecture specific way, which registers to restore from where, and how
+// to unwind out of the function.
+//
+typedef uint32_t compact_unwind_encoding_t;
+
+
+// architecture independent bits
+enum {
+UNWIND_IS_NOT_FUNCTION_START   = 0x8000,
+UNWIND_HAS_LSDA= 0x4000,
+UNWIND_PERSONALITY_MASK= 0x3000,
+};
+
+
+
+
+//
+// x86
+//
+// 1-bit: start
+// 1-bit: has lsda
+// 2-bit: personality index
+//
+// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=DWARF
+//  ebp based:
+//15-bits (5*3-bits per reg) register permutation
+//8-bits for stack offset
+//  frameless:
+//8-bits stack size
+//3-bits stack adjust
+//3-bits register count
+//10-bits register permutation
+//
+enum {
+UNWIND_X86_MODE_MASK = 0x0F00,
+UNWIND_X86_MODE_EBP_FRAME= 0x0100,
+UNWIND_X86_MODE_STACK_IMMD   = 0x0200,
+UNWIND_X86_MODE_STACK_IND= 0x0300,
+UNWIND_X86_MODE_DWARF= 0x0400,
+
+UNWIND_X86_EBP_FRAME_REGISTERS   = 0x7FFF,
+UNWIND_X86_EBP_FRAME_OFFSET  = 0x00FF,
+
+UNWIND_X86_FRAMELESS_STACK_SIZE  = 0x00FF,
+UNWIND_X86_FRAMELESS_STACK_ADJUST= 0xE000,
+UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x1C00,
+UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION   = 0x03FF,
+
+UNWIND_X86_DWARF_SECTION_OFFSET  = 0x00FF,
+};
+
+enum {
+UNWIND_X86_REG_NONE = 0,
+UNWIND_X86_REG_EBX  = 1,
+UNWIND_X86_REG_ECX  = 2,
+UNWIND_X86_REG_EDX  = 3,
+UNWIND_X86_REG_EDI  = 4,
+UNWIND_X86_REG_ESI  = 5,
+UNWIND_X86_REG_EBP  = 6,
+};
+
+//
+// For x86 there are four modes for the compact unwind encoding:
+// UNWIND_X86_MODE_EBP_FRAME:
+//EBP based frame where EBP is push on stack immediately after return 
address,
+//then ESP is moved to EBP. Thus, to unwind ESP is restored with the 
current
+//EPB value, then EBP is restored by popping off the stack, and the return
+//is done by popping the stack once more into the pc.
+//All non-volatile registers that need to be restored must have been saved
+//in a small range in the stack that starts EBP-4 to EBP-1020.  The 
offset/4
+//is encoded in the UNWIND_X86_EBP_FRAME_OFFSET bits.  The registers saved
+//are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit 
entries.
+//Each entry contains which register to restore.
+// UNWIND_X86_MODE_STACK_

[llvm-branch-commits] [llvm] 13cbdad - [PATCH] Make source-interleave-prefix test case compatible with llvm-test

2022-05-03 Thread Nikita Popov via llvm-branch-commits

Author: Konrad Kleine
Date: 2022-05-03T10:10:13+02:00
New Revision: 13cbdadf32c5bba647136f51a2fd7ce4d0488bde

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

LOG: [PATCH] Make source-interleave-prefix test case compatible with llvm-test

llvm-test runs test from a directory that's not the upstream one, and that leads
to some false positive. Workaround this by forcing the current working
directory.

Added: 


Modified: 
llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test

Removed: 




diff  --git a/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test 
b/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
index 746add22f96e5..8b28b877e3724 100644
--- a/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
+++ b/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
@@ -11,7 +11,7 @@
 
 ; RUN: sed -e "s,SRC_COMPDIR,./Inputs,g" %p/Inputs/source-interleave.ll > 
%t-relative-path.ll
 ; RUN: llc -o %t-relative-path.o -filetype=obj -mtriple=x86_64-pc-linux 
%t-relative-path.ll
-; RUN: llvm-objdump --prefix myprefix --source %t-relative-path.o 2>&1 | \
+; RUN: mkdir -p %t0 && cd %t0 && llvm-objdump --prefix myprefix --source 
%t-relative-path.o 2>&1 | \
 ; RUN:   FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX 
-DFILE=%t-relative-path.o -DPREFIX=. -DCOMPDIR=/Inputs
 ; CHECK-BROKEN-PREFIX: warning: '[[FILE]]': failed to find source 
[[PREFIX]][[COMPDIR]]{{[/\\]}}source-interleave-x86_64.c
 



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits