[clang-tools-extra] r339307 - [CMake] Use normalized Windows target triples

2018-08-08 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Aug  8 19:16:18 2018
New Revision: 339307

URL: http://llvm.org/viewvc/llvm-project?rev=339307&view=rev
Log:
[CMake] Use normalized Windows target triples

Changes the default Windows target triple returned by
GetHostTriple.cmake from the old environment names (which we wanted to
move away from) to newer, normalized ones. This also requires updating
all tests to use the new systems names in constraints.

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

Modified:
clang-tools-extra/trunk/test/clangd/did-change-configuration-params.test
clang-tools-extra/trunk/test/clangd/test-uri-posix.test
clang-tools-extra/trunk/test/clangd/test-uri-windows.test

Modified: 
clang-tools-extra/trunk/test/clangd/did-change-configuration-params.test
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clangd/did-change-configuration-params.test?rev=339307&r1=339306&r2=339307&view=diff
==
--- clang-tools-extra/trunk/test/clangd/did-change-configuration-params.test 
(original)
+++ clang-tools-extra/trunk/test/clangd/did-change-configuration-params.test 
Wed Aug  8 19:16:18 2018
@@ -1,6 +1,6 @@
 # RUN: clangd -compile_args_from=lsp -lit-test < %s 2> %t | FileCheck 
-strict-whitespace %s
 # RUN: cat %t | FileCheck --check-prefix=ERR %s
-# UNSUPPORTED: mingw32,win32
+# UNSUPPORTED: windows-gnu,windows-msvc
 
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
 ---
 
{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"compilationDatabaseChanges":{"/clangd-test/foo.c":
 {"workingDirectory":"/clangd-test", "compilationCommand": ["clang", "-c", 
"foo.c"]}

Modified: clang-tools-extra/trunk/test/clangd/test-uri-posix.test
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clangd/test-uri-posix.test?rev=339307&r1=339306&r2=339307&view=diff
==
--- clang-tools-extra/trunk/test/clangd/test-uri-posix.test (original)
+++ clang-tools-extra/trunk/test/clangd/test-uri-posix.test Wed Aug  8 19:16:18 
2018
@@ -1,5 +1,5 @@
 # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
-# UNSUPPORTED: mingw32,win32
+# UNSUPPORTED: windows-gnu,windows-msvc
 # Test authority-less URI
 
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
 ---

Modified: clang-tools-extra/trunk/test/clangd/test-uri-windows.test
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clangd/test-uri-windows.test?rev=339307&r1=339306&r2=339307&view=diff
==
--- clang-tools-extra/trunk/test/clangd/test-uri-windows.test (original)
+++ clang-tools-extra/trunk/test/clangd/test-uri-windows.test Wed Aug  8 
19:16:18 2018
@@ -1,5 +1,5 @@
 # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
-# REQUIRES: mingw32 || win32
+# REQUIRES: windows-gnu || windows-msvc
 # Test authority-less URI
 
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
 ---


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


r339307 - [CMake] Use normalized Windows target triples

2018-08-08 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Aug  8 19:16:18 2018
New Revision: 339307

URL: http://llvm.org/viewvc/llvm-project?rev=339307&view=rev
Log:
[CMake] Use normalized Windows target triples

Changes the default Windows target triple returned by
GetHostTriple.cmake from the old environment names (which we wanted to
move away from) to newer, normalized ones. This also requires updating
all tests to use the new systems names in constraints.

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

Modified:
cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c
cfe/trunk/test/CodeGenCXX/vtable-debug-info.cpp
cfe/trunk/test/Driver/coverage_no_integrated_as.c
cfe/trunk/test/Driver/crash-report-null.test
cfe/trunk/test/Driver/inhibit-downstream-commands.c
cfe/trunk/test/Driver/linker-opts.c
cfe/trunk/test/Driver/no-integrated-as.s
cfe/trunk/test/Lexer/cross-windows-on-linux.cpp
cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m
cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m
cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m
cfe/trunk/test/Modules/crash-vfs-path-traversal.m
cfe/trunk/test/Modules/crash-vfs-relative-overlay.m
cfe/trunk/test/Modules/crash-vfs-umbrella-frameworks.m
cfe/trunk/test/SemaTemplate/instantiation-depth-default.cpp
cfe/trunk/test/VFS/umbrella-framework-import-skipnonexist.m
cfe/trunk/test/lit.cfg.py

Modified: cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c?rev=339307&r1=339306&r2=339307&view=diff
==
--- cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c (original)
+++ cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c Wed Aug  8 19:16:18 
2018
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 %s -o - -emit-llvm | FileCheck %s
-// XFAIL: aarch64, arm64, x86_64-pc-win32, x86_64-w64-mingw32, 
x86_64-pc-windows-gnu
+// XFAIL: aarch64, arm64, x86_64-pc-windows-msvc, x86_64-w64-windows-gnu, 
x86_64-pc-windows-gnu
 
 // PR1513
 

Modified: cfe/trunk/test/CodeGenCXX/vtable-debug-info.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-debug-info.cpp?rev=339307&r1=339306&r2=339307&view=diff
==
--- cfe/trunk/test/CodeGenCXX/vtable-debug-info.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-debug-info.cpp Wed Aug  8 19:16:18 2018
@@ -1,6 +1,6 @@
 // RUN: %clang -emit-llvm -S -g %s -o /dev/null
 // Radar 8730409
-// XFAIL: win32
+// XFAIL: windows-msvc
 
 // FIXME: This test crashes on *-pc-win32
 // for lack of debugging support on -integrated-as (MCCOFF).

Modified: cfe/trunk/test/Driver/coverage_no_integrated_as.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/coverage_no_integrated_as.c?rev=339307&r1=339306&r2=339307&view=diff
==
--- cfe/trunk/test/Driver/coverage_no_integrated_as.c (original)
+++ cfe/trunk/test/Driver/coverage_no_integrated_as.c Wed Aug  8 19:16:18 2018
@@ -1,5 +1,5 @@
 // REQUIRES: clang-driver
-// XFAIL: win32,win64
+// XFAIL: windows-msvc
 
 // RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck 
-check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
 // RUN: %clang -### -S -fprofile-arcs -no-integrated-as %s 2>&1 | FileCheck 
-check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s

Modified: cfe/trunk/test/Driver/crash-report-null.test
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/crash-report-null.test?rev=339307&r1=339306&r2=339307&view=diff
==
--- cfe/trunk/test/Driver/crash-report-null.test (original)
+++ cfe/trunk/test/Driver/crash-report-null.test Wed Aug  8 19:16:18 2018
@@ -1,7 +1,7 @@
 // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH=1 %clang -fsyntax-only -x c 
/dev/null -lstdc++ 2>&1 | FileCheck %s
 
 // FIXME: Investigating. "fatal error: file 'nul' modified since it was first 
processed"
-// XFAIL: mingw32
+// XFAIL: windows-gnu
 
 // CHECK: Preprocessed source(s) and associated run script(s) are located at:
 // CHECK-NEXT: note: diagnostic msg: {{.*}}null-{{.*}}.c

Modified: cfe/trunk/test/Driver/inhibit-downstream-commands.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/inhibit-downstream-commands.c?rev=339307&r1=339306&r2=339307&view=diff
==
--- cfe/trunk/test/Driver/inhibit-downstream-commands.c (original)
+++ cfe/trunk/test/Driver/inhibit-downstream-commands.c Wed Aug  8 19:16:18 2018
@@ -2,5 +2,5 @@
 // CHECK: error: unknown type name 'invalid'
 // CHECK-NOT: clang: error: assembler command failed 
 // CHECK-NOT: clang: error: linker command failed
-// XFAIL: win32
+// XFAIL: windows-msvc
 invalid C code!

Modified: cfe/trunk/test/Driver/linker-opts.c
U

r339834 - [Driver] -print-target-triple and -print-effective-triple options

2018-08-15 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Aug 15 17:22:03 2018
New Revision: 339834

URL: http://llvm.org/viewvc/llvm-project?rev=339834&view=rev
Log:
[Driver] -print-target-triple and -print-effective-triple options

These can be used to print Clang target and effective triple.

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

Added:
cfe/trunk/test/Driver/print-effective-triple.c
cfe/trunk/test/Driver/print-target-triple.c
Modified:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=339834&r1=339833&r2=339834&view=diff
==
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Wed Aug 15 17:22:03 2018
@@ -2348,6 +2348,10 @@ def print_multi_directory : Flag<["-", "
 def print_multi_lib : Flag<["-", "--"], "print-multi-lib">;
 def print_multi_os_directory : Flag<["-", "--"], "print-multi-os-directory">,
   Flags<[Unsupported]>;
+def print_target_triple : Flag<["-", "--"], "print-target-triple">,
+  HelpText<"Print the normalized target triple">;
+def print_effective_triple : Flag<["-", "--"], "print-effective-triple">,
+  HelpText<"Print the effective target triple">;
 def print_prog_name_EQ : Joined<["-", "--"], "print-prog-name=">,
   HelpText<"Print the full program path of ">, MetaVarName<"">;
 def print_resource_dir : Flag<["-", "--"], "print-resource-dir">,

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=339834&r1=339833&r2=339834&view=diff
==
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Wed Aug 15 17:22:03 2018
@@ -1672,6 +1672,18 @@ bool Driver::HandleImmediateArgs(const C
 }
 return false;
   }
+
+  if (C.getArgs().hasArg(options::OPT_print_target_triple)) {
+llvm::outs() << TC.getTripleString() << "\n";
+return false;
+  }
+
+  if (C.getArgs().hasArg(options::OPT_print_effective_triple)) {
+const llvm::Triple Triple(TC.ComputeEffectiveClangTriple(C.getArgs()));
+llvm::outs() << Triple.getTriple() << "\n";
+return false;
+  }
+
   return true;
 }
 

Added: cfe/trunk/test/Driver/print-effective-triple.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/print-effective-triple.c?rev=339834&view=auto
==
--- cfe/trunk/test/Driver/print-effective-triple.c (added)
+++ cfe/trunk/test/Driver/print-effective-triple.c Wed Aug 15 17:22:03 2018
@@ -0,0 +1,6 @@
+// Test that -print-target-triple prints correct triple.
+
+// RUN: %clang -print-effective-triple 2>&1 \
+// RUN: --target=thumb-linux-gnu \
+// RUN:   | FileCheck %s
+// CHECK: armv4t-unknown-linux-gnu

Added: cfe/trunk/test/Driver/print-target-triple.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/print-target-triple.c?rev=339834&view=auto
==
--- cfe/trunk/test/Driver/print-target-triple.c (added)
+++ cfe/trunk/test/Driver/print-target-triple.c Wed Aug 15 17:22:03 2018
@@ -0,0 +1,6 @@
+// Test that -print-target-triple prints correct triple.
+
+// RUN: %clang -print-target-triple 2>&1 \
+// RUN: --target=x86_64-linux-gnu \
+// RUN:   | FileCheck %s
+// CHECK: x86_64-unknown-linux-gnu


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


r340471 - [Driver] Check normalized triples for multiarch runtime path

2018-08-22 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Aug 22 15:56:46 2018
New Revision: 340471

URL: http://llvm.org/viewvc/llvm-project?rev=340471&view=rev
Log:
[Driver] Check normalized triples for multiarch runtime path

Previously we only used target triple as provided which matches the
GCC behavior, but it also means that all clients have to be consistent
in their spelling of target triples since e.g. x86_64-linux-gnu and
x86_64-unknown-linux-gnu will result in Clang driver looking at two
different paths when searching for runtime libraries.

Unfortunatelly, as it turned out many clients aren't consistent in
their spelling of target triples, e.g. many Linux distributions use
the shorter spelling but config.guess and rustc insist on using the
normalized variant which is causing issues. To avoid having to ship
multiple copies of runtimes for different triple spelling or rely on
symlinks which are not portable, we should also check the normalized
triple when constructing paths for multiarch runtimes.

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

Added:

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan-preinit.a

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan.so

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.builtins.a

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.fuzzer.a

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.scudo.so

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/i386-linux-gnu/lib/libclang_rt.builtins.a

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan-preinit.a

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan.so

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.builtins.a

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.fuzzer.a

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.scudo.so

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-linux-gnu/lib/libclang_rt.builtins.a
Modified:
cfe/trunk/include/clang/Driver/ToolChain.h
cfe/trunk/lib/Driver/ToolChain.cpp

Modified: cfe/trunk/include/clang/Driver/ToolChain.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=340471&r1=340470&r2=340471&view=diff
==
--- cfe/trunk/include/clang/Driver/ToolChain.h (original)
+++ cfe/trunk/include/clang/Driver/ToolChain.h Wed Aug 22 15:56:46 2018
@@ -116,6 +116,9 @@ private:
 
   const RTTIMode CachedRTTIMode;
 
+  /// The list of toolchain specific path prefixes to search for libraries.
+  path_list LibraryPaths;
+
   /// The list of toolchain specific path prefixes to search for files.
   path_list FilePaths;
 
@@ -213,6 +216,9 @@ public:
 return EffectiveTriple;
   }
 
+  path_list &getLibraryPaths() { return LibraryPaths; }
+  const path_list &getLibraryPaths() const { return LibraryPaths; }
+
   path_list &getFilePaths() { return FilePaths; }
   const path_list &getFilePaths() const { return FilePaths; }
 

Modified: cfe/trunk/lib/Driver/ToolChain.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=340471&r1=340470&r2=340471&view=diff
==
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChain.cpp Wed Aug 22 15:56:46 2018
@@ -74,10 +74,17 @@ ToolChain::ToolChain(const Driver &D, co
  const ArgList &Args)
 : D(D), Triple(T), Args(Args), CachedRTTIArg(GetRTTIArgument(Args)),
   CachedRTTIMode(CalculateRTTIMode(Args, Triple, CachedRTTIArg)) {
-  SmallString<128> P(D.ResourceDir);
+  SmallString<128> P;
+
+  P.assign(D.ResourceDir);
   llvm::sys::path::append(P, D.getTargetTriple(), "lib");
   if (getVFS().exists(P))
-getFilePaths().push_back(P.str());
+getLibraryPaths().push_back(P.str());
+
+  P.assign(D.ResourceDir);
+  llvm::sys::path::append(P, Triple.str(), "lib");
+  if (getVFS().exists(P))
+getLibraryPaths().push_back(P.str());
 
   std::string CandidateLibPath = getArchSpecificLibPath();
   if (getVFS().exists(CandidateLibPath))
@@ -362,12 +369,11 @@ std::string ToolChain::getCompilerRT(con
   const char *Suffix = Shared ? (Triple.isOSWindows() ? ".dll" : ".so")
   : (IsITANMSVCWindows ? ".lib" : ".a");
 
-  const Driver &D = getDriver();
-  SmallString<128> P(D.ResourceDir);
-  llvm::sys::path::append(P, D.getTargetTriple(), "lib");
-  if (getVFS().exists(P)) {
+  for (const auto &LibPath : getLibraryPath

r331826 - [CMake] Include llvm-strip in Fuchsia toolchain distribution

2018-05-08 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue May  8 17:05:28 2018
New Revision: 331826

URL: http://llvm.org/viewvc/llvm-project?rev=331826&view=rev
Log:
[CMake] Include llvm-strip in Fuchsia toolchain distribution

Now that llvm-strip is available, include it in the Fuchsia toolchain.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=331826&r1=331825&r2=331826&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue May  8 17:05:28 2018
@@ -108,6 +108,7 @@ set(LLVM_TOOLCHAIN_TOOLS
   llvm-readelf
   llvm-readobj
   llvm-size
+  llvm-strip
   llvm-symbolizer
   opt
   sancov


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


r331833 - Set CMAKE_BUILD_WITH_INSTALL_RPATH for Fuchsia runtimes

2018-05-08 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue May  8 17:58:12 2018
New Revision: 331833

URL: http://llvm.org/viewvc/llvm-project?rev=331833&view=rev
Log:
Set CMAKE_BUILD_WITH_INSTALL_RPATH for Fuchsia runtimes

This doesn't make any difference since we don't use RPATH/RUNPATH
on Fuchsia but it avoids the CMake error when re-linking libraries
while building with Ninja.

Differntial Revision: https://reviews.llvm.org/D46610

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=331833&r1=331832&r2=331833&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue May  8 17:58:12 2018
@@ -67,6 +67,7 @@ endif()
 foreach(target x86_64;aarch64)
   set(RUNTIMES_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
   set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_TYPE 
${FUCHSIA_RUNTIMES_BUILD_TYPE} CACHE STRING "")
+  set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE 
STRING "")
   set(RUNTIMES_${target}-fuchsia_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_C_FLAGS} 
CACHE PATH "")
   set(RUNTIMES_${target}-fuchsia_CMAKE_C_FLAGS ${FUCHSIA_${target}_C_FLAGS} 
CACHE PATH "")
   set(RUNTIMES_${target}-fuchsia_CMAKE_CXX_FLAGS 
${FUCHSIA_${target}_CXX_FLAGS} CACHE PATH "")


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


r332138 - [Driver] Only use -lc++ on Fuchsia

2018-05-11 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri May 11 13:42:31 2018
New Revision: 332138

URL: http://llvm.org/viewvc/llvm-project?rev=332138&view=rev
Log:
[Driver] Only use -lc++ on Fuchsia

The fact that libc++ depends on libc++abi and libunwind is an internal
detail that's captured by the libc++.so linker script.

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

Modified:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/test/Driver/fuchsia.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=332138&r1=332137&r2=332138&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Fri May 11 13:42:31 2018
@@ -267,8 +267,6 @@ void Fuchsia::AddCXXStdlibLibArgs(const
   switch (GetCXXStdlibType(Args)) {
   case ToolChain::CST_Libcxx:
 CmdArgs.push_back("-lc++");
-CmdArgs.push_back("-lc++abi");
-CmdArgs.push_back("-lunwind");
 break;
 
   case ToolChain::CST_Libstdcxx:

Modified: cfe/trunk/test/Driver/fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.cpp?rev=332138&r1=332137&r2=332138&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.cpp (original)
+++ cfe/trunk/test/Driver/fuchsia.cpp Fri May 11 13:42:31 2018
@@ -15,7 +15,7 @@
 // CHECK-NOT: crti.o
 // CHECK-NOT: crtbegin.o
 // CHECK: "-L[[SYSROOT]]{{/|}}lib"
-// CHECK: "-lc++" "-lc++abi" "-lunwind" "-lm"
+// CHECK: "-lc++" "-lm"
 // CHECK: "{{.*[/\\]}}libclang_rt.builtins-x86_64.a"
 // CHECK: "-lc"
 // CHECK-NOT: crtend.o
@@ -28,7 +28,7 @@
 // RUN: %clangxx %s -### --target=x86_64-unknown-fuchsia -static-libstdc++ 
2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-STATIC
 // CHECK-STATIC-NOT: "-Bstatic"
-// CHECK-STATIC: "-lc++" "-lc++abi" "-lunwind"
+// CHECK-STATIC: "-lc++"
 // CHECK-STATIC-NOT: "-Bdynamic"
 // CHECK-STATIC: "-lm"
 // CHECK-STATIC: "-lc"


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


r332750 - [Support] Avoid normalization in sys::getDefaultTargetTriple

2018-05-18 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri May 18 11:33:07 2018
New Revision: 332750

URL: http://llvm.org/viewvc/llvm-project?rev=332750&view=rev
Log:
[Support] Avoid normalization in sys::getDefaultTargetTriple

The return value of sys::getDefaultTargetTriple, which is derived from
-DLLVM_DEFAULT_TRIPLE, is used to construct tool names, default target,
and in the future also to control the search path directly; as such it
should be used textually, without interpretation by LLVM.

Normalization of this value may lead to unexpected results, for example
if we configure LLVM with -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnu,
normalization will transform that value to x86_64--linux-gnu. Driver will
use that value to search for tools prefixed with x86_64--linux-gnu- which
may be confusing. This is also inconsistent with the behavior of the
--target flag which is taken as-is without any normalization and overrides
the value of LLVM_DEFAULT_TARGET_TRIPLE.

Users of sys::getDefaultTargetTriple already perform their own
normalization as needed, so this change shouldn't impact existing logic.

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

Modified:
cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=332750&r1=332749&r2=332750&view=diff
==
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri May 18 11:33:07 2018
@@ -2927,10 +2927,11 @@ static void ParseTargetArgs(TargetOption
   Opts.FPMath = Args.getLastArgValue(OPT_mfpmath);
   Opts.FeaturesAsWritten = Args.getAllArgValues(OPT_target_feature);
   Opts.LinkerVersion = Args.getLastArgValue(OPT_target_linker_version);
-  Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple));
+  Opts.Triple = Args.getLastArgValue(OPT_triple);
   // Use the default target triple if unspecified.
   if (Opts.Triple.empty())
 Opts.Triple = llvm::sys::getDefaultTargetTriple();
+  Opts.Triple = llvm::Triple::normalize(Opts.Triple);
   Opts.OpenCLExtensionsAsWritten = Args.getAllArgValues(OPT_cl_ext_EQ);
   Opts.ForceEnableInt128 = Args.hasArg(OPT_fforce_enable_int128);
   Opts.NVPTXUseShortPointers = Args.hasFlag(


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


r333307 - [Support] Avoid normalization in sys::getDefaultTargetTriple

2018-05-25 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri May 25 13:39:37 2018
New Revision: 07

URL: http://llvm.org/viewvc/llvm-project?rev=07&view=rev
Log:
[Support] Avoid normalization in sys::getDefaultTargetTriple

The return value of sys::getDefaultTargetTriple, which is derived from
-DLLVM_DEFAULT_TRIPLE, is used to construct tool names, default target,
and in the future also to control the search path directly; as such it
should be used textually, without interpretation by LLVM.

Normalization of this value may lead to unexpected results, for example
if we configure LLVM with -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnu,
normalization will transform that value to x86_64--linux-gnu. Driver will
use that value to search for tools prefixed with x86_64--linux-gnu- which
may be confusing. This is also inconsistent with the behavior of the
--target flag which is taken as-is without any normalization and overrides
the value of LLVM_DEFAULT_TARGET_TRIPLE.

Users of sys::getDefaultTargetTriple already perform their own
normalization as needed, so this change shouldn't impact existing logic.

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

Modified:
cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=07&r1=06&r2=07&view=diff
==
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri May 25 13:39:37 2018
@@ -2930,10 +2930,11 @@ static void ParseTargetArgs(TargetOption
   Opts.FPMath = Args.getLastArgValue(OPT_mfpmath);
   Opts.FeaturesAsWritten = Args.getAllArgValues(OPT_target_feature);
   Opts.LinkerVersion = Args.getLastArgValue(OPT_target_linker_version);
-  Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple));
+  Opts.Triple = Args.getLastArgValue(OPT_triple);
   // Use the default target triple if unspecified.
   if (Opts.Triple.empty())
 Opts.Triple = llvm::sys::getDefaultTargetTriple();
+  Opts.Triple = llvm::Triple::normalize(Opts.Triple);
   Opts.OpenCLExtensionsAsWritten = Args.getAllArgValues(OPT_cl_ext_EQ);
   Opts.ForceEnableInt128 = Args.hasArg(OPT_fforce_enable_int128);
   Opts.NVPTXUseShortPointers = Args.hasFlag(


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


r333468 - [Driver] Rename DefaultTargetTriple to TargetTriple

2018-05-29 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue May 29 15:35:39 2018
New Revision: 333468

URL: http://llvm.org/viewvc/llvm-project?rev=333468&view=rev
Log:
[Driver] Rename DefaultTargetTriple to TargetTriple

While this value is initialized with the DefaultTargetTriple, it
can be later overriden using the -target flag so TargetTriple is
a more accurate name. This change also provides an accessor which
could be accessed from ToolChain implementations.

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

Modified:
cfe/trunk/include/clang/Driver/Driver.h
cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=333468&r1=333467&r2=333468&view=diff
==
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Tue May 29 15:35:39 2018
@@ -202,8 +202,8 @@ public:
   unsigned CCGenDiagnostics : 1;
 
 private:
-  /// Default target triple.
-  std::string DefaultTargetTriple;
+  /// Raw target triple.
+  std::string TargetTriple;
 
   /// Name to use when invoking gcc/g++.
   std::string CCCGenericGCCName;
@@ -282,7 +282,7 @@ private:
   SmallString<128> &CrashDiagDir);
 
 public:
-  Driver(StringRef ClangExecutable, StringRef DefaultTargetTriple,
+  Driver(StringRef ClangExecutable, StringRef TargetTriple,
  DiagnosticsEngine &Diags,
  IntrusiveRefCntPtr VFS = nullptr);
 
@@ -309,6 +309,8 @@ public:
   const std::string &getTitle() { return DriverTitle; }
   void setTitle(std::string Value) { DriverTitle = std::move(Value); }
 
+  std::string getTargetTriple() const { return TargetTriple; }
+
   /// Get the path to the main clang executable.
   const char *getClangProgramPath() const {
 return ClangExecutable.c_str();

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=333468&r1=333467&r2=333468&view=diff
==
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Tue May 29 15:35:39 2018
@@ -84,7 +84,7 @@ using namespace clang::driver;
 using namespace clang;
 using namespace llvm::opt;
 
-Driver::Driver(StringRef ClangExecutable, StringRef DefaultTargetTriple,
+Driver::Driver(StringRef ClangExecutable, StringRef TargetTriple,
DiagnosticsEngine &Diags,
IntrusiveRefCntPtr VFS)
 : Opts(createDriverOptTable()), Diags(Diags), VFS(std::move(VFS)),
@@ -94,7 +94,7 @@ Driver::Driver(StringRef ClangExecutable
   CCPrintOptionsFilename(nullptr), CCPrintHeadersFilename(nullptr),
   CCLogDiagnosticsFilename(nullptr), CCCPrintBindings(false),
   CCPrintOptions(false), CCPrintHeaders(false), CCLogDiagnostics(false),
-  CCGenDiagnostics(false), DefaultTargetTriple(DefaultTargetTriple),
+  CCGenDiagnostics(false), TargetTriple(TargetTriple),
   CCCGenericGCCName(""), Saver(Alloc), CheckInputsExist(true),
   CCCUsePCH(true), GenReproducer(false),
   SuppressMissingInputWarning(false) {
@@ -388,14 +388,14 @@ DerivedArgList *Driver::TranslateInputAr
 /// This routine provides the logic to compute a target triple from various
 /// args passed to the driver and the default triple string.
 static llvm::Triple computeTargetTriple(const Driver &D,
-StringRef DefaultTargetTriple,
+StringRef TargetTriple,
 const ArgList &Args,
 StringRef DarwinArchName = "") {
   // FIXME: Already done in Compilation *Driver::BuildCompilation
   if (const Arg *A = Args.getLastArg(options::OPT_target))
-DefaultTargetTriple = A->getValue();
+TargetTriple = A->getValue();
 
-  llvm::Triple Target(llvm::Triple::normalize(DefaultTargetTriple));
+  llvm::Triple Target(llvm::Triple::normalize(TargetTriple));
 
   // Handle Apple-specific options available here.
   if (Target.isOSBinFormatMachO()) {
@@ -941,19 +941,19 @@ Compilation *Driver::BuildCompilation(Ar
   GenReproducer = Args.hasFlag(options::OPT_gen_reproducer,
options::OPT_fno_crash_diagnostics,
!!::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH"));
-  // FIXME: DefaultTargetTriple is used by the target-prefixed calls to as/ld
+  // FIXME: TargetTriple is used by the target-prefixed calls to as/ld
   // and getToolChain is const.
   if (IsCLMode()) {
 // clang-cl targets MSVC-style Win32.
-llvm::Triple T(DefaultTargetTriple);
+llvm::Triple T(TargetTriple);
 T.setOS(llvm::Triple::Win32);
 T.setVendor(llvm::Triple::PC);
 T.setEnvironment(llvm::Triple::MSVC);
 T.setObjectFormat(llvm::Triple::COFF);
-DefaultTargetTriple = T.str();
+TargetTriple = T.str();
  

r316053 - [CMake] Build Fuchsia toolchain as -O3

2017-10-17 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Oct 17 18:27:54 2017
New Revision: 316053

URL: http://llvm.org/viewvc/llvm-project?rev=316053&view=rev
Log:
[CMake] Build Fuchsia toolchain as -O3

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=316053&r1=316052&r2=316053&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue Oct 17 18:27:54 2017
@@ -30,8 +30,8 @@ if(APPLE)
 endif()
 
 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
 
 set(LLVM_BUILTIN_TARGETS "x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "")
 foreach(target x86_64;aarch64)


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


r316379 - [Driver] Use ld.lld directly for Fuchsia rather than passing flavor

2017-10-23 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Oct 23 14:31:05 2017
New Revision: 316379

URL: http://llvm.org/viewvc/llvm-project?rev=316379&view=rev
Log:
[Driver] Use ld.lld directly for Fuchsia rather than passing flavor

Passing a flavor to LLD requires command line argument, but if these
are being passed through a response file, this will fail because LLD
needs to know which driver to use before processing the response file.
Use ld.lld directly instead to avoid this issue.

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

Modified:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
cfe/trunk/test/Driver/fuchsia.c
cfe/trunk/test/Driver/fuchsia.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=316379&r1=316378&r2=316379&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Mon Oct 23 14:31:05 2017
@@ -44,10 +44,8 @@ void fuchsia::Linker::ConstructJob(Compi
   Args.ClaimAllArgs(options::OPT_w);
 
   const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
-  if (llvm::sys::path::stem(Exec).equals_lower("lld")) {
-CmdArgs.push_back("-flavor");
-CmdArgs.push_back("gnu");
-
+  if (llvm::sys::path::filename(Exec).equals_lower("ld.lld") ||
+  llvm::sys::path::stem(Exec).equals_lower("ld.lld")) {
 CmdArgs.push_back("-z");
 CmdArgs.push_back("rodynamic");
   }

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.h?rev=316379&r1=316378&r2=316379&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.h Mon Oct 23 14:31:05 2017
@@ -82,7 +82,7 @@ public:
llvm::opt::ArgStringList &CmdArgs) const override;
 
   const char *getDefaultLinker() const override {
-return "lld";
+return "ld.lld";
   }
 
 protected:

Modified: cfe/trunk/test/Driver/fuchsia.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.c?rev=316379&r1=316378&r2=316379&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Mon Oct 23 14:31:05 2017
@@ -1,16 +1,15 @@
 // RUN: %clang %s -### -no-canonical-prefixes --target=x86_64-unknown-fuchsia \
-// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
+// RUN: --sysroot=%S/platform 2>&1 \
 // RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
 // RUN: %clang %s -### -no-canonical-prefixes --target=aarch64-unknown-fuchsia 
\
-// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
+// RUN: --sysroot=%S/platform 2>&1 \
 // RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
 // CHECK: {{.*}}clang{{.*}}" "-cc1"
 // CHECK: "-munwind-tables"
 // CHECK: "-fuse-init-array"
 // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
 // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|}}include"
-// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
-// CHECK: "-z" "rodynamic"
+// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
 // CHECK: "--sysroot=[[SYSROOT]]"
 // CHECK: "-pie"
 // CHECK: "--build-id"

Modified: cfe/trunk/test/Driver/fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.cpp?rev=316379&r1=316378&r2=316379&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.cpp (original)
+++ cfe/trunk/test/Driver/fuchsia.cpp Mon Oct 23 14:31:05 2017
@@ -1,13 +1,12 @@
 // RUN: %clangxx %s -### -no-canonical-prefixes 
--target=x86_64-unknown-fuchsia \
-// RUN: --sysroot=%S/platform 2>&1 -fuse-ld=ld | FileCheck %s
+// RUN: --sysroot=%S/platform 2>&1 | FileCheck %s
 // CHECK: {{.*}}clang{{.*}}" "-cc1"
 // CHECK: "-triple" "x86_64-fuchsia"
 // CHECK: "-fuse-init-array"
 // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
 // CHECK: "-internal-isystem" 
"{{.*[/\\]}}x86_64-fuchsia{{/|}}include{{/|}}c++{{/|}}v1"
 // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|}}include"
-// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
-// CHECK: "-z" "rodynamic"
+// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
 // CHECK: "--sysroot=[[SYSROOT]]"
 // CHECK: "-pie"
 // CHECK: "--build-id"


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


r316540 - [clang-refactor] Use add_clang_tool CMake template

2017-10-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Oct 24 18:11:27 2017
New Revision: 316540

URL: http://llvm.org/viewvc/llvm-project?rev=316540&view=rev
Log:
[clang-refactor] Use add_clang_tool CMake template

This allows including clang-refactor in LLVM_DISTRIBUTION_COMPONENTS
to build clang-refactor as part of the toolchain distribution.

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

Modified:
cfe/trunk/tools/clang-refactor/CMakeLists.txt

Modified: cfe/trunk/tools/clang-refactor/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-refactor/CMakeLists.txt?rev=316540&r1=316539&r2=316540&view=diff
==
--- cfe/trunk/tools/clang-refactor/CMakeLists.txt (original)
+++ cfe/trunk/tools/clang-refactor/CMakeLists.txt Tue Oct 24 18:11:27 2017
@@ -3,7 +3,7 @@ set(LLVM_LINK_COMPONENTS
   Support
   )
 
-add_clang_executable(clang-refactor
+add_clang_tool(clang-refactor
   ClangRefactor.cpp
   TestSupport.cpp
   )


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


r316541 - [CMake] Include clang-refactor in Fuchsia toolchain

2017-10-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Oct 24 19:31:38 2017
New Revision: 316541

URL: http://llvm.org/viewvc/llvm-project?rev=316541&view=rev
Log:
[CMake] Include clang-refactor in Fuchsia toolchain

This includes the clang-refactor in the toolchain distribution.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=316541&r1=316540&r2=316541&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue Oct 24 19:31:38 2017
@@ -97,6 +97,7 @@ set(LLVM_DISTRIBUTION_COMPONENTS
   LTO
   clang-format
   clang-headers
+  clang-refactor
   clang-tidy
   clangd
   builtins


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


r316542 - [CMake] Build host builtins in Fuchsia toolchain even on Darwin

2017-10-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Oct 24 19:35:22 2017
New Revision: 316542

URL: http://llvm.org/viewvc/llvm-project?rev=316542&view=rev
Log:
[CMake] Build host builtins in Fuchsia toolchain even on Darwin

This is nedeeded for the toolchain to be actually usable as a host
toolchain on Darwin.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=316542&r1=316541&r2=316542&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue Oct 24 19:35:22 2017
@@ -33,16 +33,12 @@ set(CMAKE_BUILD_TYPE RelWithDebInfo CACH
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
 
-set(LLVM_BUILTIN_TARGETS "x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "")
+set(LLVM_BUILTIN_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia" CACHE STRING 
"")
 foreach(target x86_64;aarch64)
   set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} 
CACHE PATH "")
   set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
 endforeach()
 
-if(NOT APPLE)
-  set(LLVM_BUILTIN_TARGETS "default;${LLVM_BUILTIN_TARGETS}" CACHE STRING "" 
FORCE)
-endif()
-
 set(LLVM_RUNTIME_TARGETS 
"default;x86_64-fuchsia;aarch64-fuchsia;x86_64-fuchsia-asan:x86_64-fuchsia;aarch64-fuchsia-asan:aarch64-fuchsia"
 CACHE STRING "")
 foreach(target x86_64;aarch64)
   set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL 
"")


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


r342021 - [Driver] Search LibraryPaths when handling -print-file-name

2018-09-11 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Sep 11 20:26:10 2018
New Revision: 342021

URL: http://llvm.org/viewvc/llvm-project?rev=342021&view=rev
Log:
[Driver] Search LibraryPaths when handling -print-file-name

This is necessary to handle the multiarch runtime directories.

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

Modified:
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/test/Driver/linux-per-target-runtime-dir.c

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=342021&r1=342020&r2=342021&view=diff
==
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Sep 11 20:26:10 2018
@@ -4152,16 +4152,24 @@ const char *Driver::GetNamedOutputPath(C
 }
 
 std::string Driver::GetFilePath(StringRef Name, const ToolChain &TC) const {
-  // Respect a limited subset of the '-Bprefix' functionality in GCC by
-  // attempting to use this prefix when looking for file paths.
-  for (const std::string &Dir : PrefixDirs) {
-if (Dir.empty())
-  continue;
-SmallString<128> P(Dir[0] == '=' ? SysRoot + Dir.substr(1) : Dir);
-llvm::sys::path::append(P, Name);
-if (llvm::sys::fs::exists(Twine(P)))
-  return P.str();
-  }
+  // Seach for Name in a list of paths.
+  auto SearchPaths = [&](const llvm::SmallVectorImpl &P)
+  -> llvm::Optional {
+// Respect a limited subset of the '-Bprefix' functionality in GCC by
+// attempting to use this prefix when looking for file paths.
+for (const auto &Dir : P) {
+  if (Dir.empty())
+continue;
+  SmallString<128> P(Dir[0] == '=' ? SysRoot + Dir.substr(1) : Dir);
+  llvm::sys::path::append(P, Name);
+  if (llvm::sys::fs::exists(Twine(P)))
+return {P.str()};
+}
+return None;
+  };
+
+  if (auto P = SearchPaths(PrefixDirs))
+return *P;
 
   SmallString<128> R(ResourceDir);
   llvm::sys::path::append(R, Name);
@@ -4173,14 +4181,11 @@ std::string Driver::GetFilePath(StringRe
   if (llvm::sys::fs::exists(Twine(P)))
 return P.str();
 
-  for (const std::string &Dir : TC.getFilePaths()) {
-if (Dir.empty())
-  continue;
-SmallString<128> P(Dir[0] == '=' ? SysRoot + Dir.substr(1) : Dir);
-llvm::sys::path::append(P, Name);
-if (llvm::sys::fs::exists(Twine(P)))
-  return P.str();
-  }
+  if (auto P = SearchPaths(TC.getLibraryPaths()))
+return *P;
+
+  if (auto P = SearchPaths(TC.getFilePaths()))
+return *P;
 
   return Name;
 }

Modified: cfe/trunk/test/Driver/linux-per-target-runtime-dir.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-per-target-runtime-dir.c?rev=342021&r1=342020&r2=342021&view=diff
==
--- cfe/trunk/test/Driver/linux-per-target-runtime-dir.c (original)
+++ cfe/trunk/test/Driver/linux-per-target-runtime-dir.c Tue Sep 11 20:26:10 
2018
@@ -19,3 +19,9 @@
 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
 // RUN:   | FileCheck --check-prefix=CHECK-CLANGRT-X8664 %s
 // CHECK-CLANGRT-X8664: 
x86_64-linux-gnu{{/|\\}}lib{{/|\\}}libclang_rt.builtins.a
+
+// RUN: %clang -rtlib=compiler-rt -print-file-name=libclang_rt.builtins.a 2>&1 
\
+// RUN: --target=x86_64-linux-gnu \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
+// RUN:   | FileCheck --check-prefix=CHECK-FILE-NAME-X8664 %s
+// CHECK-FILE-NAME-X8664: 
x86_64-linux-gnu{{/|\\}}lib{{/|\\}}libclang_rt.builtins.a


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


[libcxx] r337630 - [CMake] Install C++ ABI headers into the right location

2018-07-20 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri Jul 20 15:45:24 2018
New Revision: 337630

URL: http://llvm.org/viewvc/llvm-project?rev=337630&view=rev
Log:
[CMake] Install C++ ABI headers into the right location

This is a follow-up to r335809 and r337118. While libc++ headers are now
installed into the right location in both standard as well as multiarch
runtimes layout, turned out C++ ABI headers are still installed into the
old location in the latter case. This change addresses that.

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

Modified:
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=337630&r1=337629&r2=337630&view=diff
==
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Fri Jul 20 15:45:24 2018
@@ -32,14 +32,6 @@ macro(setup_abi_lib abidefines abilib ab
   set(LIBCXX_CXX_ABI_LIBRARY ${abilib})
   set(LIBCXX_ABILIB_FILES ${abifiles})
 
-  # The place in the build tree where we store out-of-source headers.
-  file(MAKE_DIRECTORY "${LIBCXX_BUILD_HEADERS_ROOT}")
-  file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1")
-  foreach(_d ${abidirs})
-file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}/${_d}")
-file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1/${_d}")
-  endforeach()
-
   foreach(fpath ${LIBCXX_ABILIB_FILES})
 set(found FALSE)
 foreach(incpath ${LIBCXX_CXX_ABI_INCLUDE_PATHS})
@@ -56,7 +48,7 @@ macro(setup_abi_lib abidefines abilib ab
 COMMENT "Copying C++ ABI header ${fpath}...")
 list(APPEND abilib_headers "${dst}")
 
-set(dst "${CMAKE_BINARY_DIR}/include/c++/v1/${dstdir}/${fpath}")
+set(dst "${LIBCXX_HEADER_DIR}/include/c++/v1/${dstdir}/${fpath}")
 add_custom_command(OUTPUT ${dst}
 DEPENDS ${src}
 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
@@ -65,7 +57,7 @@ macro(setup_abi_lib abidefines abilib ab
 
 if (LIBCXX_INSTALL_HEADERS)
   install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
-DESTINATION ${LIBCXX_INSTALL_PATH}include/c++/v1/${dstdir}
+DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir}
 COMPONENT cxx-headers
 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
 )


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


[libcxx] r337668 - [CMake] Support statically linking dependencies only to shared or static library

2018-07-22 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Sun Jul 22 21:19:55 2018
New Revision: 337668

URL: http://llvm.org/viewvc/llvm-project?rev=337668&view=rev
Log:
[CMake] Support statically linking dependencies only to shared or static library

Currently it's possible to select whether to statically link unwinder
or the C++ ABI library, but this option applies to both the shared
and static library. However, in some scenarios it may be desirable to
only statically link unwinder and C++ ABI library into static C++
library since for shared C++ library we can rely on dynamic linking
and linker scripts. This change enables selectively enabling or
disabling statically linking only to shared or static library.

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

Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=337668&r1=337667&r2=337668&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Sun Jul 22 21:19:55 2018
@@ -155,6 +155,14 @@ endif()
 # cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT.
 option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
 
+cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY
+  "Statically link the ABI library to static library" ON
+  "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF)
+
+cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY
+  "Statically link the ABI library to shared library" ON
+  "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF)
+
 # Generate and install a linker script inplace of libc++.so. The linker script
 # will link libc++ to the correct ABI library. This option is on by default
 # on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=337668&r1=337667&r2=337668&view=diff
==
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Sun Jul 22 21:19:55 2018
@@ -96,10 +96,10 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL
 elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
   if (LIBCXX_CXX_ABI_INTREE)
 # Link against just-built "cxxabi" target.
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
-set(CXXABI_LIBNAME cxxabi_static)
+if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
+  set(CXXABI_LIBNAME cxxabi_static)
 else()
-set(CXXABI_LIBNAME cxxabi_shared)
+  set(CXXABI_LIBNAME cxxabi_shared)
 endif()
 set(LIBCXX_LIBCPPABI_VERSION "2" PARENT_SCOPE)
   else()

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=337668&r1=337667&r2=337668&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Sun Jul 22 21:19:55 2018
@@ -44,7 +44,7 @@ if (APPLE AND (LIBCXX_CXX_ABI_LIBNAME ST
   set(LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY ON)
 endif()
 
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
   add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic")
   add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
   add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive")
@@ -259,14 +259,14 @@ if (LIBCXX_ENABLE_STATIC)
 
   list(APPEND LIBCXX_TARGETS "cxx_static")
   # Attempt to merge the libc++.a archive and the ABI library archive into one.
-  if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+  if (LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY)
 set(MERGE_ARCHIVES_SEARCH_PATHS "")
 if (LIBCXX_CXX_ABI_LIBRARY_PATH)
   set(MERGE_ARCHIVES_SEARCH_PATHS "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
 endif()
 if ((TARGET ${LIBCXX_CXX_ABI_LIBRARY}) OR
 (${LIBCXX_CXX_ABI_LIBRARY} MATCHES "cxxabi(_static|_shared)?" AND 
HAVE_LIBCXXABI))
-  set(MERGE_ARCHIVES_ABI_TARGET 
"$")
+  set(MERGE_ARCHIVES_ABI_TARGET "$")
 else()
   set(MERGE_ARCHIVES_ABI_TARGET
   
"${CMAKE_STATIC_LIBRARY_PREFIX}${LIBCXX_CXX_ABI_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}")


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


[libcxxabi] r337668 - [CMake] Support statically linking dependencies only to shared or static library

2018-07-22 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Sun Jul 22 21:19:55 2018
New Revision: 337668

URL: http://llvm.org/viewvc/llvm-project?rev=337668&view=rev
Log:
[CMake] Support statically linking dependencies only to shared or static library

Currently it's possible to select whether to statically link unwinder
or the C++ ABI library, but this option applies to both the shared
and static library. However, in some scenarios it may be desirable to
only statically link unwinder and C++ ABI library into static C++
library since for shared C++ library we can rely on dynamic linking
and linker scripts. This change enables selectively enabling or
disabling statically linking only to shared or static library.

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

Modified:
libcxxabi/trunk/CMakeLists.txt
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CMakeLists.txt?rev=337668&r1=337667&r2=337668&view=diff
==
--- libcxxabi/trunk/CMakeLists.txt (original)
+++ libcxxabi/trunk/CMakeLists.txt Sun Jul 22 21:19:55 2018
@@ -84,6 +84,13 @@ set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CAC
 option(LIBCXXABI_ENABLE_SHARED "Build libc++abi as a shared library." ON)
 option(LIBCXXABI_ENABLE_STATIC "Build libc++abi as a static library." ON)
 
+cmake_dependent_option(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY
+  "Statically link the LLVM unwinder to static library" ON
+  "LIBCXXABI_ENABLE_STATIC_UNWINDER;LIBCXXABI_ENABLE_STATIC" OFF)
+cmake_dependent_option(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY
+  "Statically link the LLVM unwinder to shared library" ON
+  "LIBCXXABI_ENABLE_STATIC_UNWINDER;LIBCXXABI_ENABLE_SHARED" OFF)
+
 option(LIBCXXABI_BAREMETAL "Build libc++abi for baremetal targets." OFF)
 # The default terminate handler attempts to demangle uncaught exceptions, which
 # causes extra I/O and demangling code to be pulled in.

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=337668&r1=337667&r2=337668&view=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Sun Jul 22 21:19:55 2018
@@ -61,19 +61,27 @@ if (LIBCXXABI_USE_LLVM_UNWINDER)
   # Prefer using the in-tree version of libunwind, either shared or static. If
   # none are found fall back to using -lunwind.
   # FIXME: Is it correct to prefer the static version of libunwind?
-  if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR 
HAVE_LIBUNWIND))
-list(APPEND LIBCXXABI_LIBRARIES unwind_shared)
-  elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR 
HAVE_LIBUNWIND))
-list(APPEND LIBCXXABI_LIBRARIES unwind_static)
+  if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET 
unwind_shared OR HAVE_LIBUNWIND))
+list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind_shared)
+  elseif (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET 
unwind_static OR HAVE_LIBUNWIND))
+list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind_static)
   else()
-list(APPEND LIBCXXABI_LIBRARIES unwind)
+list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind)
+  endif()
+  if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY AND (TARGET 
unwind_shared OR HAVE_LIBUNWIND))
+list(APPEND LIBCXXABI_STATIC_LIBRARIES unwind_shared)
+  elseif (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY AND (TARGET 
unwind_static OR HAVE_LIBUNWIND))
+  # We handle this by directly merging libunwind objects into libc++abi.
+  else()
+list(APPEND LIBCXXABI_STATIC_LIBRARIES unwind)
   endif()
 else()
   add_library_flags_if(LIBCXXABI_HAS_GCC_S_LIB gcc_s)
 endif()
 if (MINGW)
   # MINGW_LIBRARIES is defined in config-ix.cmake
-  list(APPEND LIBCXXABI_LIBRARIES ${MINGW_LIBRARIES})
+  list(APPEND LIBCXXABI_SHARED_LIBRARIES ${MINGW_LIBRARIES})
+  list(APPEND LIBCXXABI_STATIC_LIBRARIES ${MINGW_LIBRARIES})
 endif()
 
 # Setup flags.
@@ -130,7 +138,7 @@ if (LIBCXXABI_ENABLE_SHARED)
   if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(cxxabi_shared)
   endif()
-  target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})
+  target_link_libraries(cxxabi_shared ${LIBCXXABI_SHARED_LIBRARIES})
   set_target_properties(cxxabi_shared
 PROPERTIES
   CXX_EXTENSIONS
@@ -155,13 +163,13 @@ endif()
 # Build the static library.
 if (LIBCXXABI_ENABLE_STATIC)
   set(cxxabi_static_sources $)
-  if (LIBCXXABI_USE_LLVM_UNWINDER AND LIBCXXABI_ENABLE_STATIC_UNWINDER)
+  if (LIBCXXABI_USE_LLVM_UNWINDER AND 
LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY)
 if (TARGET unwind_static OR HAVE_LIBUNWIND)
   list(APPEND cxxabi_static_sources $)
 endif()
   endif()
   add_library(cxxabi_static STATIC ${cxxabi_static_sources})
-  target_link_libraries(cxx

[libcxxabi] r337670 - Revert "[CMake] Support statically linking dependencies only to shared or static library"

2018-07-22 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Sun Jul 22 22:07:44 2018
New Revision: 337670

URL: http://llvm.org/viewvc/llvm-project?rev=337670&view=rev
Log:
Revert "[CMake] Support statically linking dependencies only to shared or 
static library"

This reverts commit r337668: broke the cxxabi build when using Make.

Modified:
libcxxabi/trunk/CMakeLists.txt
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CMakeLists.txt?rev=337670&r1=337669&r2=337670&view=diff
==
--- libcxxabi/trunk/CMakeLists.txt (original)
+++ libcxxabi/trunk/CMakeLists.txt Sun Jul 22 22:07:44 2018
@@ -84,13 +84,6 @@ set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CAC
 option(LIBCXXABI_ENABLE_SHARED "Build libc++abi as a shared library." ON)
 option(LIBCXXABI_ENABLE_STATIC "Build libc++abi as a static library." ON)
 
-cmake_dependent_option(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY
-  "Statically link the LLVM unwinder to static library" ON
-  "LIBCXXABI_ENABLE_STATIC_UNWINDER;LIBCXXABI_ENABLE_STATIC" OFF)
-cmake_dependent_option(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY
-  "Statically link the LLVM unwinder to shared library" ON
-  "LIBCXXABI_ENABLE_STATIC_UNWINDER;LIBCXXABI_ENABLE_SHARED" OFF)
-
 option(LIBCXXABI_BAREMETAL "Build libc++abi for baremetal targets." OFF)
 # The default terminate handler attempts to demangle uncaught exceptions, which
 # causes extra I/O and demangling code to be pulled in.

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=337670&r1=337669&r2=337670&view=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Sun Jul 22 22:07:44 2018
@@ -61,27 +61,19 @@ if (LIBCXXABI_USE_LLVM_UNWINDER)
   # Prefer using the in-tree version of libunwind, either shared or static. If
   # none are found fall back to using -lunwind.
   # FIXME: Is it correct to prefer the static version of libunwind?
-  if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET 
unwind_shared OR HAVE_LIBUNWIND))
-list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind_shared)
-  elseif (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET 
unwind_static OR HAVE_LIBUNWIND))
-list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind_static)
+  if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR 
HAVE_LIBUNWIND))
+list(APPEND LIBCXXABI_LIBRARIES unwind_shared)
+  elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR 
HAVE_LIBUNWIND))
+list(APPEND LIBCXXABI_LIBRARIES unwind_static)
   else()
-list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind)
-  endif()
-  if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY AND (TARGET 
unwind_shared OR HAVE_LIBUNWIND))
-list(APPEND LIBCXXABI_STATIC_LIBRARIES unwind_shared)
-  elseif (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY AND (TARGET 
unwind_static OR HAVE_LIBUNWIND))
-  # We handle this by directly merging libunwind objects into libc++abi.
-  else()
-list(APPEND LIBCXXABI_STATIC_LIBRARIES unwind)
+list(APPEND LIBCXXABI_LIBRARIES unwind)
   endif()
 else()
   add_library_flags_if(LIBCXXABI_HAS_GCC_S_LIB gcc_s)
 endif()
 if (MINGW)
   # MINGW_LIBRARIES is defined in config-ix.cmake
-  list(APPEND LIBCXXABI_SHARED_LIBRARIES ${MINGW_LIBRARIES})
-  list(APPEND LIBCXXABI_STATIC_LIBRARIES ${MINGW_LIBRARIES})
+  list(APPEND LIBCXXABI_LIBRARIES ${MINGW_LIBRARIES})
 endif()
 
 # Setup flags.
@@ -138,7 +130,7 @@ if (LIBCXXABI_ENABLE_SHARED)
   if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(cxxabi_shared)
   endif()
-  target_link_libraries(cxxabi_shared ${LIBCXXABI_SHARED_LIBRARIES})
+  target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})
   set_target_properties(cxxabi_shared
 PROPERTIES
   CXX_EXTENSIONS
@@ -163,13 +155,13 @@ endif()
 # Build the static library.
 if (LIBCXXABI_ENABLE_STATIC)
   set(cxxabi_static_sources $)
-  if (LIBCXXABI_USE_LLVM_UNWINDER AND 
LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY)
+  if (LIBCXXABI_USE_LLVM_UNWINDER AND LIBCXXABI_ENABLE_STATIC_UNWINDER)
 if (TARGET unwind_static OR HAVE_LIBUNWIND)
   list(APPEND cxxabi_static_sources $)
 endif()
   endif()
   add_library(cxxabi_static STATIC ${cxxabi_static_sources})
-  target_link_libraries(cxxabi_static ${LIBCXXABI_STATIC_LIBRARIES})
+  target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES})
   set_target_properties(cxxabi_static
 PROPERTIES
   CXX_EXTENSIONS


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


[libcxx] r337670 - Revert "[CMake] Support statically linking dependencies only to shared or static library"

2018-07-22 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Sun Jul 22 22:07:44 2018
New Revision: 337670

URL: http://llvm.org/viewvc/llvm-project?rev=337670&view=rev
Log:
Revert "[CMake] Support statically linking dependencies only to shared or 
static library"

This reverts commit r337668: broke the cxxabi build when using Make.

Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=337670&r1=337669&r2=337670&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Sun Jul 22 22:07:44 2018
@@ -155,14 +155,6 @@ endif()
 # cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT.
 option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
 
-cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY
-  "Statically link the ABI library to static library" ON
-  "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF)
-
-cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY
-  "Statically link the ABI library to shared library" ON
-  "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF)
-
 # Generate and install a linker script inplace of libc++.so. The linker script
 # will link libc++ to the correct ABI library. This option is on by default
 # on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=337670&r1=337669&r2=337670&view=diff
==
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Sun Jul 22 22:07:44 2018
@@ -96,10 +96,10 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL
 elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
   if (LIBCXX_CXX_ABI_INTREE)
 # Link against just-built "cxxabi" target.
-if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
-  set(CXXABI_LIBNAME cxxabi_static)
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+set(CXXABI_LIBNAME cxxabi_static)
 else()
-  set(CXXABI_LIBNAME cxxabi_shared)
+set(CXXABI_LIBNAME cxxabi_shared)
 endif()
 set(LIBCXX_LIBCPPABI_VERSION "2" PARENT_SCOPE)
   else()

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=337670&r1=337669&r2=337670&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Sun Jul 22 22:07:44 2018
@@ -44,7 +44,7 @@ if (APPLE AND (LIBCXX_CXX_ABI_LIBNAME ST
   set(LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY ON)
 endif()
 
-if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
   add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic")
   add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
   add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive")
@@ -259,14 +259,14 @@ if (LIBCXX_ENABLE_STATIC)
 
   list(APPEND LIBCXX_TARGETS "cxx_static")
   # Attempt to merge the libc++.a archive and the ABI library archive into one.
-  if (LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY)
+  if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
 set(MERGE_ARCHIVES_SEARCH_PATHS "")
 if (LIBCXX_CXX_ABI_LIBRARY_PATH)
   set(MERGE_ARCHIVES_SEARCH_PATHS "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
 endif()
 if ((TARGET ${LIBCXX_CXX_ABI_LIBRARY}) OR
 (${LIBCXX_CXX_ABI_LIBRARY} MATCHES "cxxabi(_static|_shared)?" AND 
HAVE_LIBCXXABI))
-  set(MERGE_ARCHIVES_ABI_TARGET "$")
+  set(MERGE_ARCHIVES_ABI_TARGET 
"$")
 else()
   set(MERGE_ARCHIVES_ABI_TARGET
   
"${CMAKE_STATIC_LIBRARY_PREFIX}${LIBCXX_CXX_ABI_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}")


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


[libcxx] r337814 - Reland "[CMake] Support statically linking dependencies only to shared or static library"

2018-07-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 24 00:06:17 2018
New Revision: 337814

URL: http://llvm.org/viewvc/llvm-project?rev=337814&view=rev
Log:
Reland "[CMake] Support statically linking dependencies only to shared or 
static library"

This is a reland of commit r337668.

Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=337814&r1=337813&r2=337814&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Tue Jul 24 00:06:17 2018
@@ -155,6 +155,14 @@ endif()
 # cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT.
 option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
 
+cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY
+  "Statically link the ABI library to static library" ON
+  "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF)
+
+cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY
+  "Statically link the ABI library to shared library" ON
+  "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF)
+
 # Generate and install a linker script inplace of libc++.so. The linker script
 # will link libc++ to the correct ABI library. This option is on by default
 # on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=337814&r1=337813&r2=337814&view=diff
==
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Tue Jul 24 00:06:17 2018
@@ -96,10 +96,10 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL
 elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
   if (LIBCXX_CXX_ABI_INTREE)
 # Link against just-built "cxxabi" target.
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
-set(CXXABI_LIBNAME cxxabi_static)
+if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
+  set(CXXABI_LIBNAME cxxabi_static)
 else()
-set(CXXABI_LIBNAME cxxabi_shared)
+  set(CXXABI_LIBNAME cxxabi_shared)
 endif()
 set(LIBCXX_LIBCPPABI_VERSION "2" PARENT_SCOPE)
   else()

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=337814&r1=337813&r2=337814&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Tue Jul 24 00:06:17 2018
@@ -44,7 +44,7 @@ if (APPLE AND (LIBCXX_CXX_ABI_LIBNAME ST
   set(LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY ON)
 endif()
 
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
   add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic")
   add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
   add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive")
@@ -259,14 +259,14 @@ if (LIBCXX_ENABLE_STATIC)
 
   list(APPEND LIBCXX_TARGETS "cxx_static")
   # Attempt to merge the libc++.a archive and the ABI library archive into one.
-  if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+  if (LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY)
 set(MERGE_ARCHIVES_SEARCH_PATHS "")
 if (LIBCXX_CXX_ABI_LIBRARY_PATH)
   set(MERGE_ARCHIVES_SEARCH_PATHS "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
 endif()
 if ((TARGET ${LIBCXX_CXX_ABI_LIBRARY}) OR
 (${LIBCXX_CXX_ABI_LIBRARY} MATCHES "cxxabi(_static|_shared)?" AND 
HAVE_LIBCXXABI))
-  set(MERGE_ARCHIVES_ABI_TARGET 
"$")
+  set(MERGE_ARCHIVES_ABI_TARGET "$")
 else()
   set(MERGE_ARCHIVES_ABI_TARGET
   
"${CMAKE_STATIC_LIBRARY_PREFIX}${LIBCXX_CXX_ABI_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}")


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


[libcxxabi] r337814 - Reland "[CMake] Support statically linking dependencies only to shared or static library"

2018-07-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 24 00:06:17 2018
New Revision: 337814

URL: http://llvm.org/viewvc/llvm-project?rev=337814&view=rev
Log:
Reland "[CMake] Support statically linking dependencies only to shared or 
static library"

This is a reland of commit r337668.

Modified:
libcxxabi/trunk/CMakeLists.txt
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CMakeLists.txt?rev=337814&r1=337813&r2=337814&view=diff
==
--- libcxxabi/trunk/CMakeLists.txt (original)
+++ libcxxabi/trunk/CMakeLists.txt Tue Jul 24 00:06:17 2018
@@ -84,6 +84,13 @@ set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CAC
 option(LIBCXXABI_ENABLE_SHARED "Build libc++abi as a shared library." ON)
 option(LIBCXXABI_ENABLE_STATIC "Build libc++abi as a static library." ON)
 
+cmake_dependent_option(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY
+  "Statically link the LLVM unwinder to static library" ON
+  "LIBCXXABI_ENABLE_STATIC_UNWINDER;LIBCXXABI_ENABLE_STATIC" OFF)
+cmake_dependent_option(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY
+  "Statically link the LLVM unwinder to shared library" ON
+  "LIBCXXABI_ENABLE_STATIC_UNWINDER;LIBCXXABI_ENABLE_SHARED" OFF)
+
 option(LIBCXXABI_BAREMETAL "Build libc++abi for baremetal targets." OFF)
 # The default terminate handler attempts to demangle uncaught exceptions, which
 # causes extra I/O and demangling code to be pulled in.

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=337814&r1=337813&r2=337814&view=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Tue Jul 24 00:06:17 2018
@@ -61,12 +61,19 @@ if (LIBCXXABI_USE_LLVM_UNWINDER)
   # Prefer using the in-tree version of libunwind, either shared or static. If
   # none are found fall back to using -lunwind.
   # FIXME: Is it correct to prefer the static version of libunwind?
-  if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR 
HAVE_LIBUNWIND))
-list(APPEND LIBCXXABI_LIBRARIES unwind_shared)
-  elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR 
HAVE_LIBUNWIND))
-list(APPEND LIBCXXABI_LIBRARIES unwind_static)
+  if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET 
unwind_shared OR HAVE_LIBUNWIND))
+list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind_shared)
+  elseif (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET 
unwind_static OR HAVE_LIBUNWIND))
+list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind_static)
   else()
-list(APPEND LIBCXXABI_LIBRARIES unwind)
+list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind)
+  endif()
+  if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY AND (TARGET 
unwind_shared OR HAVE_LIBUNWIND))
+list(APPEND LIBCXXABI_STATIC_LIBRARIES unwind_shared)
+  elseif (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY AND (TARGET 
unwind_static OR HAVE_LIBUNWIND))
+  # We handle this by directly merging libunwind objects into libc++abi.
+  else()
+list(APPEND LIBCXXABI_STATIC_LIBRARIES unwind)
   endif()
 else()
   add_library_flags_if(LIBCXXABI_HAS_GCC_S_LIB gcc_s)
@@ -130,7 +137,7 @@ if (LIBCXXABI_ENABLE_SHARED)
   if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(cxxabi_shared)
   endif()
-  target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})
+  target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES} 
${LIBCXXABI_SHARED_LIBRARIES})
   set_target_properties(cxxabi_shared
 PROPERTIES
   CXX_EXTENSIONS
@@ -155,13 +162,13 @@ endif()
 # Build the static library.
 if (LIBCXXABI_ENABLE_STATIC)
   set(cxxabi_static_sources $)
-  if (LIBCXXABI_USE_LLVM_UNWINDER AND LIBCXXABI_ENABLE_STATIC_UNWINDER)
+  if (LIBCXXABI_USE_LLVM_UNWINDER AND 
LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY)
 if (TARGET unwind_static OR HAVE_LIBUNWIND)
   list(APPEND cxxabi_static_sources $)
 endif()
   endif()
   add_library(cxxabi_static STATIC ${cxxabi_static_sources})
-  target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES})
+  target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES} 
${LIBCXXABI_STATIC_LIBRARIES})
   set_target_properties(cxxabi_static
 PROPERTIES
   CXX_EXTENSIONS


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


[libcxx] r337833 - [CMake] Fix the setting of LIBCXX_HEADER_DIR in standalone build

2018-07-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 24 08:49:29 2018
New Revision: 337833

URL: http://llvm.org/viewvc/llvm-project?rev=337833&view=rev
Log:
[CMake] Fix the setting of LIBCXX_HEADER_DIR in standalone build

This is an alternative approach to r337727 which broke the build
because libc++ headers were copied into the location outside of
directories used by Clang. This change sets LIBCXX_HEADER_DIR to
different values depending on whether libc++ is being built as
part of LLVM w/ per-target multiarch runtime, LLVM or standalone.

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

Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=337833&r1=337832&r2=337833&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Tue Jul 24 08:49:29 2018
@@ -386,7 +386,6 @@ endif ()
 set(LIBCXX_COMPILER${CMAKE_CXX_COMPILER})
 set(LIBCXX_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXX_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
-set(LIBCXX_HEADER_DIR  ${LLVM_BINARY_DIR})
 set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
 
 string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
@@ -399,8 +398,10 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AN
   set(LIBCXX_HEADER_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION})
 elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
   set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+  set(LIBCXX_HEADER_DIR  ${LLVM_BINARY_DIR})
 else()
   set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
+  set(LIBCXX_HEADER_DIR  ${CMAKE_BINARY_DIR})
 endif()
 
 file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=337833&r1=337832&r2=337833&view=diff
==
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Tue Jul 24 08:49:29 2018
@@ -48,12 +48,14 @@ macro(setup_abi_lib abidefines abilib ab
 COMMENT "Copying C++ ABI header ${fpath}...")
 list(APPEND abilib_headers "${dst}")
 
-set(dst "${LIBCXX_HEADER_DIR}/include/c++/v1/${dstdir}/${fpath}")
-add_custom_command(OUTPUT ${dst}
-DEPENDS ${src}
-COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
-COMMENT "Copying C++ ABI header ${fpath}...")
-list(APPEND abilib_headers "${dst}")
+if (NOT LIBCXX_USING_INSTALLED_LLVM)
+  set(dst "${LIBCXX_HEADER_DIR}/include/c++/v1/${dstdir}/${fpath}")
+  add_custom_command(OUTPUT ${dst}
+  DEPENDS ${src}
+  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+  COMMENT "Copying C++ ABI header ${fpath}...")
+  list(APPEND abilib_headers "${dst}")
+endif()
 
 if (LIBCXX_INSTALL_HEADERS)
   install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"


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


[libcxx] r337867 - [CMake] Option to control whether shared/static library is installed

2018-07-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 24 16:27:51 2018
New Revision: 337867

URL: http://llvm.org/viewvc/llvm-project?rev=337867&view=rev
Log:
[CMake] Option to control whether shared/static library is installed

Currently it's only possible to control whether shared or static library
build of libc++, libc++abi and libunwind is enabled or disabled and
whether to install everything we've built or not. However, it'd be
useful to have more fine grained control, e.g. when static libraries are
merged together into libc++.a we don't need to install libc++abi.a and
libunwind.a. This change adds this option.

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

Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=337867&r1=337866&r2=337867&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Tue Jul 24 16:27:51 2018
@@ -93,6 +93,12 @@ set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_
 "Define suffix of library directory name (32/64)")
 option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON)
 option(LIBCXX_INSTALL_LIBRARY "Install the libc++ library." ON)
+cmake_dependent_option(LIBCXX_INSTALL_STATIC_LIBRARY
+  "Install the static libc++ library." ON
+  "LIBCXX_ENABLE_STATIC;LIBCXX_INSTALL_LIBRARY" OFF)
+cmake_dependent_option(LIBCXX_INSTALL_SHARED_LIBRARY
+  "Install the shared libc++ library." ON
+  "LIBCXX_ENABLE_SHARED;LIBCXX_INSTALL_LIBRARY" OFF)
 option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON)
 cmake_dependent_option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY
 "Install libc++experimental.a" ON

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=337867&r1=337866&r2=337867&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Tue Jul 24 16:27:51 2018
@@ -220,8 +220,6 @@ set_target_properties(cxx_objects
 COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
 )
 
-set(LIBCXX_TARGETS)
-
 # Build the shared library.
 if (LIBCXX_ENABLE_SHARED)
   add_library(cxx_shared SHARED $)
@@ -236,7 +234,10 @@ if (LIBCXX_ENABLE_SHARED)
   VERSION   "${LIBCXX_ABI_VERSION}.0"
   SOVERSION "${LIBCXX_ABI_VERSION}"
   )
-  list(APPEND LIBCXX_TARGETS "cxx_shared")
+  list(APPEND LIBCXX_BUILD_TARGETS "cxx_shared")
+  if (LIBCXX_INSTALL_SHARED_LIBRARY)
+list(APPEND LIBCXX_INSTALL_TARGETS "cxx_shared")
+  endif()
   if(WIN32 AND NOT MINGW AND NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL 
"Windows")
 # Since we most likely do not have a mt.exe replacement, disable the
 # manifest bundling.  This allows a normal cmake invocation to pass which
@@ -256,8 +257,10 @@ if (LIBCXX_ENABLE_STATIC)
   LINK_FLAGS"${LIBCXX_LINK_FLAGS}"
   OUTPUT_NAME   "c++"
   )
-
-  list(APPEND LIBCXX_TARGETS "cxx_static")
+  list(APPEND LIBCXX_BUILD_TARGETS "cxx_static")
+  if (LIBCXX_INSTALL_STATIC_LIBRARY)
+list(APPEND LIBCXX_INSTALL_TARGETS "cxx_static")
+  endif()
   # Attempt to merge the libc++.a archive and the ABI library archive into one.
   if (LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY)
 set(MERGE_ARCHIVES_SEARCH_PATHS "")
@@ -286,7 +289,7 @@ if (LIBCXX_ENABLE_STATIC)
 endif()
 
 # Add a meta-target for both libraries.
-add_custom_target(cxx DEPENDS cxx-headers ${LIBCXX_TARGETS})
+add_custom_target(cxx DEPENDS cxx-headers ${LIBCXX_BUILD_TARGETS})
 
 if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
   file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)
@@ -362,7 +365,7 @@ if (LIBCXX_INSTALL_LIBRARY)
   if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
 set(experimental_lib cxx_experimental)
   endif()
-  install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib}
+  install(TARGETS ${LIBCXX_INSTALL_TARGETS} ${experimental_lib}
 LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} 
COMPONENT cxx
 ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} 
COMPONENT cxx
 )


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


[libunwind] r337867 - [CMake] Option to control whether shared/static library is installed

2018-07-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 24 16:27:51 2018
New Revision: 337867

URL: http://llvm.org/viewvc/llvm-project?rev=337867&view=rev
Log:
[CMake] Option to control whether shared/static library is installed

Currently it's only possible to control whether shared or static library
build of libc++, libc++abi and libunwind is enabled or disabled and
whether to install everything we've built or not. However, it'd be
useful to have more fine grained control, e.g. when static libraries are
merged together into libc++.a we don't need to install libc++abi.a and
libunwind.a. This change adds this option.

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

Modified:
libunwind/trunk/CMakeLists.txt
libunwind/trunk/src/CMakeLists.txt

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=337867&r1=337866&r2=337867&view=diff
==
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Tue Jul 24 16:27:51 2018
@@ -137,6 +137,12 @@ option(LIBUNWIND_INCLUDE_DOCS "Build the
 set(LIBUNWIND_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
 "Define suffix of library directory name (32/64)")
 option(LIBUNWIND_INSTALL_LIBRARY "Install the libunwind library." ON)
+cmake_dependent_option(LIBUNWIND_INSTALL_STATIC_LIBRARY
+  "Install the static libunwind library." ON
+  "LIBUNWIND_ENABLE_STATIC;LIBUNWIND_INSTALL_LIBRARY" OFF)
+cmake_dependent_option(LIBUNWIND_INSTALL_SHARED_LIBRARY
+  "Install the shared libunwind library." ON
+  "LIBUNWIND_ENABLE_SHARED;LIBUNWIND_INSTALL_LIBRARY" OFF)
 set(LIBUNWIND_TARGET_TRIPLE "" CACHE STRING "Target triple for cross 
compiling.")
 set(LIBUNWIND_GCC_TOOLCHAIN "" CACHE PATH "GCC toolchain for cross compiling.")
 set(LIBUNWIND_SYSROOT "" CACHE PATH "Sysroot for cross compiling.")

Modified: libunwind/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CMakeLists.txt?rev=337867&r1=337866&r2=337867&view=diff
==
--- libunwind/trunk/src/CMakeLists.txt (original)
+++ libunwind/trunk/src/CMakeLists.txt Tue Jul 24 16:27:51 2018
@@ -103,8 +103,6 @@ set_target_properties(unwind_objects
 COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}"
 POSITION_INDEPENDENT_CODE ON)
 
-set(LIBUNWIND_TARGETS)
-
 # Build the shared library.
 if (LIBUNWIND_ENABLE_SHARED)
   add_library(unwind_shared SHARED $)
@@ -118,7 +116,10 @@ if (LIBUNWIND_ENABLE_SHARED)
   OUTPUT_NAME   "unwind"
   VERSION   "1.0"
   SOVERSION "1")
-  list(APPEND LIBUNWIND_TARGETS "unwind_shared")
+  list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_shared")
+  if (LIBUNWIND_INSTALL_SHARED_LIBRARY)
+list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_shared")
+  endif()
 endif()
 
 # Build the static library.
@@ -129,14 +130,17 @@ if (LIBUNWIND_ENABLE_STATIC)
 PROPERTIES
   LINK_FLAGS"${LIBUNWIND_LINK_FLAGS}"
   OUTPUT_NAME   "unwind")
-  list(APPEND LIBUNWIND_TARGETS "unwind_static")
+  list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_static")
+  if (LIBUNWIND_INSTALL_STATIC_LIBRARY)
+list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_static")
+  endif()
 endif()
 
 # Add a meta-target for both libraries.
-add_custom_target(unwind DEPENDS ${LIBUNWIND_TARGETS})
+add_custom_target(unwind DEPENDS ${LIBUNWIND_BUILD_TARGETS})
 
 if (LIBUNWIND_INSTALL_LIBRARY)
-  install(TARGETS ${LIBUNWIND_TARGETS}
+  install(TARGETS ${LIBUNWIND_INSTALL_TARGETS}
 LIBRARY DESTINATION 
${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind
 ARCHIVE DESTINATION 
${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind)
 endif()


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


[libcxxabi] r337867 - [CMake] Option to control whether shared/static library is installed

2018-07-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 24 16:27:51 2018
New Revision: 337867

URL: http://llvm.org/viewvc/llvm-project?rev=337867&view=rev
Log:
[CMake] Option to control whether shared/static library is installed

Currently it's only possible to control whether shared or static library
build of libc++, libc++abi and libunwind is enabled or disabled and
whether to install everything we've built or not. However, it'd be
useful to have more fine grained control, e.g. when static libraries are
merged together into libc++.a we don't need to install libc++abi.a and
libunwind.a. This change adds this option.

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

Modified:
libcxxabi/trunk/CMakeLists.txt
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CMakeLists.txt?rev=337867&r1=337866&r2=337867&view=diff
==
--- libcxxabi/trunk/CMakeLists.txt (original)
+++ libcxxabi/trunk/CMakeLists.txt Tue Jul 24 16:27:51 2018
@@ -75,6 +75,13 @@ set(LIBCXXABI_GCC_TOOLCHAIN "" CACHE PAT
 set(LIBCXXABI_SYSROOT "" CACHE PATH "Sysroot for cross compiling.")
 set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CACHE PATH "The path to libc++ library.")
 
+cmake_dependent_option(LIBCXXABI_INSTALL_STATIC_LIBRARY
+  "Install the static libc++abi library." ON
+  "LIBCXXABI_ENABLE_STATIC;LIBCXXABI_INSTALL_LIBRARY" OFF)
+cmake_dependent_option(LIBCXXABI_INSTALL_SHARED_LIBRARY
+  "Install the shared libc++abi library." ON
+  "LIBCXXABI_ENABLE_SHARED;LIBCXXABI_INSTALL_LIBRARY" OFF)
+
 # Default to building a shared library so that the default options still test
 # the libc++abi that is being built. There are two problems with testing a
 # static libc++abi. In the case of a standalone build, the tests will link the

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=337867&r1=337866&r2=337867&view=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Tue Jul 24 16:27:51 2018
@@ -129,8 +129,6 @@ set_target_properties(cxxabi_objects
 POSITION_INDEPENDENT_CODE
   ON)
 
-set(LIBCXXABI_TARGETS)
-
 # Build the shared library.
 if (LIBCXXABI_ENABLE_SHARED)
   add_library(cxxabi_shared SHARED $)
@@ -156,7 +154,10 @@ if (LIBCXXABI_ENABLE_SHARED)
 "1"
   VERSION
 "1.0")
-  list(APPEND LIBCXXABI_TARGETS "cxxabi_shared")
+  list(APPEND LIBCXXABI_BUILD_TARGETS "cxxabi_shared")
+  if (LIBCXXABI_INSTALL_SHARED_LIBRARY)
+list(APPEND LIBCXXABI_INSTALL_TARGETS "cxxabi_shared")
+  endif()
 endif()
 
 # Build the static library.
@@ -183,14 +184,17 @@ if (LIBCXXABI_ENABLE_STATIC)
 "c++abi"
   POSITION_INDEPENDENT_CODE
 ON)
-  list(APPEND LIBCXXABI_TARGETS "cxxabi_static")
+  list(APPEND LIBCXXABI_BUILD_TARGETS "cxxabi_static")
+  if (LIBCXXABI_INSTALL_STATIC_LIBRARY)
+list(APPEND LIBCXXABI_INSTALL_TARGETS "cxxabi_static")
+  endif()
 endif()
 
 # Add a meta-target for both libraries.
-add_custom_target(cxxabi DEPENDS ${LIBCXXABI_TARGETS})
+add_custom_target(cxxabi DEPENDS ${LIBCXXABI_BUILD_TARGETS})
 
 if (LIBCXXABI_INSTALL_LIBRARY)
-  install(TARGETS ${LIBCXXABI_TARGETS}
+  install(TARGETS ${LIBCXXABI_INSTALL_TARGETS}
 LIBRARY DESTINATION 
${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
 ARCHIVE DESTINATION 
${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
 )


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


[libunwind] r337868 - [CMake] Include CMakeDependentOption in libunwind

2018-07-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 24 16:42:51 2018
New Revision: 337868

URL: http://llvm.org/viewvc/llvm-project?rev=337868&view=rev
Log:
[CMake] Include CMakeDependentOption in libunwind

This should resolve the breakage introduced in r337867 which introduced
the use of cmake_dependent_option without include the necessary file.

Modified:
libunwind/trunk/CMakeLists.txt

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=337868&r1=337867&r2=337868&view=diff
==
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Tue Jul 24 16:42:51 2018
@@ -119,6 +119,7 @@ endif()
 
#===
 # Setup CMake Options
 
#===
+include(CMakeDependentOption)
 include(HandleCompilerRT)
 
 # Define options.


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


r337877 - [CMake] Link static libunwind and libc++abi into libc++ in Fuchsia toolchain

2018-07-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 24 18:44:22 2018
New Revision: 337877

URL: http://llvm.org/viewvc/llvm-project?rev=337877&view=rev
Log:
[CMake] Link static libunwind and libc++abi into libc++ in Fuchsia toolchain

When building libc++ for Fuchsia, we want to distribute shared libc++,
libc++abi and libunwind as separate libraries, but for static versions
we would like to link all of them into libc++ so -lc++ flag has the same
effect whether shared or static library is being used.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=337877&r1=337876&r2=337877&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue Jul 24 18:44:22 2018
@@ -100,9 +100,15 @@ if(FUCHSIA_SDK)
 set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} 
CACHE PATH "")
 set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+set(RUNTIMES_${target}-fuchsia_LIBUNWIND_INSTALL_STATIC_LIBRARY OFF CACHE 
BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL 
"")
+set(RUNTIMES_${target}-fuchsia_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE 
BOOL "")
+set(RUNTIMES_${target}-fuchsia_LIBCXXABI_INSTALL_STATIC_LIBRARY OFF CACHE 
BOOL "")
+
set(RUNTIMES_${target}-fuchsia_LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY
 OFF CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+set(RUNTIMES_${target}-fuchsia_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE 
BOOL "")
+
set(RUNTIMES_${target}-fuchsia_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF 
CACHE BOOL "")
   endforeach()
 
   set(LLVM_RUNTIME_SANITIZERS "Address" CACHE STRING "")


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


r337881 - [profile] Support profiling runtime on Fuchsia

2018-07-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 24 20:01:35 2018
New Revision: 337881

URL: http://llvm.org/viewvc/llvm-project?rev=337881&view=rev
Log:
[profile] Support profiling runtime on Fuchsia

This ports the profiling runtime on Fuchsia and enables the
instrumentation. Unlike on other platforms, Fuchsia doesn't use
files to dump the instrumentation data since on Fuchsia, filesystem
may not be accessible to the instrumented process. We instead use
the data sink to pass the profiling data to the system the same
sanitizer runtimes do.

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

Modified:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=337881&r1=337880&r2=337881&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Tue Jul 24 20:01:35 2018
@@ -109,6 +109,7 @@ void fuchsia::Linker::ConstructJob(Compi
   addSanitizerRuntimes(ToolChain, Args, CmdArgs);
 
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
+  ToolChain.addProfileRTLibs(Args, CmdArgs);
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
 if (Args.hasArg(options::OPT_static))


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


[libcxxabi] r337937 - [CMake] Use LIBCXXABI_LIBDIR_SUFFIX in libc++abi build

2018-07-25 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jul 25 09:51:00 2018
New Revision: 337937

URL: http://llvm.org/viewvc/llvm-project?rev=337937&view=rev
Log:
[CMake] Use LIBCXXABI_LIBDIR_SUFFIX in libc++abi build

This was changed unintentionally in r335809.

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

Modified:
libcxxabi/trunk/CMakeLists.txt

Modified: libcxxabi/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CMakeLists.txt?rev=337937&r1=337936&r2=337937&view=diff
==
--- libcxxabi/trunk/CMakeLists.txt (original)
+++ libcxxabi/trunk/CMakeLists.txt Wed Jul 25 09:51:00 2018
@@ -179,7 +179,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AN
 elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
   set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
 else()
-  set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
+  set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX})
 endif()
 
 set(LIBCXXABI_INSTALL_PREFIX ${DEFAULT_INSTALL_PREFIX} CACHE STRING


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


[libcxx] r337979 - [CMake] Don't install c++abi headers in standalone libc++ build

2018-07-25 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jul 25 15:57:39 2018
New Revision: 337979

URL: http://llvm.org/viewvc/llvm-project?rev=337979&view=rev
Log:
[CMake] Don't install c++abi headers in standalone libc++ build

This is a refinement on r337833. Previously we were installing two
copies of c++abi headers in libc++ build directory, one in
include/c++build and another one in include/c++/v1. However, the
second copy is unnecessary when building libc++ standalone.

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

Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
libcxx/trunk/include/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=337979&r1=337978&r2=337979&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Wed Jul 25 15:57:39 2018
@@ -407,7 +407,6 @@ elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
   set(LIBCXX_HEADER_DIR  ${LLVM_BINARY_DIR})
 else()
   set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
-  set(LIBCXX_HEADER_DIR  ${CMAKE_BINARY_DIR})
 endif()
 
 file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=337979&r1=337978&r2=337979&view=diff
==
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Wed Jul 25 15:57:39 2018
@@ -48,7 +48,7 @@ macro(setup_abi_lib abidefines abilib ab
 COMMENT "Copying C++ ABI header ${fpath}...")
 list(APPEND abilib_headers "${dst}")
 
-if (NOT LIBCXX_USING_INSTALLED_LLVM)
+if (NOT LIBCXX_USING_INSTALLED_LLVM AND LIBCXX_HEADER_DIR)
   set(dst "${LIBCXX_HEADER_DIR}/include/c++/v1/${dstdir}/${fpath}")
   add_custom_command(OUTPUT ${dst}
   DEPENDS ${src}

Modified: libcxx/trunk/include/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/CMakeLists.txt?rev=337979&r1=337978&r2=337979&view=diff
==
--- libcxx/trunk/include/CMakeLists.txt (original)
+++ libcxx/trunk/include/CMakeLists.txt Wed Jul 25 15:57:39 2018
@@ -205,7 +205,7 @@ else()
 )
 endif()
 
-if(NOT LIBCXX_USING_INSTALLED_LLVM AND LLVM_BINARY_DIR)
+if(NOT LIBCXX_USING_INSTALLED_LLVM AND LIBCXX_HEADER_DIR)
   set(output_dir ${LIBCXX_HEADER_DIR}/include/c++/v1)
 
   set(out_files)


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


[libcxx] r338006 - [CMake] Don't generate linker script only when shared library isn't statically linked

2018-07-25 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jul 25 22:10:24 2018
New Revision: 338006

URL: http://llvm.org/viewvc/llvm-project?rev=338006&view=rev
Log:
[CMake] Don't generate linker script only when shared library isn't statically 
linked

Since r337668, we support statically linking dependencies only to shared
or static library. However, that change hasn't updated the check whether
to generate a linker script. We shouldn't generate linker script only in
the case when we aren't statically linked ABI into the shared library.

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

Modified:
libcxx/trunk/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=338006&r1=338005&r2=338006&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Wed Jul 25 22:10:24 2018
@@ -179,7 +179,7 @@ cmake_dependent_option(LIBCXX_STATICALLY
 # is on. This option is also disabled when the ABI library is not specified
 # or is specified to be "none".
 set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
-if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY
+if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT 
LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY
   AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"
   AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "default"
   AND PYTHONINTERP_FOUND
@@ -374,7 +374,7 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
 endif()
 endif()
 
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY AND 
LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
 message(FATAL_ERROR "Conflicting options given.
 LIBCXX_ENABLE_STATIC_ABI_LIBRARY cannot be specified with
 LIBCXX_ENABLE_ABI_LINKER_SCRIPT")


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


r338482 - [OpenEmbedded] Explicitly specify -rtlib in tests

2018-07-31 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jul 31 20:30:06 2018
New Revision: 338482

URL: http://llvm.org/viewvc/llvm-project?rev=338482&view=rev
Log:
[OpenEmbedded] Explicitly specify -rtlib in tests

Tests added in r338294 implicitly assume that libgcc is the runtime library,
but that's not the case when the user configures Clang to use compiler-rt in
which case these tests will break. Explicitly request libgcc when invoking
clang in these tests to avoid that.

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

Modified:
cfe/trunk/test/Driver/linux-ld.c

Modified: cfe/trunk/test/Driver/linux-ld.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=338482&r1=338481&r2=338482&view=diff
==
--- cfe/trunk/test/Driver/linux-ld.c (original)
+++ cfe/trunk/test/Driver/linux-ld.c Tue Jul 31 20:30:06 2018
@@ -1816,7 +1816,7 @@
 
 // Check whether the OpenEmbedded ARM libs are added correctly.
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: --target=arm-oe-linux-gnueabi \
+// RUN: --target=arm-oe-linux-gnueabi -rtlib=libgcc \
 // RUN: --sysroot=%S/Inputs/openembedded_arm_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-OE-ARM %s
 
@@ -1835,7 +1835,7 @@
 
 // Check whether the OpenEmbedded AArch64 libs are added correctly.
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: --target=aarch64-oe-linux \
+// RUN: --target=aarch64-oe-linux -rtlib=libgcc \
 // RUN: --sysroot=%S/Inputs/openembedded_aarch64_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-OE-AARCH64 %s
 


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


[clang-tools-extra] r325381 - [clang-include-fixer] Use add_clang_tool instead add_clang_executable

2018-02-16 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri Feb 16 12:25:45 2018
New Revision: 325381

URL: http://llvm.org/viewvc/llvm-project?rev=325381&view=rev
Log:
[clang-include-fixer] Use add_clang_tool instead add_clang_executable

This makes it possible to include clang-include-fixer as distribution
component when building Clang based toolchain using CMake.

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

Modified:
clang-tools-extra/trunk/include-fixer/tool/CMakeLists.txt

Modified: clang-tools-extra/trunk/include-fixer/tool/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/tool/CMakeLists.txt?rev=325381&r1=325380&r2=325381&view=diff
==
--- clang-tools-extra/trunk/include-fixer/tool/CMakeLists.txt (original)
+++ clang-tools-extra/trunk/include-fixer/tool/CMakeLists.txt Fri Feb 16 
12:25:45 2018
@@ -1,6 +1,6 @@
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
 
-add_clang_executable(clang-include-fixer
+add_clang_tool(clang-include-fixer
   ClangIncludeFixer.cpp
   )
 


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


r325665 - [Fuchsia] Include libClang and clang-include-fixer in the toolchain

2018-02-20 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Feb 20 20:39:15 2018
New Revision: 325665

URL: http://llvm.org/viewvc/llvm-project?rev=325665&view=rev
Log:
[Fuchsia] Include libClang and clang-include-fixer in the toolchain

libClang is used by other Clang based tools such as cquery while
clang-include-fixer is generally a useful tool.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=325665&r1=325664&r2=325665&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue Feb 20 20:39:15 2018
@@ -79,10 +79,12 @@ set(LLVM_TOOLCHAIN_TOOLS
 
 set(LLVM_DISTRIBUTION_COMPONENTS
   clang
+  libclang
   lld
   LTO
   clang-format
   clang-headers
+  clang-include-fixer
   clang-refactor
   clang-tidy
   clangd


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


r325945 - [Driver] Make -fno-common default for Fuchsia

2018-02-23 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri Feb 23 12:10:14 2018
New Revision: 325945

URL: http://llvm.org/viewvc/llvm-project?rev=325945&view=rev
Log:
[Driver] Make -fno-common default for Fuchsia

We never want to generate common symbols on Fuchsia.

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

Modified:
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/test/Driver/fuchsia.c

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=325945&r1=325944&r2=325945&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Fri Feb 23 12:10:14 2018
@@ -1306,6 +1306,8 @@ static bool isSignedCharDefault(const ll
 static bool isNoCommonDefault(const llvm::Triple &Triple) {
   switch (Triple.getArch()) {
   default:
+if (Triple.isOSFuchsia())
+  return true;
 return false;
 
   case llvm::Triple::xcore:

Modified: cfe/trunk/test/Driver/fuchsia.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.c?rev=325945&r1=325944&r2=325945&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Fri Feb 23 12:10:14 2018
@@ -10,6 +10,7 @@
 // CHECK: "-fuse-init-array"
 // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
 // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|}}include"
+// CHECK: "-fno-common"
 // CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
 // CHECK: "--sysroot=[[SYSROOT]]"
 // CHECK: "-pie"


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


r326151 - [Driver] Add SafeStack to a map of incompatible sanitizers

2018-02-26 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Feb 26 16:01:26 2018
New Revision: 326151

URL: http://llvm.org/viewvc/llvm-project?rev=326151&view=rev
Log:
[Driver] Add SafeStack to a map of incompatible sanitizers

This allows reporting an error when user tries to use SafeStack with
incompatible sanitizers.

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

Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp
cfe/trunk/test/Driver/fsanitize.c

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=326151&r1=326150&r2=326151&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Mon Feb 26 16:01:26 2018
@@ -378,7 +378,9 @@ SanitizerArgs::SanitizerArgs(const ToolC
   std::make_pair(Efficiency, Address | HWAddress | Leak | Thread | Memory |
  KernelAddress),
   std::make_pair(Scudo, Address | HWAddress | Leak | Thread | Memory |
-KernelAddress | Efficiency)};
+KernelAddress | Efficiency),
+  std::make_pair(SafeStack, Address | HWAddress | Leak | Thread | Memory |
+KernelAddress | Efficiency)};
   for (auto G : IncompatibleGroups) {
 SanitizerMask Group = G.first;
 if (Kinds & Group) {

Modified: cfe/trunk/test/Driver/fsanitize.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fsanitize.c?rev=326151&r1=326150&r2=326151&view=diff
==
--- cfe/trunk/test/Driver/fsanitize.c (original)
+++ cfe/trunk/test/Driver/fsanitize.c Mon Feb 26 16:01:26 2018
@@ -526,7 +526,7 @@
 // NOSP-NOT: "-fsanitize=safe-stack"
 
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | 
FileCheck %s -check-prefix=NO-SP
-// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 
2>&1 | FileCheck %s -check-prefix=NO-SP-ASAN
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 
2>&1 | FileCheck %s -check-prefix=SP-ASAN
 // RUN: %clang -target x86_64-linux-gnu -fstack-protector 
-fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack 
-fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP
 // RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 
2>&1 | FileCheck %s -check-prefix=NO-SP
@@ -534,14 +534,11 @@
 // RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 
| FileCheck %s -check-prefix=NO-SP
 // NO-SP-NOT: stack-protector
 // NO-SP: "-fsanitize=safe-stack"
+// SP-ASAN: error: invalid argument '-fsanitize=safe-stack' not allowed with 
'-fsanitize=address'
 // SP: "-fsanitize=safe-stack"
 // SP: -stack-protector
 // NO-SP-NOT: stack-protector
 
-// NO-SP-ASAN-NOT: stack-protector
-// NO-SP-ASAN: "-fsanitize=address,safe-stack"
-// NO-SP-ASAN-NOT: stack-protector
-
 // RUN: %clang -target powerpc64-unknown-linux-gnu -fsanitize=memory %s -### 
2>&1 | FileCheck %s -check-prefix=CHECK-SANM
 // RUN: %clang -target powerpc64le-unknown-linux-gnu -fsanitize=memory %s -### 
2>&1 | FileCheck %s -check-prefix=CHECK-SANM
 // CHECK-SANM: "-fsanitize=memory"


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


r304025 - [scan-build] Patch to scan-build tool to support "--target=" flag

2017-05-26 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri May 26 14:25:32 2017
New Revision: 304025

URL: http://llvm.org/viewvc/llvm-project?rev=304025&view=rev
Log:
[scan-build] Patch to scan-build tool to support "--target=" flag

The scan-build script provided by clang can be used to detect defects in
code in the compile time. However, we discovered that the
"--target=" flag in clang is not properly handled by this script,
which results in failures when analyzing projects that have used this
flag in their makefile.

This single line of change allows scan-build script to properly handle
the "--target=" flag.

Patch by Haowei Wu

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

Modified:
cfe/trunk/tools/scan-build/libexec/ccc-analyzer

Modified: cfe/trunk/tools/scan-build/libexec/ccc-analyzer
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/libexec/ccc-analyzer?rev=304025&r1=304024&r2=304025&view=diff
==
--- cfe/trunk/tools/scan-build/libexec/ccc-analyzer (original)
+++ cfe/trunk/tools/scan-build/libexec/ccc-analyzer Fri May 26 14:25:32 2017
@@ -385,7 +385,8 @@ my %CompilerLinkerOptionMap = (
   '-target' => 1,
   '-v' => 0,
   '-mmacosx-version-min' => 0, # This is really a 1 argument, but always has 
'='
-  '-miphoneos-version-min' => 0 # This is really a 1 argument, but always has 
'='
+  '-miphoneos-version-min' => 0, # This is really a 1 argument, but always has 
'='
+  '--target' => 0
 );
 
 my %IgnoredOptionMap = (


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


r305600 - [Driver] Do a PATH lookup if needed when using -no-canonical-prefixes

2017-06-16 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri Jun 16 17:40:18 2017
New Revision: 305600

URL: http://llvm.org/viewvc/llvm-project?rev=305600&view=rev
Log:
[Driver] Do a PATH lookup if needed when using -no-canonical-prefixes

When -no-canonical-prefixes option is used and argv0 contains only
a program name, we need to do a PATH lookup to get an executable path,
otherwise the return value won't be a valid path and any subsequent
uses of it (e.g. when invoking -cc1) will fail with an error.

This patch fixes PR9576.

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

Modified:
cfe/trunk/tools/driver/driver.cpp

Modified: cfe/trunk/tools/driver/driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=305600&r1=305599&r2=305600&view=diff
==
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Fri Jun 16 17:40:18 2017
@@ -53,8 +53,15 @@ using namespace clang::driver;
 using namespace llvm::opt;
 
 std::string GetExecutablePath(const char *Argv0, bool CanonicalPrefixes) {
-  if (!CanonicalPrefixes)
-return Argv0;
+  if (!CanonicalPrefixes) {
+SmallString<128> ExecutablePath(Argv0);
+// Do a PATH lookup if Argv0 isn't a valid path.
+if (!llvm::sys::fs::exists(ExecutablePath))
+  if (llvm::ErrorOr P =
+  llvm::sys::findProgramByName(ExecutablePath))
+ExecutablePath = *P;
+return ExecutablePath.str();
+  }
 
   // This just needs to be some symbol in the binary; C++ doesn't
   // allow taking the address of ::main however.


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


r321314 - [scudo] Add -fsanitize=scudo option to Fuchsia

2017-12-21 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Thu Dec 21 14:04:31 2017
New Revision: 321314

URL: http://llvm.org/viewvc/llvm-project?rev=321314&view=rev
Log:
[scudo] Add -fsanitize=scudo option to Fuchsia

Apparently the -fsanitize flag hadn't been added for Scudo upstream yet.

Patch By: flowerhack

Reviewers: cryptoad, alekseyshl, mcgrathr, phosek

Reviewed By: mcgrathr, phosek

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

Modified:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/test/Driver/fuchsia.c

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=321314&r1=321313&r2=321314&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Thu Dec 21 14:04:31 2017
@@ -280,5 +280,6 @@ SanitizerMask Fuchsia::getSupportedSanit
   SanitizerMask Res = ToolChain::getSupportedSanitizers();
   Res |= SanitizerKind::SafeStack;
   Res |= SanitizerKind::Address;
+  Res |= SanitizerKind::Scudo;
   return Res;
 }

Modified: cfe/trunk/test/Driver/fuchsia.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.c?rev=321314&r1=321313&r2=321314&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Thu Dec 21 14:04:31 2017
@@ -79,3 +79,20 @@
 // CHECK-ASAN-SHARED: "-fsanitize-address-globals-dead-stripping"
 // CHECK-ASAN-SHARED: "{{.*[/\\]}}libclang_rt.asan-x86_64.so"
 // CHECK-ASAN-SHARED-NOT: "{{.*[/\\]}}libclang_rt.asan-preinit-x86_64.a"
+
+// RUN: %clang %s -### --target=x86_64-fuchsia \
+// RUN: -fsanitize=scudo 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-X86
+// CHECK-SCUDO-X86: "-fsanitize=scudo"
+// CHECK-SCUDO-X86: "-pie"
+
+// RUN: %clang %s -### --target=aarch64-fuchsia \
+// RUN: -fsanitize=scudo 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-AARCH64
+// CHECK-SCUDO-AARCH64: "-fsanitize=scudo"
+// CHECK-SCUDO-AARCH64: "-pie"
+
+// RUN: %clang %s -### --target=x86_64-fuchsia \
+// RUN: -fsanitize=scudo -fPIC -shared 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-SHARED
+// CHECK-SCUDO-SHARED: "-fsanitize=scudo"


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


r321316 - [CMake][Fuchsia] Enable assertions

2017-12-21 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Thu Dec 21 14:10:27 2017
New Revision: 321316

URL: http://llvm.org/viewvc/llvm-project?rev=321316&view=rev
Log:
[CMake][Fuchsia] Enable assertions

Enable assertions in both stages.
Release+Asserts is fast enough.
No need to let insanity through.

Patch By: mcgrathr

Reviewers: phosek

Reviewed By: phosek

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
cfe/trunk/cmake/caches/Fuchsia.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=321316&r1=321315&r2=321316&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Thu Dec 21 14:10:27 2017
@@ -23,6 +23,7 @@ if(APPLE)
   set(LLDB_CODESIGN_IDENTITY "" CACHE STRING "")
 endif()
 
+set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")

Modified: cfe/trunk/cmake/caches/Fuchsia.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia.cmake?rev=321316&r1=321315&r2=321316&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia.cmake Thu Dec 21 14:10:27 2017
@@ -13,6 +13,7 @@ set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL
 set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
 set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
 
+set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
 set(CMAKE_BUILD_TYPE Release CACHE STRING "")
 
 set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")


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


[libcxx] r322044 - [libcxx] Support the use of compiler-rt in lit tests

2018-01-08 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jan  8 15:36:53 2018
New Revision: 322044

URL: http://llvm.org/viewvc/llvm-project?rev=322044&view=rev
Log:
[libcxx] Support the use of compiler-rt in lit tests

Don't link tests against libgcc when compiler-rt is being used.

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

Modified:
libcxx/trunk/test/CMakeLists.txt
libcxx/trunk/test/lit.site.cfg.in
libcxx/trunk/utils/libcxx/test/target_info.py

Modified: libcxx/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/CMakeLists.txt?rev=322044&r1=322043&r2=322044&view=diff
==
--- libcxx/trunk/test/CMakeLists.txt (original)
+++ libcxx/trunk/test/CMakeLists.txt Mon Jan  8 15:36:53 2018
@@ -30,6 +30,7 @@ pythonize_bool(LIBCXX_BUILD_32_BITS)
 pythonize_bool(LIBCXX_GENERATE_COVERAGE)
 pythonize_bool(LIBCXXABI_ENABLE_SHARED)
 pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
+pythonize_bool(LIBCXX_USE_COMPILER_RT)
 pythonize_bool(LIBCXX_HAS_ATOMIC_LIB)
 pythonize_bool(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB)
 pythonize_bool(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)

Modified: libcxx/trunk/test/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.site.cfg.in?rev=322044&r1=322043&r2=322044&view=diff
==
--- libcxx/trunk/test/lit.site.cfg.in (original)
+++ libcxx/trunk/test/lit.site.cfg.in Mon Jan  8 15:36:53 2018
@@ -24,6 +24,7 @@ config.generate_coverage= "@LIBC
 config.target_info  = "@LIBCXX_TARGET_INFO@"
 config.executor = "@LIBCXX_EXECUTOR@"
 config.llvm_unwinder= "@LIBCXXABI_USE_LLVM_UNWINDER@"
+config.compiler_rt  = "@LIBCXX_USE_COMPILER_RT@"
 config.has_libatomic= "@LIBCXX_HAS_ATOMIC_LIB@"
 config.use_libatomic= "@LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB@"
 config.debug_build  = "@LIBCXX_DEBUG_BUILD@"

Modified: libcxx/trunk/utils/libcxx/test/target_info.py
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/target_info.py?rev=322044&r1=322043&r2=322044&view=diff
==
--- libcxx/trunk/utils/libcxx/test/target_info.py (original)
+++ libcxx/trunk/utils/libcxx/test/target_info.py Mon Jan  8 15:36:53 2018
@@ -234,7 +234,9 @@ class LinuxLocalTI(DefaultTargetInfo):
 flags += ['-lunwind', '-ldl']
 else:
 flags += ['-lgcc_s']
-flags += ['-lgcc']
+compiler_rt = self.full_config.get_lit_bool('compiler_rt', False)
+if not compiler_rt:
+flags += ['-lgcc']
 use_libatomic = self.full_config.get_lit_bool('use_libatomic', False)
 if use_libatomic:
 flags += ['-latomic']


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


r322154 - [Driver] Update default sanitizer blacklist location

2018-01-09 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jan  9 18:12:24 2018
New Revision: 322154

URL: http://llvm.org/viewvc/llvm-project?rev=322154&view=rev
Log:
[Driver] Update default sanitizer blacklist location

This is related to moving the sanitizer blacklists to share/
subdirectory.

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

Added:
cfe/trunk/test/Driver/Inputs/resource_dir/share/
cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
  - copied, changed from r322151, 
cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
  - copied, changed from r322151, 
cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
  - copied, changed from r322151, 
cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
  - copied, changed from r322151, 
cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt
Removed:
cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt
Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=322154&r1=322153&r2=322154&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Tue Jan  9 18:12:24 2018
@@ -112,7 +112,7 @@ static bool getDefaultBlacklist(const Dr
 
   if (BlacklistFile) {
 clang::SmallString<64> Path(D.ResourceDir);
-llvm::sys::path::append(Path, BlacklistFile);
+llvm::sys::path::append(Path, "share", BlacklistFile);
 BLPath = Path.str();
 return true;
   }

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt?rev=322153&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt?rev=322153&view=auto
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt 
(from r322151, cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt&r1=322151&r2=322154&rev=322154&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt 
(from r322151, cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt&r1=322151&r2=322154&rev=322154&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt 
(from r322151, cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt&r1=322151&r2=322154&rev=322154&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt 
(from r322151, cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt&r1=322151&r2=322154&rev=322154&view=diff
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt?rev=322153&view=auto
===

r322155 - Revert "[Driver] Update default sanitizer blacklist location"

2018-01-09 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jan  9 18:24:09 2018
New Revision: 322155

URL: http://llvm.org/viewvc/llvm-project?rev=322155&view=rev
Log:
Revert "[Driver] Update default sanitizer blacklist location"

This reverts commit r322154 because it broke sanitizer bots.

Added:
cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
  - copied, changed from r322154, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
  - copied, changed from r322154, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
  - copied, changed from r322154, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt
  - copied, changed from r322154, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
Removed:
cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=322155&r1=322154&r2=322155&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Tue Jan  9 18:24:09 2018
@@ -112,7 +112,7 @@ static bool getDefaultBlacklist(const Dr
 
   if (BlacklistFile) {
 clang::SmallString<64> Path(D.ResourceDir);
-llvm::sys::path::append(Path, "share", BlacklistFile);
+llvm::sys::path::append(Path, BlacklistFile);
 BLPath = Path.str();
 return true;
   }

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt (from 
r322154, cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt&r1=322154&r2=322155&rev=322155&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt (from 
r322154, cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt&r1=322154&r2=322155&rev=322155&view=diff
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt?rev=322154&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt?rev=322154&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt?rev=322154&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt?rev=322154&view=auto
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt (from 
r322154, cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt&r1=322154&r2=322155&rev=322155&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt (from 
r322154, cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inpu

[libunwind] r322228 - [libunwind] Set up .arcconfig to point to new Diffusion UNW repository

2018-01-10 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 10 14:20:03 2018
New Revision: 38

URL: http://llvm.org/viewvc/llvm-project?rev=38&view=rev
Log:
[libunwind] Set up .arcconfig to point to new Diffusion UNW repository

See http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html
for related discussion and context.

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

Modified:
libunwind/trunk/.arcconfig

Modified: libunwind/trunk/.arcconfig
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/.arcconfig?rev=38&r1=37&r2=38&view=diff
==
--- libunwind/trunk/.arcconfig (original)
+++ libunwind/trunk/.arcconfig Wed Jan 10 14:20:03 2018
@@ -1,4 +1,4 @@
 {
-  "project_id" : "libunwind",
+  "repository.callsign" : "UNW",
   "conduit_uri" : "https://reviews.llvm.org/";
 }


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


r322233 - Reland "[Driver] Update default sanitizer blacklist location"

2018-01-10 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 10 14:59:00 2018
New Revision: 322233

URL: http://llvm.org/viewvc/llvm-project?rev=322233&view=rev
Log:
Reland "[Driver] Update default sanitizer blacklist location"

This is related to moving the sanitizer blacklists to share/
subdirectory.

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

Added:
cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
  - copied, changed from r31, 
cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
  - copied, changed from r31, 
cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
  - copied, changed from r31, 
cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
  - copied, changed from r31, 
cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt
Removed:
cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt
Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=322233&r1=322232&r2=322233&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Jan 10 14:59:00 2018
@@ -112,7 +112,7 @@ static bool getDefaultBlacklist(const Dr
 
   if (BlacklistFile) {
 clang::SmallString<64> Path(D.ResourceDir);
-llvm::sys::path::append(Path, BlacklistFile);
+llvm::sys::path::append(Path, "share", BlacklistFile);
 BLPath = Path.str();
 return true;
   }

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt?rev=322232&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt?rev=322232&view=auto
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt 
(from r31, cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt&r1=31&r2=322233&rev=322233&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt 
(from r31, cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt&r1=31&r2=322233&rev=322233&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt 
(from r31, cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt&r1=31&r2=322233&rev=322233&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt 
(from r31, cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt&r1=31&r2=322233&rev=322233&view=diff
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt?rev=322232&view=auto
===

r322242 - Revert "[Driver] Update default sanitizer blacklist location"

2018-01-10 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 10 16:12:02 2018
New Revision: 322242

URL: http://llvm.org/viewvc/llvm-project?rev=322242&view=rev
Log:
Revert "[Driver] Update default sanitizer blacklist location"

This reverts commit r322233: this is breaking dfsan tests.

Added:
cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
  - copied, changed from r322240, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
  - copied, changed from r322240, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
  - copied, changed from r322240, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt
  - copied, changed from r322240, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
Removed:
cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=322242&r1=322241&r2=322242&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Jan 10 16:12:02 2018
@@ -112,7 +112,7 @@ static bool getDefaultBlacklist(const Dr
 
   if (BlacklistFile) {
 clang::SmallString<64> Path(D.ResourceDir);
-llvm::sys::path::append(Path, "share", BlacklistFile);
+llvm::sys::path::append(Path, BlacklistFile);
 BLPath = Path.str();
 return true;
   }

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt (from 
r322240, cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt&r1=322240&r2=322242&rev=322242&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt (from 
r322240, cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt&r1=322240&r2=322242&rev=322242&view=diff
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt?rev=322241&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt?rev=322241&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt?rev=322241&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt?rev=322241&view=auto
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt (from 
r322240, cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt&r1=322240&r2=322242&rev=322242&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt (from 
r322240, cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs

r322252 - [Fuchsia] Use llvm-objcopy as objcopy on non-Darwin hosts

2018-01-10 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 10 20:17:57 2018
New Revision: 322252

URL: http://llvm.org/viewvc/llvm-project?rev=322252&view=rev
Log:
[Fuchsia] Use llvm-objcopy as objcopy on non-Darwin hosts

llvm-objcopy already supports all the necessary functionality for ELF.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=322252&r1=322251&r2=322252&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Wed Jan 10 20:17:57 2018
@@ -17,6 +17,7 @@ set(LLVM_ENABLE_LTO ON CACHE BOOL "")
 if(NOT APPLE)
   set(LLVM_ENABLE_LLD ON CACHE BOOL "")
   set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
+  set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
 endif()
 
 if(APPLE)


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


r322253 - [Fuchsia] Remove LLDB from the toolchain distribution

2018-01-10 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 10 20:25:30 2018
New Revision: 322253

URL: http://llvm.org/viewvc/llvm-project?rev=322253&view=rev
Log:
[Fuchsia] Remove LLDB from the toolchain distribution

This is currently not being used so disable it to reduce toolchain size.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=322253&r1=322252&r2=322253&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Wed Jan 10 20:25:30 2018
@@ -20,10 +20,6 @@ if(NOT APPLE)
   set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
 endif()
 
-if(APPLE)
-  set(LLDB_CODESIGN_IDENTITY "" CACHE STRING "")
-endif()
-
 set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
@@ -84,8 +80,6 @@ set(LLVM_TOOLCHAIN_TOOLS
 set(LLVM_DISTRIBUTION_COMPONENTS
   clang
   lld
-  lldb
-  liblldb
   LTO
   clang-format
   clang-headers


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


r322258 - Reland "[Driver] Update default sanitizer blacklist location"

2018-01-10 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 10 22:42:12 2018
New Revision: 322258

URL: http://llvm.org/viewvc/llvm-project?rev=322258&view=rev
Log:
Reland "[Driver] Update default sanitizer blacklist location"

This is related to moving the sanitizer blacklists to share/
subdirectory.

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

Added:
cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
  - copied, changed from r322253, 
cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
  - copied, changed from r322253, 
cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
  - copied, changed from r322253, 
cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
  - copied, changed from r322253, 
cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt
Removed:
cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt
Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=322258&r1=322257&r2=322258&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Jan 10 22:42:12 2018
@@ -112,7 +112,7 @@ static bool getDefaultBlacklist(const Dr
 
   if (BlacklistFile) {
 clang::SmallString<64> Path(D.ResourceDir);
-llvm::sys::path::append(Path, BlacklistFile);
+llvm::sys::path::append(Path, "share", BlacklistFile);
 BLPath = Path.str();
 return true;
   }

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt?rev=322257&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt?rev=322257&view=auto
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt 
(from r322253, cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt&r1=322253&r2=322258&rev=322258&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt 
(from r322253, cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt&r1=322253&r2=322258&rev=322258&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt 
(from r322253, cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt&r1=322253&r2=322258&rev=322258&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt 
(from r322253, cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt&r1=322253&r2=322258&rev=322258&view=diff
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt?rev=322257&view=auto
===

r322260 - Revert "[Driver] Update default sanitizer blacklist location"

2018-01-10 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 10 23:05:38 2018
New Revision: 322260

URL: http://llvm.org/viewvc/llvm-project?rev=322260&view=rev
Log:
Revert "[Driver] Update default sanitizer blacklist location"

This reverts commit r322258: broke the dfsan build.

Added:
cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt
  - copied, changed from r322258, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt
  - copied, changed from r322258, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt
  - copied, changed from r322258, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt
  - copied, changed from r322258, 
cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
Removed:
cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=322260&r1=322259&r2=322260&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Jan 10 23:05:38 2018
@@ -112,7 +112,7 @@ static bool getDefaultBlacklist(const Dr
 
   if (BlacklistFile) {
 clang::SmallString<64> Path(D.ResourceDir);
-llvm::sys::path::append(Path, "share", BlacklistFile);
+llvm::sys::path::append(Path, BlacklistFile);
 BLPath = Path.str();
 return true;
   }

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt (from 
r322258, cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/asan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt&r1=322258&r2=322260&rev=322260&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt (from 
r322258, cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/hwasan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt&r1=322258&r2=322260&rev=322260&view=diff
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/asan_blacklist.txt?rev=322259&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/hwasan_blacklist.txt?rev=322259&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt?rev=322259&view=auto
==
(empty)

Removed: cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt?rev=322259&view=auto
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt (from 
r322258, cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt?p2=cfe/trunk/test/Driver/Inputs/resource_dir/ubsan_blacklist.txt&p1=cfe/trunk/test/Driver/Inputs/resource_dir/share/ubsan_blacklist.txt&r1=322258&r2=322260&rev=322260&view=diff
==
(empty)

Copied: cfe/trunk/test/Driver/Inputs/resource_dir/vtables_blacklist.txt (from 
r322258, cfe/trunk/test/Driver/Inputs/resource_dir/share/vtables_blacklist.txt)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resour

r326542 - [Frontend] Avoid including default system header paths on Fuchsia

2018-03-01 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Thu Mar  1 23:19:42 2018
New Revision: 326542

URL: http://llvm.org/viewvc/llvm-project?rev=326542&view=rev
Log:
[Frontend] Avoid including default system header paths on Fuchsia

These paths aren't used and don't make sense on Fuchsia.

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

Modified:
cfe/trunk/lib/Frontend/InitHeaderSearch.cpp

Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=326542&r1=326541&r2=326542&view=diff
==
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Thu Mar  1 23:19:42 2018
@@ -216,6 +216,7 @@ void InitHeaderSearch::AddDefaultCInclud
 case llvm::Triple::NaCl:
 case llvm::Triple::PS4:
 case llvm::Triple::ELFIAMCU:
+case llvm::Triple::Fuchsia:
   break;
 case llvm::Triple::Win32:
   if (triple.getEnvironment() != llvm::Triple::Cygnus)
@@ -322,6 +323,7 @@ void InitHeaderSearch::AddDefaultCInclud
   case llvm::Triple::RTEMS:
   case llvm::Triple::NaCl:
   case llvm::Triple::ELFIAMCU:
+  case llvm::Triple::Fuchsia:
 break;
   case llvm::Triple::PS4: {
 //  gets prepended later in AddPath().


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


r326860 - [Driver] Automatically disable incompatible default sanitizers

2018-03-06 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Mar  6 17:27:03 2018
New Revision: 326860

URL: http://llvm.org/viewvc/llvm-project?rev=326860&view=rev
Log:
[Driver] Automatically disable incompatible default sanitizers

When a sanitizer incompatible with one of the default sanitizers
is explicitly enabled, automatically disable all the conflicting
default sanitizers.

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

Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=326860&r1=326859&r2=326860&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Tue Mar  6 17:27:03 2018
@@ -332,8 +332,30 @@ SanitizerArgs::SanitizerArgs(const ToolC
 }
   }
 
+  std::pair IncompatibleGroups[] = {
+  std::make_pair(Address, Thread | Memory),
+  std::make_pair(Thread, Memory),
+  std::make_pair(Leak, Thread | Memory),
+  std::make_pair(KernelAddress, Address | Leak | Thread | Memory),
+  std::make_pair(HWAddress, Address | Thread | Memory | KernelAddress),
+  std::make_pair(Efficiency, Address | HWAddress | Leak | Thread | Memory |
+ KernelAddress),
+  std::make_pair(Scudo, Address | HWAddress | Leak | Thread | Memory |
+KernelAddress | Efficiency),
+  std::make_pair(SafeStack, Address | HWAddress | Leak | Thread | Memory |
+KernelAddress | Efficiency)};
+
   // Enable toolchain specific default sanitizers if not explicitly disabled.
-  Kinds |= TC.getDefaultSanitizers() & ~AllRemove;
+  SanitizerMask Default = TC.getDefaultSanitizers() & ~AllRemove;
+
+  // Disable default sanitizers that are incompatible with the default ones.
+  for (auto G : IncompatibleGroups) {
+SanitizerMask Group = G.first;
+if ((Default & Group) && (Kinds & G.second))
+  Default &= ~Group;
+  }
+
+  Kinds |= Default;
 
   // We disable the vptr sanitizer if it was enabled by group expansion but 
RTTI
   // is disabled.
@@ -369,18 +391,6 @@ SanitizerArgs::SanitizerArgs(const ToolC
   }
 
   // Warn about incompatible groups of sanitizers.
-  std::pair IncompatibleGroups[] = {
-  std::make_pair(Address, Thread | Memory),
-  std::make_pair(Thread, Memory),
-  std::make_pair(Leak, Thread | Memory),
-  std::make_pair(KernelAddress, Address | Leak | Thread | Memory),
-  std::make_pair(HWAddress, Address | Thread | Memory | KernelAddress),
-  std::make_pair(Efficiency, Address | HWAddress | Leak | Thread | Memory |
- KernelAddress),
-  std::make_pair(Scudo, Address | HWAddress | Leak | Thread | Memory |
-KernelAddress | Efficiency),
-  std::make_pair(SafeStack, Address | HWAddress | Leak | Thread | Memory |
-KernelAddress | Efficiency)};
   for (auto G : IncompatibleGroups) {
 SanitizerMask Group = G.first;
 if (Kinds & Group) {


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


r326867 - [Driver] Enable SafeStack by default on Fuchsia

2018-03-06 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Mar  6 18:49:58 2018
New Revision: 326867

URL: http://llvm.org/viewvc/llvm-project?rev=326867&view=rev
Log:
[Driver] Enable SafeStack by default on Fuchsia

This is already used throughout the entire system, so make it a default.

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

Modified:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
cfe/trunk/test/Driver/fuchsia.c

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=326867&r1=326866&r2=326867&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Tue Mar  6 18:49:58 2018
@@ -284,3 +284,7 @@ SanitizerMask Fuchsia::getSupportedSanit
   Res |= SanitizerKind::Scudo;
   return Res;
 }
+
+SanitizerMask Fuchsia::getDefaultSanitizers() const {
+  return SanitizerKind::SafeStack;
+}

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.h?rev=326867&r1=326866&r2=326867&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.h Tue Mar  6 18:49:58 2018
@@ -60,10 +60,15 @@ public:
 return llvm::DebuggerKind::GDB;
   }
 
+  unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
+return 2; // SSPStrong
+  }
+
   std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args,
   types::ID InputType) const override;
 
   SanitizerMask getSupportedSanitizers() const override;
+  SanitizerMask getDefaultSanitizers() const override;
 
   RuntimeLibType
   GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;

Modified: cfe/trunk/test/Driver/fuchsia.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.c?rev=326867&r1=326866&r2=326867&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Tue Mar  6 18:49:58 2018
@@ -10,6 +10,8 @@
 // CHECK: "-fuse-init-array"
 // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
 // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|}}include"
+// CHECK: "-fsanitize=safe-stack"
+// CHECK: "-stack-protector" "2"
 // CHECK: "-fno-common"
 // CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
 // CHECK: "--sysroot=[[SYSROOT]]"
@@ -84,31 +86,31 @@
 // RUN: %clang %s -### --target=x86_64-fuchsia \
 // RUN: -fsanitize=fuzzer 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-X86
-// CHECK-FUZZER-X86: "-fsanitize=fuzzer,fuzzer-no-link"
+// CHECK-FUZZER-X86: "-fsanitize=fuzzer,fuzzer-no-link,safe-stack"
 // CHECK-FUZZER-X86: "{{.*[/\\]}}libclang_rt.fuzzer-x86_64.a"
 
 // RUN: %clang %s -### --target=aarch64-fuchsia \
 // RUN: -fsanitize=fuzzer 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-AARCH64
-// CHECK-FUZZER-AARCH64: "-fsanitize=fuzzer,fuzzer-no-link"
+// CHECK-FUZZER-AARCH64: "-fsanitize=fuzzer,fuzzer-no-link,safe-stack"
 // CHECK-FUZZER-AARCH64: "{{.*[/\\]}}libclang_rt.fuzzer-aarch64.a"
 
 // RUN: %clang %s -### --target=x86_64-fuchsia \
 // RUN: -fsanitize=scudo 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-X86
-// CHECK-SCUDO-X86: "-fsanitize=scudo"
+// CHECK-SCUDO-X86: "-fsanitize=safe-stack,scudo"
 // CHECK-SCUDO-X86: "-pie"
 // CHECK-SCUDO-X86: "{{.*[/\\]}}libclang_rt.scudo-x86_64.so"
 
 // RUN: %clang %s -### --target=aarch64-fuchsia \
 // RUN: -fsanitize=scudo 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-AARCH64
-// CHECK-SCUDO-AARCH64: "-fsanitize=scudo"
+// CHECK-SCUDO-AARCH64: "-fsanitize=safe-stack,scudo"
 // CHECK-SCUDO-AARCH64: "-pie"
 // CHECK-SCUDO-AARCH64: "{{.*[/\\]}}libclang_rt.scudo-aarch64.so"
 
 // RUN: %clang %s -### --target=x86_64-fuchsia \
 // RUN: -fsanitize=scudo -fPIC -shared 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-SHARED
-// CHECK-SCUDO-SHARED: "-fsanitize=scudo"
+// CHECK-SCUDO-SHARED: "-fsanitize=safe-stack,scudo"
 // CHECK-SCUDO-SHARED: "{{.*[/\\]}}libclang_rt.scudo-x86_64.so"


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


[libcxx] r327194 - [CMake] Copy the generated __config header into build directory

2018-03-09 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri Mar  9 17:20:11 2018
New Revision: 327194

URL: http://llvm.org/viewvc/llvm-project?rev=327194&view=rev
Log:
[CMake] Copy the generated __config header into build directory

When the generated __config file is being used, it is currently only
copied during installation process. However, that means that the file
that gets copied into LLVM build directory is the vanilla __config file,
and any parts of the build that depend on the just built toolchain like
sanitizers will get that instead of the generated version. To avoid this
issue, we need to copy the generated header into the LLVM build
directory as well.

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

Modified:
libcxx/trunk/include/CMakeLists.txt
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/include/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/CMakeLists.txt?rev=327194&r1=327193&r2=327194&view=diff
==
--- libcxx/trunk/include/CMakeLists.txt (original)
+++ libcxx/trunk/include/CMakeLists.txt Fri Mar  9 17:20:11 2018
@@ -2,6 +2,23 @@ if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
   set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
 endif()
 
+if (LIBCXX_NEEDS_SITE_CONFIG)
+  # Generate a custom __config header. The new header is created
+  # by prepending __config_site to the current __config header.
+  add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
+COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
+  ${LIBCXX_BINARY_DIR}/__config_site
+  ${LIBCXX_SOURCE_DIR}/include/__config
+  -o ${LIBCXX_BINARY_DIR}/__generated_config
+DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config
+${LIBCXX_BINARY_DIR}/__config_site
+  )
+  # Add a target that executes the generation commands.
+  add_custom_target(generate_config_header ALL
+DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config)
+  set(generated_config_deps generate_config_header)
+endif()
+
 set(LIBCXX_HEADER_PATTERN
   PATTERN "*"
   PATTERN "CMakeLists.txt" EXCLUDE
@@ -16,6 +33,15 @@ if(NOT LIBCXX_USING_INSTALLED_LLVM AND L
 FILES_MATCHING
 ${LIBCXX_HEADER_PATTERN}
 )
+
+  if (LIBCXX_NEEDS_SITE_CONFIG)
+# Copy the generated header as __config into build directory.
+add_custom_command(
+TARGET generate_config_header POST_BUILD
+COMMAND ${CMAKE_COMMAND} -E copy
+${LIBCXX_BINARY_DIR}/__generated_config
+${LLVM_BINARY_DIR}/include/c++/v1/__config)
+  endif()
 endif()
 
 if (LIBCXX_INSTALL_HEADERS)
@@ -28,20 +54,6 @@ if (LIBCXX_INSTALL_HEADERS)
   )
 
   if (LIBCXX_NEEDS_SITE_CONFIG)
-# Generate and install a custom __config header. The new header is created
-# by  prepending __config_site to the current __config header.
-add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
-  COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
-${LIBCXX_BINARY_DIR}/__config_site
-${LIBCXX_SOURCE_DIR}/include/__config
--o ${LIBCXX_BINARY_DIR}/__generated_config
-  DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config
-  ${LIBCXX_BINARY_DIR}/__config_site
-)
-# Add a target that executes the generation commands.
-add_custom_target(generate_config_header ALL
-  DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config)
-set(generated_config_deps generate_config_header)
 # Install the generated header as __config.
 install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
   DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=327194&r1=327193&r2=327194&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Fri Mar  9 17:20:11 2018
@@ -283,7 +283,7 @@ if (LIBCXX_ENABLE_STATIC)
 endif()
 
 # Add a meta-target for both libraries.
-add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS})
+add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS} ${generated_config_deps})
 
 if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
   file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)


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


r327249 - [Driver] Update the comment about incompatible sanitizers

2018-03-11 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Sun Mar 11 17:23:37 2018
New Revision: 327249

URL: http://llvm.org/viewvc/llvm-project?rev=327249&view=rev
Log:
[Driver] Update the comment about incompatible sanitizers

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

Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=327249&r1=327248&r2=327249&view=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Sun Mar 11 17:23:37 2018
@@ -348,7 +348,8 @@ SanitizerArgs::SanitizerArgs(const ToolC
   // Enable toolchain specific default sanitizers if not explicitly disabled.
   SanitizerMask Default = TC.getDefaultSanitizers() & ~AllRemove;
 
-  // Disable default sanitizers that are incompatible with the default ones.
+  // Disable default sanitizers that are incompatible with explicitly requested
+  // ones.
   for (auto G : IncompatibleGroups) {
 SanitizerMask Group = G.first;
 if ((Default & Group) && (Kinds & G.second))


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


r327860 - [CMake] Use libc++ and compiler-rt as default libraries in Fuchsia toolchain

2018-03-19 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Mar 19 08:19:19 2018
New Revision: 327860

URL: http://llvm.org/viewvc/llvm-project?rev=327860&view=rev
Log:
[CMake] Use libc++ and compiler-rt as default libraries in Fuchsia toolchain

Fuchsia already defaults to libc++ and compiler-rt, but we want to use
these as default runtimes even on the host platform.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=327860&r1=327859&r2=327860&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Mon Mar 19 08:19:19 2018
@@ -19,6 +19,8 @@ if(NOT APPLE)
   set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
   set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
 endif()
+set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
+set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
 
 set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
@@ -26,18 +28,34 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
 
 set(LLVM_BUILTIN_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia" CACHE STRING 
"")
+
+# Set the per-target builtins options.
 foreach(target x86_64;aarch64)
   set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} 
CACHE PATH "")
   set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
 endforeach()
 
 set(LLVM_RUNTIME_TARGETS 
"default;x86_64-fuchsia;aarch64-fuchsia;x86_64-fuchsia-asan:x86_64-fuchsia;aarch64-fuchsia-asan:aarch64-fuchsia"
 CACHE STRING "")
+
+# Set the default target runtimes options.
+set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
+set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
+set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
+set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
+set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
+set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
+set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
+set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
+
+# Set the per-target runtimes options.
 foreach(target x86_64;aarch64)
   set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL 
"")
   set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} 
CACHE PATH "")
   set(RUNTIMES_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
   set(RUNTIMES_${target}-fuchsia_UNIX 1 CACHE BOOL "")
-  set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_LIBCXX ON CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_LIBUNWIND_ENABLE_STATIC OFF CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")


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


r327932 - Allow builtins for Cross-DSO CFI on Android

2018-03-19 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Mar 19 17:56:08 2018
New Revision: 327932

URL: http://llvm.org/viewvc/llvm-project?rev=327932&view=rev
Log:
Allow builtins for Cross-DSO CFI on Android

This is needed to avoid the test failure in case when compiler-rt
is set as the default runtime library for Clang.

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

Modified:
cfe/trunk/test/Driver/sanitizer-ld.c

Modified: cfe/trunk/test/Driver/sanitizer-ld.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/sanitizer-ld.c?rev=327932&r1=327931&r2=327932&view=diff
==
--- cfe/trunk/test/Driver/sanitizer-ld.c (original)
+++ cfe/trunk/test/Driver/sanitizer-ld.c Mon Mar 19 17:56:08 2018
@@ -514,7 +514,7 @@
 // RUN: --sysroot=%S/Inputs/basic_android_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-ANDROID %s
 // CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld{{(.exe)?}}"
-// CHECK-CFI-CROSS-DSO-ANDROID-NOT: libclang_rt.
+// CHECK-CFI-CROSS-DSO-ANDROID-NOT: libclang_rt.cfi
 
 // Cross-DSO CFI with diagnostics on Android links just the UBSAN runtime.
 // RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso %s -### -o %t.o 2>&1 \


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


r333979 - [Driver][Fuchsia] Pass LTO flags to linker

2018-06-04 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jun  4 18:50:59 2018
New Revision: 333979

URL: http://llvm.org/viewvc/llvm-project?rev=333979&view=rev
Log:
[Driver][Fuchsia] Pass LTO flags to linker

Even though we use lld by default for Fuchsia, we use Gold plugin
arguments like all other drivers as lld supports Gold plugin options.

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

Modified:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/test/Driver/fuchsia.c

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=333979&r1=333978&r2=333979&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Mon Jun  4 18:50:59 2018
@@ -100,6 +100,12 @@ void fuchsia::Linker::ConstructJob(Compi
 
   ToolChain.AddFilePathLibArgs(Args, CmdArgs);
 
+  if (D.isUsingLTO()) {
+assert(!Inputs.empty() && "Must have at least one input.");
+AddGoldPlugin(ToolChain, Args, CmdArgs, Output, Inputs[0],
+  D.getLTOMode() == LTOK_Thin);
+  }
+
   addSanitizerRuntimes(ToolChain, Args, CmdArgs);
 
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);

Modified: cfe/trunk/test/Driver/fuchsia.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.c?rev=333979&r1=333978&r2=333979&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Mon Jun  4 18:50:59 2018
@@ -114,3 +114,16 @@
 // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-SHARED
 // CHECK-SCUDO-SHARED: "-fsanitize=safe-stack,scudo"
 // CHECK-SCUDO-SHARED: "{{.*[/\\]}}libclang_rt.scudo-x86_64.so"
+
+// RUN: %clang %s -### --target=aarch64-fuchsia \
+// RUN: -O3 -flto -mcpu=cortex-a53 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-LTO
+// CHECK-LTO: "-plugin-opt=mcpu=cortex-a53"
+// CHECK-LTO: "-plugin-opt=O3"
+
+// RUN: %clang %s -### --target=x86_64-fuchsia \
+// RUN: -flto=thin -flto-jobs=8 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-THINLTO
+// CHECK-THINLTO: "-plugin-opt=mcpu=x86-64"
+// CHECK-THINLTO: "-plugin-opt=thinlto"
+// CHECK-THINLTO: "-plugin-opt=jobs=8"


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


r334063 - [Fuchsia] Include install-distribution-stripped in bootstrap targets

2018-06-05 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jun  5 22:18:39 2018
New Revision: 334063

URL: http://llvm.org/viewvc/llvm-project?rev=334063&view=rev
Log:
[Fuchsia] Include install-distribution-stripped in bootstrap targets

This enables the use of install-distribution-stripped target in the
2-stage builds.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia.cmake?rev=334063&r1=334062&r2=334063&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia.cmake Tue Jun  5 22:18:39 2018
@@ -38,6 +38,7 @@ set(CLANG_BOOTSTRAP_TARGETS
   clang-test-depends
   distribution
   install-distribution
+  install-distribution-stripped
   clang CACHE STRING "")
 
 get_cmake_property(variableNames VARIABLES)


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


r334437 - [CMake] Allow specifying extra dependencies of bootstrap stage

2018-06-11 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jun 11 13:59:31 2018
New Revision: 334437

URL: http://llvm.org/viewvc/llvm-project?rev=334437&view=rev
Log:
[CMake] Allow specifying extra dependencies of bootstrap stage

This allows adding additional bootstrap dependencies to the bootstrap
compiler that may be needed by later stages.

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

Modified:
cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=334437&r1=334436&r2=334437&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Mon Jun 11 13:59:31 2018
@@ -583,6 +583,10 @@ if (CLANG_ENABLE_BOOTSTRAP)
 endif()
   endif()
 
+  if(CLANG_BOOTSTRAP_EXTRA_DEPS)
+add_dependencies(clang-bootstrap-deps ${CLANG_BOOTSTRAP_EXTRA_DEPS})
+  endif()
+
   add_custom_target(${NEXT_CLANG_STAGE}-clear
 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${NEXT_CLANG_STAGE}-cleared
 )


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


r334445 - [CMake] Use libc++ and compiler-rt for bootstrap Fuchsia Clang

2018-06-11 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jun 11 15:06:44 2018
New Revision: 334445

URL: http://llvm.org/viewvc/llvm-project?rev=334445&view=rev
Log:
[CMake] Use libc++ and compiler-rt for bootstrap Fuchsia Clang

We want to build the second stage compiler with libc++ and compiler-rt,
also include builtins and runtimes into extra bootstrap components to
ensure these get built.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia.cmake?rev=334445&r1=33&r2=334445&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia.cmake Mon Jun 11 15:06:44 2018
@@ -21,6 +21,9 @@ if(NOT APPLE)
   set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
 endif()
 
+set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
+set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
+
 if(APPLE)
   set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
   set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
@@ -51,6 +54,10 @@ endforeach()
 
 # Setup the bootstrap build.
 set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
+set(CLANG_BOOTSTRAP_EXTRA_DEPS
+  builtins
+  runtimes
+  CACHE STRING "")
 set(CLANG_BOOTSTRAP_CMAKE_ARGS
   ${EXTRA_ARGS}
   -C ${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2.cmake


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


[libcxx] r334468 - Reland "Use custom command and target to install libc++ headers"

2018-06-11 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jun 11 20:10:02 2018
New Revision: 334468

URL: http://llvm.org/viewvc/llvm-project?rev=334468&view=rev
Log:
Reland "Use custom command and target to install libc++ headers"

Using file(COPY FILE...) has several downsides. Since the file command
is only executed at configuration time, any changes to headers made
after the initial CMake execution are ignored. This can lead to subtle
errors since the just built Clang will be using stale libc++ headers.
Furthermore, since the headers are copied prior to executing the build
system, this may hide missing dependencies on libc++ from other LLVM
components.

This changes replaces the use of file(COPY FILE...) command with a
custom command and target which addresses all aforementioned issues and
matches the implementation already used by other LLVM components that
also install headers like Clang builtin headers.

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

Modified:
libcxx/trunk/NOTES.TXT
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
libcxx/trunk/include/CMakeLists.txt
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/NOTES.TXT
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/NOTES.TXT?rev=334468&r1=334467&r2=334468&view=diff
==
--- libcxx/trunk/NOTES.TXT (original)
+++ libcxx/trunk/NOTES.TXT Mon Jun 11 20:10:02 2018
@@ -26,3 +26,4 @@ to libc++.
 1. Add a test under `test/libcxx` that the header defines `_LIBCPP_VERSION`.
 2. Update `test/libcxx/double_include.sh.cpp` to include the new header.
 3. Create a submodule in `include/module.modulemap` for the new header.
+4. Update the include/CMakeLists.txt file to include the new header.

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=334468&r1=334467&r2=334468&view=diff
==
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Mon Jun 11 20:10:02 2018
@@ -47,12 +47,22 @@ macro(setup_abi_lib abidefines abilib ab
 set(found TRUE)
 get_filename_component(dstdir ${fpath} PATH)
 get_filename_component(ifile ${fpath} NAME)
-file(COPY "${incpath}/${fpath}"
-  DESTINATION "${LIBCXX_BINARY_INCLUDE_DIR}/${dstdir}"
-  )
-file(COPY "${incpath}/${fpath}"
-  DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1/${dstdir}"
-  )
+set(src ${incpath}/${fpath})
+
+set(dst ${LIBCXX_BINARY_INCLUDE_DIR}/${dstdir}/${fpath})
+add_custom_command(OUTPUT ${dst}
+DEPENDS ${src}
+COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+COMMENT "Copying C++ ABI header ${fpath}...")
+list(APPEND abilib_headers "${dst}")
+
+set(dst "${CMAKE_BINARY_DIR}/include/c++/v1/${dstdir}/${fpath}")
+add_custom_command(OUTPUT ${dst}
+DEPENDS ${src}
+COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+COMMENT "Copying C++ ABI header ${fpath}...")
+list(APPEND abilib_headers "${dst}")
+
 if (LIBCXX_INSTALL_HEADERS)
   install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
 DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir}
@@ -60,7 +70,6 @@ macro(setup_abi_lib abidefines abilib ab
 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
 )
 endif()
-list(APPEND abilib_headers "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}")
   endif()
 endforeach()
 if (NOT found)
@@ -69,6 +78,7 @@ macro(setup_abi_lib abidefines abilib ab
   endforeach()
 
   include_directories("${LIBCXX_BINARY_INCLUDE_DIR}")
+  add_custom_target(cxx-abi-headers ALL DEPENDS ${abilib_headers})
 endmacro()
 
 

Modified: libcxx/trunk/include/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/CMakeLists.txt?rev=334468&r1=334467&r2=334468&view=diff
==
--- libcxx/trunk/include/CMakeLists.txt (original)
+++ libcxx/trunk/include/CMakeLists.txt Mon Jun 11 20:10:02 2018
@@ -1,5 +1,184 @@
-if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
-  set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
+set(files
+  __bit_reference
+  __bsd_locale_defaults.h
+  __bsd_locale_fallbacks.h
+  __debug
+  __functional_03
+  __functional_base
+  __functional_base_03
+  __hash_table
+  __libcpp_version
+  __locale
+  __mutex_base
+  __nullptr
+  __split_buffer
+  __sso_allocator
+  __std_stream
+  __string
+  __threading_support
+  __tree
+  __tuple
+  __undef_macros
+  algorithm
+  any
+  array
+  atomic
+  bitset
+  cassert
+  ccomplex
+  cctype
+  cerrno
+  cfenv
+  cfloat
+  chrono
+  cinttypes
+  ciso646
+  climits
+  clocale
+  cmath
+  codecvt
+  com

[libcxx] r334470 - [CMake] Add a missing target dependency on C++ ABI headers

2018-06-11 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jun 11 20:31:03 2018
New Revision: 334470

URL: http://llvm.org/viewvc/llvm-project?rev=334470&view=rev
Log:
[CMake] Add a missing target dependency on C++ ABI headers

This resolves the breakage introduced in r334468 which results in
build error when using CMake Makefile generator.

Modified:
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=334470&r1=334469&r2=334470&view=diff
==
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Mon Jun 11 20:31:03 2018
@@ -79,6 +79,7 @@ macro(setup_abi_lib abidefines abilib ab
 
   include_directories("${LIBCXX_BINARY_INCLUDE_DIR}")
   add_custom_target(cxx-abi-headers ALL DEPENDS ${abilib_headers})
+  set(LIBCXX_ABI_HEADERS_TARGET cxx-abi-headers)
 endmacro()
 
 

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=334470&r1=334469&r2=334470&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Mon Jun 11 20:31:03 2018
@@ -287,7 +287,7 @@ endif()
 
 # Add a meta-target for both libraries.
 add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS})
-add_dependencies(cxx cxx-headers)
+add_dependencies(cxx cxx-headers ${LIBCXX_ABI_HEADERS_TARGET})
 
 if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
   file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)


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


[libcxx] r334477 - [CMake] Use common variable for all header targets NFC

2018-06-12 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jun 11 23:58:06 2018
New Revision: 334477

URL: http://llvm.org/viewvc/llvm-project?rev=334477&view=rev
Log:
[CMake] Use common variable for all header targets NFC

This simplifies the handling of header targets.

Modified:
libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
libcxx/trunk/include/CMakeLists.txt
libcxx/trunk/lib/CMakeLists.txt

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=334477&r1=334476&r2=334477&view=diff
==
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Mon Jun 11 23:58:06 2018
@@ -78,8 +78,8 @@ macro(setup_abi_lib abidefines abilib ab
   endforeach()
 
   include_directories("${LIBCXX_BINARY_INCLUDE_DIR}")
-  add_custom_target(cxx-abi-headers ALL DEPENDS ${abilib_headers})
-  set(LIBCXX_ABI_HEADERS_TARGET cxx-abi-headers)
+  add_custom_target(cxx_abi_headers ALL DEPENDS ${abilib_headers})
+  set(LIBCXX_CXX_ABI_HEADER_TARGET "cxx_abi_headers")
 endmacro()
 
 

Modified: libcxx/trunk/include/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/CMakeLists.txt?rev=334477&r1=334476&r2=334477&view=diff
==
--- libcxx/trunk/include/CMakeLists.txt (original)
+++ libcxx/trunk/include/CMakeLists.txt Mon Jun 11 23:58:06 2018
@@ -228,11 +228,11 @@ if(NOT LIBCXX_USING_INSTALLED_LLVM AND L
 list(APPEND out_files ${dst})
   endif()
 
-  add_custom_target(cxx-headers ALL DEPENDS ${out_files} 
${LIBCXX_CXX_ABI_LIBRARY_HEADERS})
+  add_custom_target(cxx_headers ALL DEPENDS ${out_files} 
${LIBCXX_CXX_ABI_HEADER_TARGET})
 else()
-  add_custom_target(cxx-headers)
+  add_custom_target(cxx_headers)
 endif()
-set_target_properties(cxx-headers PROPERTIES FOLDER "Misc")
+set_target_properties(cxx_headers PROPERTIES FOLDER "Misc")
 
 if (LIBCXX_INSTALL_HEADERS)
   foreach(file ${files})

Modified: libcxx/trunk/lib/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=334477&r1=334476&r2=334477&view=diff
==
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Mon Jun 11 23:58:06 2018
@@ -189,8 +189,8 @@ split_list(LIBCXX_LINK_FLAGS)
 
 # Add an object library that contains the compiled source files.
 add_library(cxx_objects OBJECT ${exclude_from_all} ${LIBCXX_SOURCES} 
${LIBCXX_HEADERS})
-if(LIBCXX_CXX_ABI_LIBRARY_HEADERS)
-  add_dependencies(cxx_objects ${LIBCXX_CXX_ABI_LIBRARY_HEADERS})
+if(LIBCXX_CXX_ABI_HEADER_TARGET)
+  add_dependencies(cxx_objects ${LIBCXX_CXX_ABI_HEADER_TARGET})
 endif()
 if(WIN32 AND NOT MINGW)
   target_compile_definitions(cxx_objects
@@ -286,8 +286,7 @@ if (LIBCXX_ENABLE_STATIC)
 endif()
 
 # Add a meta-target for both libraries.
-add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS})
-add_dependencies(cxx cxx-headers ${LIBCXX_ABI_HEADERS_TARGET})
+add_custom_target(cxx DEPENDS cxx_headers ${LIBCXX_TARGETS})
 
 if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
   file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)


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


r334531 - [AArch64] Support reserving x20 register

2018-06-12 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jun 12 13:00:50 2018
New Revision: 334531

URL: http://llvm.org/viewvc/llvm-project?rev=334531&view=rev
Log:
[AArch64] Support reserving x20 register

Register x20 is a callee-saved register which may be used for other
purposes in certain contexts, for example to hold special variables
within the kernel. This change adds support for reserving this register
both to frontend and backend to make this register usable for these
purposes.

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

Added:
cfe/trunk/test/Driver/aarch64-fixed-x20.c
Modified:
cfe/trunk/docs/ClangCommandLineReference.rst
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp

Modified: cfe/trunk/docs/ClangCommandLineReference.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangCommandLineReference.rst?rev=334531&r1=334530&r2=334531&view=diff
==
--- cfe/trunk/docs/ClangCommandLineReference.rst (original)
+++ cfe/trunk/docs/ClangCommandLineReference.rst Tue Jun 12 13:00:50 2018
@@ -2296,6 +2296,10 @@ AARCH64
 
 Reserve the x18 register (AArch64 only)
 
+.. option:: -ffixed-x20
+
+Reserve the x20 register (AArch64 only)
+
 .. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
 
 Workaround Cortex-A53 erratum 835769 (AArch64 only)

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=334531&r1=334530&r2=334531&view=diff
==
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Tue Jun 12 13:00:50 2018
@@ -2004,6 +2004,8 @@ def mno_fix_cortex_a53_835769 : Flag<["-
   HelpText<"Don't workaround Cortex-A53 erratum 835769 (AArch64 only)">;
 def ffixed_x18 : Flag<["-"], "ffixed-x18">, Group,
   HelpText<"Reserve the x18 register (AArch64 only)">;
+def ffixed_x20 : Flag<["-"], "ffixed-x20">, Group,
+  HelpText<"Reserve the x20 register (AArch64 only)">;
 
 def msimd128 : Flag<["-"], "msimd128">, Group;
 def mno_simd128 : Flag<["-"], "mno-simd128">, Group;

Modified: cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp?rev=334531&r1=334530&r2=334531&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp Tue Jun 12 13:00:50 2018
@@ -198,6 +198,9 @@ void aarch64::getAArch64TargetFeatures(c
   if (Args.hasArg(options::OPT_ffixed_x18))
 Features.push_back("+reserve-x18");
 
+  if (Args.hasArg(options::OPT_ffixed_x20))
+Features.push_back("+reserve-x20");
+
   if (Args.hasArg(options::OPT_mno_neg_immediates))
 Features.push_back("+no-neg-immediates");
 }

Added: cfe/trunk/test/Driver/aarch64-fixed-x20.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/aarch64-fixed-x20.c?rev=334531&view=auto
==
--- cfe/trunk/test/Driver/aarch64-fixed-x20.c (added)
+++ cfe/trunk/test/Driver/aarch64-fixed-x20.c Tue Jun 12 13:00:50 2018
@@ -0,0 +1,4 @@
+// RUN: %clang -target aarch64-none-gnu -ffixed-x20 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X20 < %t %s
+
+// CHECK-FIXED-X20: "-target-feature" "+reserve-x20"


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


r335410 - [Fuchsia] Enable static libc++, libc++abi, libunwind

2018-06-22 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri Jun 22 20:15:07 2018
New Revision: 335410

URL: http://llvm.org/viewvc/llvm-project?rev=335410&view=rev
Log:
[Fuchsia] Enable static libc++, libc++abi, libunwind

This is needed for building Fuchsia drivers.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/test/Driver/fuchsia.cpp

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=335410&r1=335409&r2=335410&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Fri Jun 22 20:15:07 2018
@@ -77,12 +77,9 @@ foreach(target x86_64;aarch64)
   set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} 
CACHE PATH "")
   set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_ASSERTIONS 
${FUCHSIA_RUNTIMES_ENABLE_ASSERTIONS} CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
-  set(RUNTIMES_${target}-fuchsia_LIBUNWIND_ENABLE_STATIC OFF CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
-  set(RUNTIMES_${target}-fuchsia_LIBCXXABI_ENABLE_STATIC OFF CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
-  set(RUNTIMES_${target}-fuchsia_LIBCXX_ENABLE_STATIC OFF CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_SANITIZER_USE_COMPILER_RT ON CACHE BOOL "")
 
   set(RUNTIMES_${target}-fuchsia-asan_LLVM_USE_SANITIZER Address CACHE STRING 
"")

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=335410&r1=335409&r2=335410&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Fri Jun 22 20:15:07 2018
@@ -115,8 +115,15 @@ void fuchsia::Linker::ConstructJob(Compi
   CmdArgs.push_back("-Bdynamic");
 
 if (D.CCCIsCXX()) {
-  if (ToolChain.ShouldLinkCXXStdlib(Args))
+  if (ToolChain.ShouldLinkCXXStdlib(Args)) {
+bool OnlyLibstdcxxStatic = Args.hasArg(options::OPT_static_libstdcxx) 
&&
+   !Args.hasArg(options::OPT_static);
+if (OnlyLibstdcxxStatic)
+  CmdArgs.push_back("-Bstatic");
 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
+if (OnlyLibstdcxxStatic)
+  CmdArgs.push_back("-Bdynamic");
+  }
   CmdArgs.push_back("-lm");
 }
 

Modified: cfe/trunk/test/Driver/fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.cpp?rev=335410&r1=335409&r2=335410&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.cpp (original)
+++ cfe/trunk/test/Driver/fuchsia.cpp Fri Jun 22 20:15:07 2018
@@ -27,8 +27,8 @@
 
 // RUN: %clangxx %s -### --target=x86_64-unknown-fuchsia -static-libstdc++ 
2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-STATIC
-// CHECK-STATIC-NOT: "-Bstatic"
+// CHECK-STATIC: "-Bstatic"
 // CHECK-STATIC: "-lc++"
-// CHECK-STATIC-NOT: "-Bdynamic"
+// CHECK-STATIC: "-Bdynamic"
 // CHECK-STATIC: "-lm"
 // CHECK-STATIC: "-lc"


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


r344556 - [Driver] Support direct split DWARF emission for Fuchsia

2018-10-15 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Oct 15 14:30:32 2018
New Revision: 344556

URL: http://llvm.org/viewvc/llvm-project?rev=344556&view=rev
Log:
[Driver] Support direct split DWARF emission for Fuchsia

This enables the driver support for direct split DWARF emission for
Fuchsia in addition to Linux.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/test/Driver/fuchsia.c

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=344556&r1=344555&r2=344556&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Mon Oct 15 14:30:32 2018
@@ -133,6 +133,7 @@ set(LLVM_TOOLCHAIN_TOOLS
   llvm-cov
   llvm-cxxfilt
   llvm-dwarfdump
+  llvm-dwp
   llvm-lib
   llvm-nm
   llvm-objcopy

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=344556&r1=344555&r2=344556&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Mon Oct 15 14:30:32 2018
@@ -3047,8 +3047,8 @@ static void RenderDebugOptions(const Too
 
   // -gsplit-dwarf should turn on -g and enable the backend dwarf
   // splitting and extraction.
-  // FIXME: Currently only works on Linux.
-  if (T.isOSLinux()) {
+  // FIXME: Currently only works on Linux and Fuchsia.
+  if (T.isOSLinux() || T.isOSFuchsia()) {
 if (!SplitDWARFInlining)
   CmdArgs.push_back("-fno-split-dwarf-inlining");
 
@@ -3814,7 +3814,8 @@ void Clang::ConstructJob(Compilation &C,
 
   // Add the split debug info name to the command lines here so we
   // can propagate it to the backend.
-  bool SplitDWARF = SplitDWARFArg && RawTriple.isOSLinux() &&
+  bool SplitDWARF = SplitDWARFArg &&
+(RawTriple.isOSLinux() || RawTriple.isOSFuchsia()) &&
 (isa(JA) || isa(JA) ||
  isa(JA));
   const char *SplitDWARFOut;
@@ -5759,8 +5760,9 @@ void ClangAs::ConstructJob(Compilation &
   CmdArgs.push_back("-o");
   CmdArgs.push_back(Output.getFilename());
 
+  const llvm::Triple &T = getToolChain().getTriple();
   if (Args.hasArg(options::OPT_gsplit_dwarf) &&
-  getToolChain().getTriple().isOSLinux()) {
+  (T.isOSLinux() || T.isOSFuchsia())) {
 CmdArgs.push_back("-split-dwarf-file");
 CmdArgs.push_back(SplitDebugName(Args, Input));
   }

Modified: cfe/trunk/test/Driver/fuchsia.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.c?rev=344556&r1=344555&r2=344556&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Mon Oct 15 14:30:32 2018
@@ -149,3 +149,8 @@
 // CHECK-THINLTO: "-plugin-opt=mcpu=x86-64"
 // CHECK-THINLTO: "-plugin-opt=thinlto"
 // CHECK-THINLTO: "-plugin-opt=jobs=8"
+
+// RUN: %clang %s -### --target=x86_64-fuchsia \
+// RUN: -gsplit-dwarf -c %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-SPLIT-DWARF
+// CHECK-SPLIT-DWARF: "-split-dwarf-file" "fuchsia.dwo"


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


r345537 - [Driver] Support sanitized libraries on Fuchsia

2018-10-29 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Oct 29 13:37:52 2018
New Revision: 345537

URL: http://llvm.org/viewvc/llvm-project?rev=345537&view=rev
Log:
[Driver] Support sanitized libraries on Fuchsia

When using sanitizers, add //lib/
to the list of library paths to support using sanitized version of
runtime libraries if available.

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

Modified:
cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
cfe/trunk/lib/Driver/ToolChains/CommonArgs.h
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/test/Driver/fuchsia.c

Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=345537&r1=345536&r2=345537&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Mon Oct 29 13:37:52 2018
@@ -560,6 +560,40 @@ static bool addSanitizerDynamicList(cons
   return false;
 }
 
+static void addSanitizerLibPath(const ToolChain &TC, const ArgList &Args,
+ArgStringList &CmdArgs, StringRef Name) {
+  for (const auto &LibPath : TC.getLibraryPaths()) {
+if (!LibPath.empty()) {
+  SmallString<128> P(LibPath);
+  llvm::sys::path::append(P, Name);
+  if (TC.getVFS().exists(P))
+CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + P));
+}
+  }
+}
+
+void tools::addSanitizerPathLibArgs(const ToolChain &TC, const ArgList &Args,
+ArgStringList &CmdArgs) {
+  const SanitizerArgs &SanArgs = TC.getSanitizerArgs();
+  if (SanArgs.needsAsanRt()) {
+addSanitizerLibPath(TC, Args, CmdArgs, "asan");
+  }
+  if (SanArgs.needsHwasanRt()) {
+addSanitizerLibPath(TC, Args, CmdArgs, "hwasan");
+  }
+  if (SanArgs.needsLsanRt()) {
+addSanitizerLibPath(TC, Args, CmdArgs, "lsan");
+  }
+  if (SanArgs.needsMsanRt()) {
+addSanitizerLibPath(TC, Args, CmdArgs, "msan");
+  }
+  if (SanArgs.needsTsanRt()) {
+addSanitizerLibPath(TC, Args, CmdArgs, "tsan");
+  }
+}
+
+
+
 void tools::linkSanitizerRuntimeDeps(const ToolChain &TC,
  ArgStringList &CmdArgs) {
   // Force linking against the system libraries sanitizers depends on

Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.h?rev=345537&r1=345536&r2=345537&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/CommonArgs.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.h Mon Oct 29 13:37:52 2018
@@ -32,6 +32,10 @@ void claimNoWarnArgs(const llvm::opt::Ar
 bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args,
   llvm::opt::ArgStringList &CmdArgs);
 
+void addSanitizerPathLibArgs(const ToolChain &TC,
+ const llvm::opt::ArgList &Args,
+ llvm::opt::ArgStringList &CmdArgs);
+
 void linkSanitizerRuntimeDeps(const ToolChain &TC,
   llvm::opt::ArgStringList &CmdArgs);
 

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=345537&r1=345536&r2=345537&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Mon Oct 29 13:37:52 2018
@@ -76,10 +76,11 @@ void fuchsia::Linker::ConstructJob(Compi
   else if (Args.hasArg(options::OPT_shared))
 CmdArgs.push_back("-shared");
 
+  const SanitizerArgs &SanArgs = ToolChain.getSanitizerArgs();
+
   if (!Args.hasArg(options::OPT_shared)) {
 std::string Dyld = D.DyldPrefix;
-if (ToolChain.getSanitizerArgs().needsAsanRt() &&
-ToolChain.getSanitizerArgs().needsSharedRt())
+if (SanArgs.needsAsanRt() && SanArgs.needsSharedRt())
   Dyld += "asan/";
 Dyld += "ld.so.1";
 CmdArgs.push_back("-dynamic-linker");
@@ -98,6 +99,8 @@ void fuchsia::Linker::ConstructJob(Compi
   Args.AddAllArgs(CmdArgs, options::OPT_L);
   Args.AddAllArgs(CmdArgs, options::OPT_u);
 
+  addSanitizerPathLibArgs(ToolChain, Args, CmdArgs);
+
   ToolChain.AddFilePathLibArgs(Args, CmdArgs);
 
   if (D.isUsingLTO()) {

Modified: cfe/trunk/test/Driver/fuchsia.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.c?rev=345537&r1=345536&r2=345537&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Mon Oct 29 13:37:52 2018
@@ -66,22 +66,28 @@
 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
 // RUN: -fuse-ld=lld \
 // RUN: | FileCheck %s -check-prefix=CHECK-ASAN-X86
+

r345540 - [Driver] Include missing touch files for sanitized library paths

2018-10-29 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Oct 29 14:04:12 2018
New Revision: 345540

URL: http://llvm.org/viewvc/llvm-project?rev=345540&view=rev
Log:
[Driver] Include missing touch files for sanitized library paths

These were forgotten in r345537 causing test failures on Clang builders.

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

Added:

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/asan/

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/asan/.keep

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/asan/

cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/asan/.keep

Added: 
cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/asan/.keep
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/asan/.keep?rev=345540&view=auto
==
(empty)

Added: 
cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/asan/.keep
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/asan/.keep?rev=345540&view=auto
==
(empty)


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


r345552 - [CMake][Fuchsia] Drop the LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT

2018-10-29 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Oct 29 16:10:49 2018
New Revision: 345552

URL: http://llvm.org/viewvc/llvm-project?rev=345552&view=rev
Log:
[CMake][Fuchsia] Drop the LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT

Now that libc++ uses __exclude_from_explicit_instantiation__ attribute,
this is no longer needed.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=345552&r1=345551&r2=345552&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Mon Oct 29 16:10:49 2018
@@ -58,8 +58,6 @@ elseif(UNIX)
   set(RUNTIMES_${target}-linux-gnu_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
   set(RUNTIMES_${target}-linux-gnu_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON 
CACHE BOOL "")
   set(RUNTIMES_${target}-linux-gnu_LIBCXX_ABI_VERSION 2 CACHE STRING "")
-  # TODO: this is a workaround for PR39053 which was uncovered by D50652.
-  set(RUNTIMES_${target}-linux-gnu_LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT 
ON CACHE BOOL "")
   set(RUNTIMES_${target}-linux-gnu_SANITIZER_CXX_ABI "libc++" CACHE STRING 
"")
   set(RUNTIMES_${target}-linux-gnu_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL 
"")
   set(RUNTIMES_${target}-linux-gnu_COMPILER_RT_USE_BUILTINS_LIBRARY ON 
CACHE BOOL "")
@@ -113,8 +111,6 @@ if(FUCHSIA_SDK)
 set(RUNTIMES_${target}-fuchsia_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE 
BOOL "")
 
set(RUNTIMES_${target}-fuchsia_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF 
CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXX_ABI_VERSION 2 CACHE STRING "")
-# TODO: this is a workaround for PR39053 which was uncovered by D50652.
-set(RUNTIMES_${target}-fuchsia_LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT ON 
CACHE BOOL "")
   endforeach()
 
   set(LLVM_RUNTIME_SANITIZERS "Address" CACHE STRING "")


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


r351145 - [CMake][Fuchsia] Synchronize first and second stage builds

2019-01-14 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jan 14 17:15:00 2019
New Revision: 351145

URL: http://llvm.org/viewvc/llvm-project?rev=351145&view=rev
Log:
[CMake][Fuchsia] Synchronize first and second stage builds

This reorders options between the first and second stage builds to make
them better lined up. The change also re-enables tests for first stage
which is useful e.g. for cross-compiling when we cannot run tests for
second stage directly (i.e. without emulation).

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
cfe/trunk/cmake/caches/Fuchsia.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=351145&r1=351144&r2=351145&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Mon Jan 14 17:15:00 2019
@@ -1,32 +1,33 @@
-# This file sets up a CMakeCache for the second stage of a Fuchsia toolchain
-# build.
+# This file sets up a CMakeCache for the second stage of a Fuchsia toolchain 
build.
 
 set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "")
 
 set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
 
-set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
-set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
 set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
+if(NOT APPLE)
+  set(LLVM_ENABLE_LLD ON CACHE BOOL "")
+endif()
+set(LLVM_ENABLE_LTO ON CACHE BOOL "")
+set(LLVM_ENABLE_MODULES ON CACHE BOOL "")
 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
 set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")
 set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "")
-set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
-
-set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
-set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
+set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
+set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
 
-set(LLVM_ENABLE_LTO ON CACHE BOOL "")
+set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
 if(NOT APPLE)
-  set(LLVM_ENABLE_LLD ON CACHE BOOL "")
   set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
   set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
 endif()
-set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
 set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
+set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
+
+set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
+set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
 
-set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
@@ -34,6 +35,10 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3
 if(APPLE)
   list(APPEND BUILTIN_TARGETS "default")
   list(APPEND RUNTIME_TARGETS "default")
+
+  set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
+  set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
+  set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
 endif()
 
 foreach(target 
aarch64-linux-gnu;armv7-linux-gnueabihf;i386-linux-gnu;x86_64-linux-gnu)

Modified: cfe/trunk/cmake/caches/Fuchsia.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia.cmake?rev=351145&r1=351144&r2=351145&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia.cmake Mon Jan 14 17:15:00 2019
@@ -4,14 +4,19 @@ set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch6
 
 set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
 
-set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
-set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
-set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
 set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
 set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
-set(CLANG_INCLUDE_TESTS OFF CACHE BOOL "")
+set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
+set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
+
+set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
+if(NOT APPLE)
+  set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
+  set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
+endif()
+set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
 set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
 
 set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
@@ -20,18 +25,6 @@ set(ENABLE_X86_RELAX_RELOCATIONS ON CACH
 set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
 set(CMAKE_BUILD_TYPE Release CACHE STRING "")
 
-set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
-if(NOT APPLE)
-  set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
-endif()
-
-if(NOT APPLE)
-  set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
-  set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
-endif()
-set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
-set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING

r351415 - [CMake][Fuchsia] Disable modules for the second stage build

2019-01-16 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 16 20:12:30 2019
New Revision: 351415

URL: http://llvm.org/viewvc/llvm-project?rev=351415&view=rev
Log:
[CMake][Fuchsia] Disable modules for the second stage build

This made the toolchain build 50% slower.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=351415&r1=351414&r2=351415&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Wed Jan 16 20:12:30 2019
@@ -9,7 +9,6 @@ if(NOT APPLE)
   set(LLVM_ENABLE_LLD ON CACHE BOOL "")
 endif()
 set(LLVM_ENABLE_LTO ON CACHE BOOL "")
-set(LLVM_ENABLE_MODULES ON CACHE BOOL "")
 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
 set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")


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


r351709 - [CMake][Fuchsia] Drop -DNDEBUG, re-enable modules

2019-01-20 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Sun Jan 20 17:06:50 2019
New Revision: 351709

URL: http://llvm.org/viewvc/llvm-project?rev=351709&view=rev
Log:
[CMake][Fuchsia] Drop -DNDEBUG, re-enable modules

-DNDEBUG is no longer needed now that we don't enable assertions,
modules should improve build times for the second stage.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=351709&r1=351708&r2=351709&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Sun Jan 20 17:06:50 2019
@@ -9,6 +9,7 @@ if(NOT APPLE)
   set(LLVM_ENABLE_LLD ON CACHE BOOL "")
 endif()
 set(LLVM_ENABLE_LTO ON CACHE BOOL "")
+set(LLVM_ENABLE_MODULES ON CACHE BOOL "")
 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
 set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")
@@ -28,8 +29,8 @@ set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL
 set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
 
 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE 
STRING "")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only" CACHE STRING "")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only" CACHE STRING "")
 
 if(APPLE)
   list(APPEND BUILTIN_TARGETS "default")


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


r351710 - [Driver] Don't pass default value to getCompilerRTArgString

2019-01-20 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Sun Jan 20 17:34:09 2019
New Revision: 351710

URL: http://llvm.org/viewvc/llvm-project?rev=351710&view=rev
Log:
[Driver] Don't pass default value to getCompilerRTArgString

Using static library is already a default.

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

Modified:
cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
cfe/trunk/lib/Driver/ToolChains/MSVC.cpp
cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp
cfe/trunk/lib/Driver/ToolChains/Solaris.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=351710&r1=351709&r2=351710&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Sun Jan 20 17:34:09 2019
@@ -757,9 +757,9 @@ bool tools::addXRayRuntime(const ToolCha
 
   if (TC.getXRayArgs().needsXRayRt()) {
 CmdArgs.push_back("-whole-archive");
-CmdArgs.push_back(TC.getCompilerRTArgString(Args, "xray", false));
+CmdArgs.push_back(TC.getCompilerRTArgString(Args, "xray"));
 for (const auto &Mode : TC.getXRayArgs().modeList())
-  CmdArgs.push_back(TC.getCompilerRTArgString(Args, Mode, false));
+  CmdArgs.push_back(TC.getCompilerRTArgString(Args, Mode));
 CmdArgs.push_back("-no-whole-archive");
 return true;
   }

Modified: cfe/trunk/lib/Driver/ToolChains/MSVC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MSVC.cpp?rev=351710&r1=351709&r2=351710&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/MSVC.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/MSVC.cpp Sun Jan 20 17:34:09 2019
@@ -377,7 +377,7 @@ void visualstudio::Linker::ConstructJob(
 if (!Args.hasArg(options::OPT_shared))
   CmdArgs.push_back(
   Args.MakeArgString(std::string("-wholearchive:") +
- TC.getCompilerRTArgString(Args, "fuzzer", 
false)));
+ TC.getCompilerRTArgString(Args, "fuzzer")));
 CmdArgs.push_back(Args.MakeArgString("-debug"));
 // Prevent the linker from padding sections we use for instrumentation
 // arrays.

Modified: cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp?rev=351710&r1=351709&r2=351710&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp Sun Jan 20 17:34:09 2019
@@ -188,11 +188,11 @@ void openbsd::Linker::ConstructJob(Compi
 CmdArgs.push_back("-lm");
 }
 if (NeedsSanitizerDeps) {
-  CmdArgs.push_back(ToolChain.getCompilerRTArgString(Args, "builtins", 
false));
+  CmdArgs.push_back(ToolChain.getCompilerRTArgString(Args, "builtins"));
   linkSanitizerRuntimeDeps(ToolChain, CmdArgs);
 }
 if (NeedsXRayDeps) {
-  CmdArgs.push_back(ToolChain.getCompilerRTArgString(Args, "builtins", 
false));
+  CmdArgs.push_back(ToolChain.getCompilerRTArgString(Args, "builtins"));
   linkXRayRuntimeDeps(ToolChain, CmdArgs);
 }
 // FIXME: For some reason GCC passes -lgcc before adding

Modified: cfe/trunk/lib/Driver/ToolChains/Solaris.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Solaris.cpp?rev=351710&r1=351709&r2=351710&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Solaris.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Solaris.cpp Sun Jan 20 17:34:09 2019
@@ -100,7 +100,7 @@ void solaris::Linker::ConstructJob(Compi
   // __start_SECNAME labels.
   CmdArgs.push_back("--whole-archive");
   CmdArgs.push_back(
-  getToolChain().getCompilerRTArgString(Args, "sancov_begin", false));
+  getToolChain().getCompilerRTArgString(Args, "sancov_begin"));
   CmdArgs.push_back("--no-whole-archive");
 
   getToolChain().AddFilePathLibArgs(Args, CmdArgs);
@@ -135,7 +135,7 @@ void solaris::Linker::ConstructJob(Compi
   // __stop_SECNAME labels.
   CmdArgs.push_back("--whole-archive");
   CmdArgs.push_back(
-  getToolChain().getCompilerRTArgString(Args, "sancov_end", false));
+  getToolChain().getCompilerRTArgString(Args, "sancov_end"));
   CmdArgs.push_back("--no-whole-archive");
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {


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


[libunwind] r352016 - [libunwind] Don't abort if encoutering invalid .eh_frame_hdr

2019-01-23 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 23 19:04:42 2019
New Revision: 352016

URL: http://llvm.org/viewvc/llvm-project?rev=352016&view=rev
Log:
[libunwind] Don't abort if encoutering invalid .eh_frame_hdr

Recent Linux kernel release has introduced a bug as part of the ORC
rollout where the vDSO has a valid .eh_frame section, but it's missing
the .eh_frame_hdr section and GNU_EH_FRAME segment has zero size. This
causes libunwind to abort which breaks programs that use libunwind.

The other unwinder implementation (libgcc, non-gnu) instead silently
bail out unless being compiled as debug. This change modifies libunwind
to use the same strategy.

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

Modified:
libunwind/trunk/src/AddressSpace.hpp
libunwind/trunk/src/EHHeaderParser.hpp

Modified: libunwind/trunk/src/AddressSpace.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/AddressSpace.hpp?rev=352016&r1=352015&r2=352016&view=diff
==
--- libunwind/trunk/src/AddressSpace.hpp (original)
+++ libunwind/trunk/src/AddressSpace.hpp Wed Jan 23 19:04:42 2019
@@ -535,11 +535,11 @@ inline bool LocalAddressSpace::findUnwin
 #endif
 cbdata->sects->dwarf_index_section = eh_frame_hdr_start;
 cbdata->sects->dwarf_index_section_length = phdr->p_memsz;
-EHHeaderParser::decodeEHHdr(
+found_hdr = EHHeaderParser::decodeEHHdr(
 *cbdata->addressSpace, eh_frame_hdr_start, phdr->p_memsz,
 hdrInfo);
-cbdata->sects->dwarf_section = hdrInfo.eh_frame_ptr;
-found_hdr = true;
+if (found_hdr)
+  cbdata->sects->dwarf_section = hdrInfo.eh_frame_ptr;
   }
 }
 

Modified: libunwind/trunk/src/EHHeaderParser.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/EHHeaderParser.hpp?rev=352016&r1=352015&r2=352016&view=diff
==
--- libunwind/trunk/src/EHHeaderParser.hpp (original)
+++ libunwind/trunk/src/EHHeaderParser.hpp Wed Jan 23 19:04:42 2019
@@ -35,7 +35,7 @@ public:
 uint8_t table_enc;
   };
 
-  static void decodeEHHdr(A &addressSpace, pint_t ehHdrStart, pint_t ehHdrEnd,
+  static bool decodeEHHdr(A &addressSpace, pint_t ehHdrStart, pint_t ehHdrEnd,
   EHHeaderInfo &ehHdrInfo);
   static bool findFDE(A &addressSpace, pint_t pc, pint_t ehHdrStart,
   uint32_t sectionLength,
@@ -52,12 +52,14 @@ private:
 };
 
 template 
-void EHHeaderParser::decodeEHHdr(A &addressSpace, pint_t ehHdrStart,
+bool EHHeaderParser::decodeEHHdr(A &addressSpace, pint_t ehHdrStart,
 pint_t ehHdrEnd, EHHeaderInfo &ehHdrInfo) {
   pint_t p = ehHdrStart;
   uint8_t version = addressSpace.get8(p++);
-  if (version != 1)
-_LIBUNWIND_ABORT("Unsupported .eh_frame_hdr version");
+  if (version != 1) {
+_LIBUNWIND_LOG0("Unsupported .eh_frame_hdr version");
+return false;
+  }
 
   uint8_t eh_frame_ptr_enc = addressSpace.get8(p++);
   uint8_t fde_count_enc = addressSpace.get8(p++);
@@ -70,6 +72,8 @@ void EHHeaderParser::decodeEHHdr(A &a
   ? 0
   : addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart);
   ehHdrInfo.table = p;
+
+  return true;
 }
 
 template 
@@ -101,7 +105,9 @@ bool EHHeaderParser::findFDE(A &addre
   pint_t ehHdrEnd = ehHdrStart + sectionLength;
 
   EHHeaderParser::EHHeaderInfo hdrInfo;
-  EHHeaderParser::decodeEHHdr(addressSpace, ehHdrStart, ehHdrEnd, hdrInfo);
+  if (!EHHeaderParser::decodeEHHdr(addressSpace, ehHdrStart, ehHdrEnd,
+  hdrInfo))
+return false;
 
   size_t tableEntrySize = getTableEntrySize(hdrInfo.table_enc);
   pint_t tableEntry;


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


r352018 - [CMake][Fuchsia] Enable hermetic static libc++abi for Fuchsia

2019-01-23 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 23 19:24:37 2019
New Revision: 352018

URL: http://llvm.org/viewvc/llvm-project?rev=352018&view=rev
Log:
[CMake][Fuchsia] Enable hermetic static libc++abi for Fuchsia

Similarly to libc++, we want to use hermetic static libc++abi.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=352018&r1=352017&r2=352018&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Wed Jan 23 19:24:37 2019
@@ -119,12 +119,13 @@ if(FUCHSIA_SDK)
 set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL 
"")
 set(RUNTIMES_${target}-fuchsia_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE 
BOOL "")
+set(RUNTIMES_${target}-fuchsia_LIBCXXABI_HERMETIC_STATIC_LIBRARY ON CACHE 
BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXXABI_INSTALL_STATIC_LIBRARY OFF CACHE 
BOOL "")
 
set(RUNTIMES_${target}-fuchsia_LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY
 OFF CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE 
BOOL "")
-
set(RUNTIMES_${target}-fuchsia_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF 
CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXX_HERMETIC_STATIC_LIBRARY ON CACHE 
BOOL "")
+
set(RUNTIMES_${target}-fuchsia_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF 
CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXX_ABI_VERSION 2 CACHE STRING "")
   endforeach()
 


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


r352153 - Revert "[AArch64] Use LL for 64-bit intrinsic arguments"

2019-01-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Thu Jan 24 18:16:29 2019
New Revision: 352153

URL: http://llvm.org/viewvc/llvm-project?rev=352153&view=rev
Log:
Revert "[AArch64] Use LL for 64-bit intrinsic arguments"

This reverts commit r351740: this broke on platforms where unsigned long
long isn't the same as uint64_t which is what ACLE specifies for the
return value of rsr64.

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

Modified:
cfe/trunk/include/clang/Basic/BuiltinsAArch64.def
cfe/trunk/test/CodeGen/arm64-crc32.c
cfe/trunk/test/CodeGen/builtins-arm64.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsAArch64.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsAArch64.def?rev=352153&r1=352152&r2=352153&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsAArch64.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsAArch64.def Thu Jan 24 18:16:29 2019
@@ -32,7 +32,7 @@ BUILTIN(__builtin_arm_clrex, "v", "")
 
 // Bit manipulation
 BUILTIN(__builtin_arm_rbit, "UiUi", "nc")
-BUILTIN(__builtin_arm_rbit64, "LLUiLLUi", "nc")
+BUILTIN(__builtin_arm_rbit64, "LUiLUi", "nc")
 
 // HINT
 BUILTIN(__builtin_arm_nop, "v", "")
@@ -49,8 +49,8 @@ BUILTIN(__builtin_arm_crc32h, "UiUiUs",
 BUILTIN(__builtin_arm_crc32ch, "UiUiUs", "nc")
 BUILTIN(__builtin_arm_crc32w, "UiUiUi", "nc")
 BUILTIN(__builtin_arm_crc32cw, "UiUiUi", "nc")
-BUILTIN(__builtin_arm_crc32d, "UiUiLLUi", "nc")
-BUILTIN(__builtin_arm_crc32cd, "UiUiLLUi", "nc")
+BUILTIN(__builtin_arm_crc32d, "UiUiLUi", "nc")
+BUILTIN(__builtin_arm_crc32cd, "UiUiLUi", "nc")
 
 // Memory barrier
 BUILTIN(__builtin_arm_dmb, "vUi", "nc")
@@ -62,10 +62,10 @@ BUILTIN(__builtin_arm_prefetch, "vvC*UiU
 
 // System Registers
 BUILTIN(__builtin_arm_rsr, "UicC*", "nc")
-BUILTIN(__builtin_arm_rsr64, "LLUicC*", "nc")
+BUILTIN(__builtin_arm_rsr64, "LUicC*", "nc")
 BUILTIN(__builtin_arm_rsrp, "v*cC*", "nc")
 BUILTIN(__builtin_arm_wsr, "vcC*Ui", "nc")
-BUILTIN(__builtin_arm_wsr64, "vcC*LLUi", "nc")
+BUILTIN(__builtin_arm_wsr64, "vcC*LUi", "nc")
 BUILTIN(__builtin_arm_wsrp, "vcC*vC*", "nc")
 
 // MSVC

Modified: cfe/trunk/test/CodeGen/arm64-crc32.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm64-crc32.c?rev=352153&r1=352152&r2=352153&view=diff
==
--- cfe/trunk/test/CodeGen/arm64-crc32.c (original)
+++ cfe/trunk/test/CodeGen/arm64-crc32.c Thu Jan 24 18:16:29 2019
@@ -1,57 +1,54 @@
 // REQUIRES: aarch64-registered-target
 // RUN: %clang_cc1 -triple arm64-none-linux-gnu \
 // RUN:  -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | 
FileCheck %s
-// RUN: %clang_cc1 -triple aarch64-windows \
-// RUN:  -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | 
FileCheck %s
-#include 
 
-uint32_t crc32b(uint32_t a, uint8_t b)
+int crc32b(int a, char b)
 {
 return __builtin_arm_crc32b(a,b);
 // CHECK: [[T0:%[0-9]+]] = zext i8 %b to i32
 // CHECK: call i32 @llvm.aarch64.crc32b(i32 %a, i32 [[T0]])
 }
 
-uint32_t crc32cb(uint32_t a, uint8_t b)
+int crc32cb(int a, char b)
 {
 return __builtin_arm_crc32cb(a,b);
 // CHECK: [[T0:%[0-9]+]] = zext i8 %b to i32
 // CHECK: call i32 @llvm.aarch64.crc32cb(i32 %a, i32 [[T0]])
 }
 
-uint32_t crc32h(uint32_t a, uint16_t b)
+int crc32h(int a, short b)
 {
 return __builtin_arm_crc32h(a,b);
 // CHECK: [[T0:%[0-9]+]] = zext i16 %b to i32
 // CHECK: call i32 @llvm.aarch64.crc32h(i32 %a, i32 [[T0]])
 }
 
-uint32_t crc32ch(uint32_t a, uint16_t b)
+int crc32ch(int a, short b)
 {
 return __builtin_arm_crc32ch(a,b);
 // CHECK: [[T0:%[0-9]+]] = zext i16 %b to i32
 // CHECK: call i32 @llvm.aarch64.crc32ch(i32 %a, i32 [[T0]])
 }
 
-uint32_t crc32w(uint32_t a, uint32_t b)
+int crc32w(int a, int b)
 {
 return __builtin_arm_crc32w(a,b);
 // CHECK: call i32 @llvm.aarch64.crc32w(i32 %a, i32 %b)
 }
 
-uint32_t crc32cw(uint32_t a, uint32_t b)
+int crc32cw(int a, int b)
 {
 return __builtin_arm_crc32cw(a,b);
 // CHECK: call i32 @llvm.aarch64.crc32cw(i32 %a, i32 %b)
 }
 
-uint32_t crc32d(uint32_t a, uint64_t b)
+int crc32d(int a, long b)
 {
 return __builtin_arm_crc32d(a,b);
 // CHECK: call i32 @llvm.aarch64.crc32x(i32 %a, i64 %b)
 }
 
-uint32_t crc32cd(uint32_t a, uint64_t b)
+int crc32cd(int a, long b)
 {
 return __builtin_arm_crc32cd(a,b);
 // CHECK: call i32 @llvm.aarch64.crc32cx(i32 %a, i64 %b)

Modified: cfe/trunk/test/CodeGen/builtins-arm64.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-arm64.c?rev=352153&r1=352152&r2=352153&view=diff
==
--- cfe/trunk/test/CodeGen/builtins-arm64.c (original)
+++ cfe/trunk/test/CodeGen/builtins-arm64.c Thu Jan 24 18:16:29 2019
@@ -1,6 +1,4 @@
 // RUN: %clang_cc1 -triple arm64-unknown-linux -disable-O0-optnone -emit-llvm 
-o - %s | opt -S -mem2reg | FileCheck

r352156 - [AArch64] Make the test for rsr and rsr64 stricter

2019-01-24 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Thu Jan 24 18:42:30 2019
New Revision: 352156

URL: http://llvm.org/viewvc/llvm-project?rev=352156&view=rev
Log:
[AArch64] Make the test for rsr and rsr64 stricter

ACLE specifies that return type for rsr and rsr64 is uint32_t and
uint64_t respectively. D56852 change the return type of rsr64 from
unsigned long to unsigned long long which at least on Linux doesn't
match uint64_t, but the test isn't strict enough to detect that
because compiler implicitly converts unsigned long long to uint64_t,
but it breaks other uses such as printf with PRIx64 type specifier.
This change makes the test stricter enforcing that the return type
of rsr and rsr64 builtins is what is actually specified in ACLE.

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

Modified:
cfe/trunk/test/CodeGen/builtins-arm64.c

Modified: cfe/trunk/test/CodeGen/builtins-arm64.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-arm64.c?rev=352156&r1=352155&r2=352156&view=diff
==
--- cfe/trunk/test/CodeGen/builtins-arm64.c (original)
+++ cfe/trunk/test/CodeGen/builtins-arm64.c Thu Jan 24 18:42:30 2019
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple arm64-unknown-linux -disable-O0-optnone -emit-llvm 
-o - %s | opt -S -mem2reg | FileCheck %s
+#include 
 
 void f0(void *a, void *b) {
__clear_cache(a,b);
@@ -49,13 +50,17 @@ void prefetch() {
 // CHECK: call {{.*}} @llvm.prefetch(i8* null, i32 0, i32 3, i32 0)
 }
 
-unsigned rsr() {
+__typeof__(__builtin_arm_rsr("1:2:3:4:5")) rsr(void);
+
+uint32_t rsr() {
   // CHECK: [[V0:[%A-Za-z0-9.]+]] = call i64 @llvm.read_register.i64(metadata 
![[M0:[0-9]]])
   // CHECK-NEXT: trunc i64 [[V0]] to i32
   return __builtin_arm_rsr("1:2:3:4:5");
 }
 
-unsigned long rsr64() {
+__typeof__(__builtin_arm_rsr64("1:2:3:4:5")) rsr64(void);
+
+uint64_t rsr64() {
   // CHECK: call i64 @llvm.read_register.i64(metadata ![[M0:[0-9]]])
   return __builtin_arm_rsr64("1:2:3:4:5");
 }


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


[libunwind] r352245 - [libunwind] Use placement new to avoid dependency C++ library

2019-01-25 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri Jan 25 13:39:46 2019
New Revision: 352245

URL: http://llvm.org/viewvc/llvm-project?rev=352245&view=rev
Log:
[libunwind] Use placement new to avoid dependency C++ library

The rest of libunwind already uses placement new, these are the only
places where non-placement new is being used introducing undesirable
C++ library dependency.

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

Modified:
libunwind/trunk/src/libunwind.cpp

Modified: libunwind/trunk/src/libunwind.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/libunwind.cpp?rev=352245&r1=352244&r2=352245&view=diff
==
--- libunwind/trunk/src/libunwind.cpp (original)
+++ libunwind/trunk/src/libunwind.cpp Fri Jan 25 13:39:46 2019
@@ -14,8 +14,6 @@
 #ifndef NDEBUG
 #include  // getenv
 #endif
-#include 
-#include 
 
 #include "libunwind_ext.h"
 #include "config.h"
@@ -122,12 +120,14 @@ static bool is64bit(task_t task) {
 _LIBUNWIND_EXPORT unw_addr_space_t unw_create_addr_space_for_task(task_t task) 
{
 #if __i386__
   if (is64bit(task)) {
-unw_addr_space_x86_64 *as = new unw_addr_space_x86_64(task);
+unw_addr_space_x86_64 *as = malloc(sizeof(unw_addr_space_x86_64));
+new (as) unw_addr_space_x86_64(task);
 as->taskPort = task;
 as->cpuType = CPU_TYPE_X86_64;
 //as->oas
   } else {
-unw_addr_space_i386 *as = new unw_addr_space_i386(task);
+unw_addr_space_i386 *as = malloc(sizeof(unw_addr_space_i386));
+new (as) unw_addr_space_i386(task);
 as->taskPort = task;
 as->cpuType = CPU_TYPE_I386;
 //as->oas
@@ -144,18 +144,21 @@ _LIBUNWIND_EXPORT void unw_destroy_addr_
 #if __i386__ || __x86_64__
   case CPU_TYPE_I386: {
 unw_addr_space_i386 *as = (unw_addr_space_i386 *)asp;
-delete as;
+as->~unw_addr_space_i386();
+free(as);
   }
   break;
   case CPU_TYPE_X86_64: {
 unw_addr_space_x86_64 *as = (unw_addr_space_x86_64 *)asp;
-delete as;
+as->~unw_addr_space_x86_64();
+free(as);
   }
   break;
 #endif
   case CPU_TYPE_POWERPC: {
 unw_addr_space_ppc *as = (unw_addr_space_ppc *)asp;
-delete as;
+as->~unw_addr_space_ppc();
+free(as);
   }
   break;
   }


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


[libunwind] r352341 - [CMake] Use __libc_start_main rather than fopen when checking for C library

2019-01-27 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Sun Jan 27 20:12:54 2019
New Revision: 352341

URL: http://llvm.org/viewvc/llvm-project?rev=352341&view=rev
Log:
[CMake] Use __libc_start_main rather than fopen when checking for C library

The check_library_exists CMake uses a custom symbol definition. This
is a problem when checking for C library symbols because Clang
recognizes many of them as builtins, and returns the
-Wbuiltin-requires-header (or -Wincompatible-library-redeclaration)
error. When building with -Werror which is the default, this causes
the check_library_exists check fail making the build think that C
library isn't available.

To avoid this issue, we should use a symbol that isn't recognized by
Clang and wouldn't cause the same issue. __libc_start_main seems like
reasonable choice that fits the bill.

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

Modified:
libunwind/trunk/cmake/config-ix.cmake

Modified: libunwind/trunk/cmake/config-ix.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/cmake/config-ix.cmake?rev=352341&r1=352340&r2=352341&view=diff
==
--- libunwind/trunk/cmake/config-ix.cmake (original)
+++ libunwind/trunk/cmake/config-ix.cmake Sun Jan 27 20:12:54 2019
@@ -3,7 +3,7 @@ include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 include(CheckLibraryExists)
 
-check_library_exists(c fopen "" LIBUNWIND_HAS_C_LIB)
+check_library_exists(c __libc_start_main "" LIBUNWIND_HAS_C_LIB)
 
 if (NOT LIBUNWIND_USE_COMPILER_RT)
   check_library_exists(gcc_s __gcc_personality_v0 "" LIBUNWIND_HAS_GCC_S_LIB)


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


[libunwind] r352384 - [libunwind] Drop the dependency on , add placement new inline

2019-01-28 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jan 28 08:44:56 2019
New Revision: 352384

URL: http://llvm.org/viewvc/llvm-project?rev=352384&view=rev
Log:
[libunwind] Drop the dependency on , add placement new inline

We haven't eliminated C++ library dependency altogether in D57251,
UnwindCursor.hpp had an unused dependency on  which was
pulling in other C++ headers. Removing that dependency also revealed
(correctly) that we need our own global placement new declaration. Now
libunwind should be independent of the C++ library.

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

Modified:
libunwind/trunk/CMakeLists.txt
libunwind/trunk/src/Unwind-seh.cpp
libunwind/trunk/src/UnwindCursor.hpp
libunwind/trunk/src/libunwind.cpp

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=352384&r1=352383&r2=352384&view=diff
==
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Mon Jan 28 08:44:56 2019
@@ -287,6 +287,9 @@ unwind_append_if(LIBUNWIND_CXX_FLAGS LIB
 
 unwind_append_if(LIBUNWIND_C_FLAGS LIBUNWIND_HAS_FUNWIND_TABLES 
-funwind-tables)
 
+# Ensure that we don't depend on C++ standard library.
+unwind_append_if(LIBUNWIND_CXX_FLAGS LIBUNWIND_HAS_NOSTDINCXX_FLAG -nostdinc++)
+
 # Assert
 string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
 if (LIBUNWIND_ENABLE_ASSERTIONS)
@@ -341,28 +344,6 @@ endif()
 
 include_directories(include)
 
-find_path(
-  LIBUNWIND_LIBCXX_INCLUDES_INTERNAL
-  __libcpp_version
-  PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include
-${LLVM_MAIN_SRC_DIR}/runtimes/libcxx/include
-${LLVM_MAIN_SRC_DIR}/../libcxx/include
-  NO_DEFAULT_PATH
-  NO_CMAKE_FIND_ROOT_PATH
-  )
-if ((NOT LIBUNWIND_STANDALONE_BUILD OR HAVE_LIBCXX) AND
-IS_DIRECTORY "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
-  set(LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT 
"${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
-endif()
-
-set(LIBUNWIND_CXX_INCLUDE_PATHS "${LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT}" CACHE 
PATH
-"Paths to C++ header directories separated by ';'.")
-
-if (NOT LIBUNWIND_CXX_INCLUDE_PATHS STREQUAL "")
-  list(APPEND LIBUNWIND_CXX_FLAGS -nostdinc++)
-  include_directories("${LIBUNWIND_CXX_INCLUDE_PATHS}")
-endif()
-
 add_subdirectory(src)
 
 if (LIBUNWIND_INCLUDE_DOCS)

Modified: libunwind/trunk/src/Unwind-seh.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-seh.cpp?rev=352384&r1=352383&r2=352384&view=diff
==
--- libunwind/trunk/src/Unwind-seh.cpp (original)
+++ libunwind/trunk/src/Unwind-seh.cpp Mon Jan 28 08:44:56 2019
@@ -49,6 +49,10 @@ using namespace libunwind;
 /// Class of foreign exceptions based on unrecognized SEH exceptions.
 static const uint64_t kSEHExceptionClass = 0x434C4E4753454800; // CLNGSEH\0
 
+// libunwind does not and should not depend on C++ library which means that we
+// need our own declaration of global placement new.
+void *operator new(size_t, void*);
+
 /// Exception cleanup routine used by \c _GCC_specific_handler to
 /// free foreign exceptions.
 static void seh_exc_cleanup(_Unwind_Reason_Code urc, _Unwind_Exception *exc) {

Modified: libunwind/trunk/src/UnwindCursor.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindCursor.hpp?rev=352384&r1=352383&r2=352384&view=diff
==
--- libunwind/trunk/src/UnwindCursor.hpp (original)
+++ libunwind/trunk/src/UnwindCursor.hpp Mon Jan 28 08:44:56 2019
@@ -11,7 +11,6 @@
 #ifndef __UNWINDCURSOR_HPP__
 #define __UNWINDCURSOR_HPP__
 
-#include 
 #include 
 #include 
 #include 

Modified: libunwind/trunk/src/libunwind.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/libunwind.cpp?rev=352384&r1=352383&r2=352384&view=diff
==
--- libunwind/trunk/src/libunwind.cpp (original)
+++ libunwind/trunk/src/libunwind.cpp Mon Jan 28 08:44:56 2019
@@ -11,10 +11,6 @@
 
 #include 
 
-#ifndef NDEBUG
-#include  // getenv
-#endif
-
 #include "libunwind_ext.h"
 #include "config.h"
 
@@ -27,6 +23,10 @@
 
 using namespace libunwind;
 
+// libunwind does not and should not depend on C++ library which means that we
+// need our own declaration of global placement new.
+void *operator new(size_t, void*);
+
 /// internal object to represent this processes address space
 LocalAddressSpace LocalAddressSpace::sThisAddressSpace;
 


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


[libunwind] r352411 - Revert "[CMake] Use __libc_start_main rather than fopen when checking for C library"

2019-01-28 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jan 28 11:26:41 2019
New Revision: 352411

URL: http://llvm.org/viewvc/llvm-project?rev=352411&view=rev
Log:
Revert "[CMake] Use __libc_start_main rather than fopen when checking for C 
library"

This reverts commit r352341: it broke the build on macOS which doesn't
seem to provide __libc_start_main in its C library.

Modified:
libunwind/trunk/cmake/config-ix.cmake

Modified: libunwind/trunk/cmake/config-ix.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/cmake/config-ix.cmake?rev=352411&r1=352410&r2=352411&view=diff
==
--- libunwind/trunk/cmake/config-ix.cmake (original)
+++ libunwind/trunk/cmake/config-ix.cmake Mon Jan 28 11:26:41 2019
@@ -3,7 +3,7 @@ include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 include(CheckLibraryExists)
 
-check_library_exists(c __libc_start_main "" LIBUNWIND_HAS_C_LIB)
+check_library_exists(c fopen "" LIBUNWIND_HAS_C_LIB)
 
 if (NOT LIBUNWIND_USE_COMPILER_RT)
   check_library_exists(gcc_s __gcc_personality_v0 "" LIBUNWIND_HAS_GCC_S_LIB)


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


[libunwind] r352427 - Revert "[libunwind] Drop the dependency on , add placement new inline"

2019-01-28 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jan 28 12:55:12 2019
New Revision: 352427

URL: http://llvm.org/viewvc/llvm-project?rev=352427&view=rev
Log:
Revert "[libunwind] Drop the dependency on , add placement new 
inline"

This reverts commit r352384: this broke on ARM as UnwindCursor.hpp
still has some C++ library dependencies.

Modified:
libunwind/trunk/CMakeLists.txt
libunwind/trunk/src/Unwind-seh.cpp
libunwind/trunk/src/UnwindCursor.hpp
libunwind/trunk/src/libunwind.cpp

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=352427&r1=352426&r2=352427&view=diff
==
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Mon Jan 28 12:55:12 2019
@@ -287,9 +287,6 @@ unwind_append_if(LIBUNWIND_CXX_FLAGS LIB
 
 unwind_append_if(LIBUNWIND_C_FLAGS LIBUNWIND_HAS_FUNWIND_TABLES 
-funwind-tables)
 
-# Ensure that we don't depend on C++ standard library.
-unwind_append_if(LIBUNWIND_CXX_FLAGS LIBUNWIND_HAS_NOSTDINCXX_FLAG -nostdinc++)
-
 # Assert
 string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
 if (LIBUNWIND_ENABLE_ASSERTIONS)
@@ -344,6 +341,28 @@ endif()
 
 include_directories(include)
 
+find_path(
+  LIBUNWIND_LIBCXX_INCLUDES_INTERNAL
+  __libcpp_version
+  PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include
+${LLVM_MAIN_SRC_DIR}/runtimes/libcxx/include
+${LLVM_MAIN_SRC_DIR}/../libcxx/include
+  NO_DEFAULT_PATH
+  NO_CMAKE_FIND_ROOT_PATH
+  )
+if ((NOT LIBUNWIND_STANDALONE_BUILD OR HAVE_LIBCXX) AND
+IS_DIRECTORY "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
+  set(LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT 
"${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
+endif()
+
+set(LIBUNWIND_CXX_INCLUDE_PATHS "${LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT}" CACHE 
PATH
+"Paths to C++ header directories separated by ';'.")
+
+if (NOT LIBUNWIND_CXX_INCLUDE_PATHS STREQUAL "")
+  list(APPEND LIBUNWIND_CXX_FLAGS -nostdinc++)
+  include_directories("${LIBUNWIND_CXX_INCLUDE_PATHS}")
+endif()
+
 add_subdirectory(src)
 
 if (LIBUNWIND_INCLUDE_DOCS)

Modified: libunwind/trunk/src/Unwind-seh.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-seh.cpp?rev=352427&r1=352426&r2=352427&view=diff
==
--- libunwind/trunk/src/Unwind-seh.cpp (original)
+++ libunwind/trunk/src/Unwind-seh.cpp Mon Jan 28 12:55:12 2019
@@ -49,10 +49,6 @@ using namespace libunwind;
 /// Class of foreign exceptions based on unrecognized SEH exceptions.
 static const uint64_t kSEHExceptionClass = 0x434C4E4753454800; // CLNGSEH\0
 
-// libunwind does not and should not depend on C++ library which means that we
-// need our own declaration of global placement new.
-void *operator new(size_t, void*);
-
 /// Exception cleanup routine used by \c _GCC_specific_handler to
 /// free foreign exceptions.
 static void seh_exc_cleanup(_Unwind_Reason_Code urc, _Unwind_Exception *exc) {

Modified: libunwind/trunk/src/UnwindCursor.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindCursor.hpp?rev=352427&r1=352426&r2=352427&view=diff
==
--- libunwind/trunk/src/UnwindCursor.hpp (original)
+++ libunwind/trunk/src/UnwindCursor.hpp Mon Jan 28 12:55:12 2019
@@ -11,6 +11,7 @@
 #ifndef __UNWINDCURSOR_HPP__
 #define __UNWINDCURSOR_HPP__
 
+#include 
 #include 
 #include 
 #include 

Modified: libunwind/trunk/src/libunwind.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/libunwind.cpp?rev=352427&r1=352426&r2=352427&view=diff
==
--- libunwind/trunk/src/libunwind.cpp (original)
+++ libunwind/trunk/src/libunwind.cpp Mon Jan 28 12:55:12 2019
@@ -11,6 +11,10 @@
 
 #include 
 
+#ifndef NDEBUG
+#include  // getenv
+#endif
+
 #include "libunwind_ext.h"
 #include "config.h"
 
@@ -23,10 +27,6 @@
 
 using namespace libunwind;
 
-// libunwind does not and should not depend on C++ library which means that we
-// need our own declaration of global placement new.
-void *operator new(size_t, void*);
-
 /// internal object to represent this processes address space
 LocalAddressSpace LocalAddressSpace::sThisAddressSpace;
 


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


r352449 - [CMake][Fuchsia] Temporarily disable modules for second stage

2019-01-28 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Mon Jan 28 19:38:26 2019
New Revision: 352449

URL: http://llvm.org/viewvc/llvm-project?rev=352449&view=rev
Log:
[CMake][Fuchsia] Temporarily disable modules for second stage

This is breaking some of builders, disable modules until it's resolved.

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=352449&r1=352448&r2=352449&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Mon Jan 28 19:38:26 2019
@@ -9,7 +9,6 @@ if(NOT APPLE)
   set(LLVM_ENABLE_LLD ON CACHE BOOL "")
 endif()
 set(LLVM_ENABLE_LTO ON CACHE BOOL "")
-set(LLVM_ENABLE_MODULES ON CACHE BOOL "")
 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
 set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")


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


[libunwind] r352553 - Drop the dependency on , add placement new inline

2019-01-29 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jan 29 14:26:18 2019
New Revision: 352553

URL: http://llvm.org/viewvc/llvm-project?rev=352553&view=rev
Log:
Drop the dependency on , add placement new inline

We haven't eliminated C++ library dependency altogether in D57251,
UnwindCursor.hpp had an unused dependency on  which was
pulling in other C++ headers. Removing that dependency also revealed
(correctly) that we need our own global placement new declaration. Now
libunwind should be independent of the C++ library.

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

Modified:
libunwind/trunk/CMakeLists.txt
libunwind/trunk/src/Unwind-EHABI.cpp
libunwind/trunk/src/Unwind-seh.cpp
libunwind/trunk/src/UnwindCursor.hpp
libunwind/trunk/src/libunwind.cpp

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=352553&r1=352552&r2=352553&view=diff
==
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Tue Jan 29 14:26:18 2019
@@ -287,6 +287,9 @@ unwind_append_if(LIBUNWIND_CXX_FLAGS LIB
 
 unwind_append_if(LIBUNWIND_C_FLAGS LIBUNWIND_HAS_FUNWIND_TABLES 
-funwind-tables)
 
+# Ensure that we don't depend on C++ standard library.
+unwind_append_if(LIBUNWIND_CXX_FLAGS LIBUNWIND_HAS_NOSTDINCXX_FLAG -nostdinc++)
+
 # Assert
 string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
 if (LIBUNWIND_ENABLE_ASSERTIONS)
@@ -341,28 +344,6 @@ endif()
 
 include_directories(include)
 
-find_path(
-  LIBUNWIND_LIBCXX_INCLUDES_INTERNAL
-  __libcpp_version
-  PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include
-${LLVM_MAIN_SRC_DIR}/runtimes/libcxx/include
-${LLVM_MAIN_SRC_DIR}/../libcxx/include
-  NO_DEFAULT_PATH
-  NO_CMAKE_FIND_ROOT_PATH
-  )
-if ((NOT LIBUNWIND_STANDALONE_BUILD OR HAVE_LIBCXX) AND
-IS_DIRECTORY "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
-  set(LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT 
"${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
-endif()
-
-set(LIBUNWIND_CXX_INCLUDE_PATHS "${LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT}" CACHE 
PATH
-"Paths to C++ header directories separated by ';'.")
-
-if (NOT LIBUNWIND_CXX_INCLUDE_PATHS STREQUAL "")
-  list(APPEND LIBUNWIND_CXX_FLAGS -nostdinc++)
-  include_directories("${LIBUNWIND_CXX_INCLUDE_PATHS}")
-endif()
-
 add_subdirectory(src)
 
 if (LIBUNWIND_INCLUDE_DOCS)

Modified: libunwind/trunk/src/Unwind-EHABI.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-EHABI.cpp?rev=352553&r1=352552&r2=352553&view=diff
==
--- libunwind/trunk/src/Unwind-EHABI.cpp (original)
+++ libunwind/trunk/src/Unwind-EHABI.cpp Tue Jan 29 14:26:18 2019
@@ -20,8 +20,6 @@
 #include 
 #include 
 
-#include 
-
 #include "config.h"
 #include "libunwind.h"
 #include "libunwind_ext.h"

Modified: libunwind/trunk/src/Unwind-seh.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-seh.cpp?rev=352553&r1=352552&r2=352553&view=diff
==
--- libunwind/trunk/src/Unwind-seh.cpp (original)
+++ libunwind/trunk/src/Unwind-seh.cpp Tue Jan 29 14:26:18 2019
@@ -49,6 +49,10 @@ using namespace libunwind;
 /// Class of foreign exceptions based on unrecognized SEH exceptions.
 static const uint64_t kSEHExceptionClass = 0x434C4E4753454800; // CLNGSEH\0
 
+// libunwind does not and should not depend on C++ library which means that we
+// need our own declaration of global placement new.
+void *operator new(size_t, void*);
+
 /// Exception cleanup routine used by \c _GCC_specific_handler to
 /// free foreign exceptions.
 static void seh_exc_cleanup(_Unwind_Reason_Code urc, _Unwind_Exception *exc) {

Modified: libunwind/trunk/src/UnwindCursor.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindCursor.hpp?rev=352553&r1=352552&r2=352553&view=diff
==
--- libunwind/trunk/src/UnwindCursor.hpp (original)
+++ libunwind/trunk/src/UnwindCursor.hpp Tue Jan 29 14:26:18 2019
@@ -11,7 +11,6 @@
 #ifndef __UNWINDCURSOR_HPP__
 #define __UNWINDCURSOR_HPP__
 
-#include 
 #include 
 #include 
 #include 
@@ -105,7 +104,6 @@ private:
   static void dyldUnloadHook(const struct mach_header *mh, intptr_t slide);
   static bool _registeredForDyldUnloads;
 #endif
-  // Can't use std::vector<> here because this code is below libc++.
   static entry *_buffer;
   static entry *_bufferUsed;
   static entry *_bufferEnd;
@@ -1225,7 +1223,6 @@ template
 struct EHABISectionIterator {
   typedef EHABISectionIterator _Self;
 
-  typedef std::random_access_iterator_tag iterator_category;
   typedef typename A::pint_t value_type;
   typedef typename A::pint_t* pointer;
   typedef typename A::pint_t& reference;
@@ -1279,6 +1276,29 @@ struct EHABISectionIterator {
   const UnwindInfoSections* _sects;
 };
 
+n

[libunwind] r352559 - [libunwind] Support building hermetic static library

2019-01-29 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jan 29 15:01:08 2019
New Revision: 352559

URL: http://llvm.org/viewvc/llvm-project?rev=352559&view=rev
Log:
[libunwind] Support building hermetic static library

This is useful when the static libunwind library is being linked into
shared libraries that may be used in with other shared libraries that
use different unwinder. We want to avoid avoid exporting libunwind
symbols in those cases. This achieved by a new CMake option which can be
enabled by libunwind vendors as needed.

The same CMake option has already been added to libc++ and libc++abi in
D55404 and D56026.

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

Modified:
libunwind/trunk/CMakeLists.txt
libunwind/trunk/src/CMakeLists.txt

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=352559&r1=352558&r2=352559&view=diff
==
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Tue Jan 29 15:01:08 2019
@@ -168,6 +168,9 @@ elseif(LIBUNWIND_BUILD_32_BITS)
   message(FATAL_ERROR "LIBUNWIND_BUILD_32_BITS=ON is not supported on this 
platform.")
 endif()
 
+option(LIBUNWIND_HERMETIC_STATIC_LIBRARY
+  "Do not export any symbols from the static library." OFF)
+
 
#===
 # Configure System
 
#===

Modified: libunwind/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CMakeLists.txt?rev=352559&r1=352558&r2=352559&view=diff
==
--- libunwind/trunk/src/CMakeLists.txt (original)
+++ libunwind/trunk/src/CMakeLists.txt Tue Jan 29 15:01:08 2019
@@ -105,17 +105,44 @@ set_property(SOURCE ${LIBUNWIND_CXX_SOUR
 set_property(SOURCE ${LIBUNWIND_C_SOURCES}
  APPEND_STRING PROPERTY COMPILE_FLAGS " ${LIBUNWIND_C_FLAGS}")
 
+macro(unwind_object_library name)
+  cmake_parse_arguments(ARGS "" "" "DEFINES;FLAGS" ${ARGN})
+
 # Add a object library that contains the compiled source files.
-add_library(unwind_objects OBJECT ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+  add_library(${name} OBJECT ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+
+  if(ARGS_DEFINES)
+target_compile_definitions(${name} PRIVATE ${ARGS_DEFINES})
+  endif()
+
+  set_target_properties(${name}
+PROPERTIES
+  COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}"
+  POSITION_INDEPENDENT_CODE ON)
+
+  if(ARGS_FLAGS)
+target_compile_options(${name} PRIVATE ${ARGS_FLAGS})
+  endif()
+endmacro()
 
-set_target_properties(unwind_objects
-  PROPERTIES
-COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}"
-POSITION_INDEPENDENT_CODE ON)
+if(LIBUNWIND_HERMETIC_STATIC_LIBRARY)
+  append_flags_if_supported(UNWIND_STATIC_OBJECTS_FLAGS -fvisibility=hidden)
+  append_flags_if_supported(UNWIND_STATIC_OBJECTS_FLAGS 
-fvisibility-global-new-delete-hidden)
+  unwind_object_library(unwind_static_objects
+DEFINES _LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS
+FLAGS ${UNWIND_STATIC_OBJECTS_FLAGS})
+  unwind_object_library(unwind_shared_objects)
+  set(unwind_static_sources $)
+  set(unwind_shared_sources $)
+else()
+  unwind_object_library(unwind_objects)
+  set(unwind_static_sources $)
+  set(unwind_shared_sources $)
+endif()
 
 # Build the shared library.
 if (LIBUNWIND_ENABLE_SHARED)
-  add_library(unwind_shared SHARED $)
+  add_library(unwind_shared SHARED ${unwind_shared_sources})
   if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(unwind_shared)
   endif()
@@ -134,7 +161,7 @@ endif()
 
 # Build the static library.
 if (LIBUNWIND_ENABLE_STATIC)
-  add_library(unwind_static STATIC $)
+  add_library(unwind_static STATIC ${unwind_static_sources})
   target_link_libraries(unwind_static ${libraries})
   set_target_properties(unwind_static
 PROPERTIES


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


r352584 - [CMake][Fuchsia] Enable hermetic static libunwind for Fuchsia

2019-01-29 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jan 29 18:02:25 2019
New Revision: 352584

URL: http://llvm.org/viewvc/llvm-project?rev=352584&view=rev
Log:
[CMake][Fuchsia] Enable hermetic static libunwind for Fuchsia

In addition to libc++abi and libc++, we also want to use hermetic
static libunwind on Fuchsia.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=352584&r1=352583&r2=352584&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue Jan 29 18:02:25 2019
@@ -114,6 +114,7 @@ if(FUCHSIA_SDK)
 set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} 
CACHE PATH "")
 set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+set(RUNTIMES_${target}-fuchsia_LIBUNWIND_HERMETIC_STATIC_LIBRARY ON CACHE 
BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBUNWIND_INSTALL_STATIC_LIBRARY OFF CACHE 
BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
 set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL 
"")


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


r352586 - [CMake][Fuchsia] Re-enable iOS runtimes for Fuchsia standard

2019-01-29 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Tue Jan 29 18:06:06 2019
New Revision: 352586

URL: http://llvm.org/viewvc/llvm-project?rev=352586&view=rev
Log:
[CMake][Fuchsia] Re-enable iOS runtimes for Fuchsia standard

Turned out this is used by Flutter which uses Fuchsia Clang toolchain.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=352586&r1=352585&r2=352586&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue Jan 29 18:06:06 2019
@@ -35,7 +35,6 @@ if(APPLE)
   list(APPEND BUILTIN_TARGETS "default")
   list(APPEND RUNTIME_TARGETS "default")
 
-  set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
   set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
   set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
 endif()


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


[libunwind] r352654 - [CMake] Use correct visibility for linked libraries in CMake

2019-01-30 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 30 11:27:26 2019
New Revision: 352654

URL: http://llvm.org/viewvc/llvm-project?rev=352654&view=rev
Log:
[CMake] Use correct visibility for linked libraries in CMake

When linking library dependencies, we shouldn't need to export linked
libraries to dependents. We should be explicit about this in
target_link_libraries, otherwise other targets that depend on these such
as sanitizers get repeated (and possibly even conflicting) dependencies.

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

Modified:
libunwind/trunk/src/CMakeLists.txt

Modified: libunwind/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CMakeLists.txt?rev=352654&r1=352653&r2=352654&view=diff
==
--- libunwind/trunk/src/CMakeLists.txt (original)
+++ libunwind/trunk/src/CMakeLists.txt Wed Jan 30 11:27:26 2019
@@ -146,7 +146,7 @@ if (LIBUNWIND_ENABLE_SHARED)
   if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(unwind_shared)
   endif()
-  target_link_libraries(unwind_shared ${libraries})
+  target_link_libraries(unwind_shared PRIVATE ${libraries})
   set_target_properties(unwind_shared
 PROPERTIES
   LINK_FLAGS"${LIBUNWIND_LINK_FLAGS}"
@@ -162,7 +162,7 @@ endif()
 # Build the static library.
 if (LIBUNWIND_ENABLE_STATIC)
   add_library(unwind_static STATIC ${unwind_static_sources})
-  target_link_libraries(unwind_static ${libraries})
+  target_link_libraries(unwind_static PRIVATE ${libraries})
   set_target_properties(unwind_static
 PROPERTIES
   LINK_FLAGS"${LIBUNWIND_LINK_FLAGS}"


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


[libunwind] r352658 - Revert "[CMake] Use correct visibility for linked libraries in CMake"

2019-01-30 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 30 11:51:18 2019
New Revision: 352658

URL: http://llvm.org/viewvc/llvm-project?rev=352658&view=rev
Log:
Revert "[CMake] Use correct visibility for linked libraries in CMake"

This reverts commit r352654: this broke libcxx and sanitizer bots.

Modified:
libunwind/trunk/src/CMakeLists.txt

Modified: libunwind/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CMakeLists.txt?rev=352658&r1=352657&r2=352658&view=diff
==
--- libunwind/trunk/src/CMakeLists.txt (original)
+++ libunwind/trunk/src/CMakeLists.txt Wed Jan 30 11:51:18 2019
@@ -146,7 +146,7 @@ if (LIBUNWIND_ENABLE_SHARED)
   if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(unwind_shared)
   endif()
-  target_link_libraries(unwind_shared PRIVATE ${libraries})
+  target_link_libraries(unwind_shared ${libraries})
   set_target_properties(unwind_shared
 PROPERTIES
   LINK_FLAGS"${LIBUNWIND_LINK_FLAGS}"
@@ -162,7 +162,7 @@ endif()
 # Build the static library.
 if (LIBUNWIND_ENABLE_STATIC)
   add_library(unwind_static STATIC ${unwind_static_sources})
-  target_link_libraries(unwind_static PRIVATE ${libraries})
+  target_link_libraries(unwind_static ${libraries})
   set_target_properties(unwind_static
 PROPERTIES
   LINK_FLAGS"${LIBUNWIND_LINK_FLAGS}"


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


[libunwind] r352688 - [CMake] Use correct visibility for linked libraries in CMake

2019-01-30 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 30 15:18:05 2019
New Revision: 352688

URL: http://llvm.org/viewvc/llvm-project?rev=352688&view=rev
Log:
[CMake] Use correct visibility for linked libraries in CMake

When linking library dependencies, we shouldn't need to export linked
libraries to dependents. We should be explicit about this in
target_link_libraries, otherwise other targets that depend on these such
as sanitizers get repeated (and possibly even conflicting) dependencies.

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

Modified:
libunwind/trunk/src/CMakeLists.txt

Modified: libunwind/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CMakeLists.txt?rev=352688&r1=352687&r2=352688&view=diff
==
--- libunwind/trunk/src/CMakeLists.txt (original)
+++ libunwind/trunk/src/CMakeLists.txt Wed Jan 30 15:18:05 2019
@@ -146,7 +146,7 @@ if (LIBUNWIND_ENABLE_SHARED)
   if(COMMAND llvm_setup_rpath)
 llvm_setup_rpath(unwind_shared)
   endif()
-  target_link_libraries(unwind_shared ${libraries})
+  target_link_libraries(unwind_shared PRIVATE ${libraries})
   set_target_properties(unwind_shared
 PROPERTIES
   LINK_FLAGS"${LIBUNWIND_LINK_FLAGS}"
@@ -162,7 +162,7 @@ endif()
 # Build the static library.
 if (LIBUNWIND_ENABLE_STATIC)
   add_library(unwind_static STATIC ${unwind_static_sources})
-  target_link_libraries(unwind_static ${libraries})
+  target_link_libraries(unwind_static PRIVATE ${libraries})
   set_target_properties(unwind_static
 PROPERTIES
   LINK_FLAGS"${LIBUNWIND_LINK_FLAGS}"


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


r352729 - [CMake] Unify scripts for generating VCS headers

2019-01-30 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 30 22:21:01 2019
New Revision: 352729

URL: http://llvm.org/viewvc/llvm-project?rev=352729&view=rev
Log:
[CMake] Unify scripts for generating VCS headers

Previously, there were two different scripts for generating VCS headers:
one used by LLVM and one used by Clang. They were both similar, but
different. They were both broken in their own ways, for example the one
used by Clang didn't properly handle monorepo resulting in an incorrect
version information reported by Clang.

This change unifies two the scripts by introducing a new script that's
used from both LLVM and Clang, ensures that the new script supports both
monorepo and standalone SVN and Git setups, and removes the old scripts.

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

Modified:
cfe/trunk/lib/Basic/CMakeLists.txt
cfe/trunk/lib/Basic/Version.cpp

Modified: cfe/trunk/lib/Basic/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/CMakeLists.txt?rev=352729&r1=352728&r2=352729&view=diff
==
--- cfe/trunk/lib/Basic/CMakeLists.txt (original)
+++ cfe/trunk/lib/Basic/CMakeLists.txt Wed Jan 30 22:21:01 2019
@@ -4,45 +4,34 @@ set(LLVM_LINK_COMPONENTS
   Support
   )
 
-find_first_existing_vc_file(llvm_vc "${LLVM_MAIN_SRC_DIR}")
-find_first_existing_vc_file(clang_vc "${CLANG_SOURCE_DIR}")
+find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
+find_first_existing_vc_file("${CLANG_SOURCE_DIR}" clang_vc)
 
 # The VC revision include that we want to generate.
-set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc")
+set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSRevision.h")
 
-set(get_svn_script "${LLVM_CMAKE_PATH}/GetSVN.cmake")
+set(get_svn_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake")
 
-if(DEFINED llvm_vc AND DEFINED clang_vc)
-  # Create custom target to generate the VC revision include.
-  add_custom_command(OUTPUT "${version_inc}"
-DEPENDS "${llvm_vc}" "${clang_vc}" "${get_svn_script}"
-COMMAND
-${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLVM_MAIN_SRC_DIR}"
- "-DFIRST_NAME=LLVM"
- "-DSECOND_SOURCE_DIR=${CLANG_SOURCE_DIR}"
- "-DSECOND_NAME=SVN"
- "-DHEADER_FILE=${version_inc}"
- -P "${get_svn_script}")
-
-  # Mark the generated header as being generated.
-  set_source_files_properties("${version_inc}"
-PROPERTIES GENERATED TRUE
-   HEADER_FILE_ONLY TRUE)
-
-  # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC.
-  set_source_files_properties(Version.cpp
-PROPERTIES COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC")
-else()
-  # Not producing a VC revision include.
-  set(version_inc)
-
-  # Being able to force-set the SVN revision in cases where it isn't available
-  # is useful for performance tracking, and matches compatibility from 
autoconf.
-  if(SVN_REVISION)
-set_source_files_properties(Version.cpp
-  PROPERTIES COMPILE_DEFINITIONS "SVN_REVISION=\"${SVN_REVISION}\"")
-  endif()
+if(llvm_vc)
+  set(llvm_source_dir ${LLVM_MAIN_SRC_DIR})
 endif()
+if(clang_vc)
+  set(clang_source_dir ${CLANG_SOURCE_DIR})
+endif()
+
+# Create custom target to generate the VC revision include.
+add_custom_command(OUTPUT "${version_inc}"
+  DEPENDS "${llvm_vc}" "${clang_vc}" "${get_svn_script}"
+  COMMAND ${CMAKE_COMMAND} "-DNAMES=LLVM\;CLANG"
+   "-DLLVM_SOURCE_DIR=${llvm_source_dir}"
+   "-DCLANG_SOURCE_DIR=${clang_source_dir}"
+   "-DHEADER_FILE=${version_inc}"
+   -P "${get_svn_script}")
+
+# Mark the generated header as being generated.
+set_source_files_properties("${version_inc}"
+  PROPERTIES GENERATED TRUE
+ HEADER_FILE_ONLY TRUE)
 
 add_clang_library(clangBasic
   Attributes.cpp

Modified: cfe/trunk/lib/Basic/Version.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Version.cpp?rev=352729&r1=352728&r2=352729&view=diff
==
--- cfe/trunk/lib/Basic/Version.cpp (original)
+++ cfe/trunk/lib/Basic/Version.cpp Wed Jan 30 22:21:01 2019
@@ -10,6 +10,7 @@
 //
 
//===--===//
 
+#include "VCSRevision.h"
 #include "clang/Basic/Version.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Config/config.h"
@@ -17,23 +18,19 @@
 #include 
 #include 
 
-#ifdef HAVE_SVN_VERSION_INC
-#  include "SVNVersion.inc"
-#endif
-
 namespace clang {
 
 std::string getClangRepositoryPath() {
 #if defined(CLANG_REPOSITORY_STRING)
   return CLANG_REPOSITORY_STRING;
 #else
-#ifdef SVN_REPOSITORY
-  StringRef URL(SVN_REPOSITORY);
+#ifdef CLANG_REPOSITORY
+  StringRef URL(CLANG_REPOSITORY);
 #else
   StringRef URL("");
 #endif
 
-  // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
+  // If the

r352733 - Revert "[CMake] Unify scripts for generating VCS headers"

2019-01-30 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Wed Jan 30 23:12:43 2019
New Revision: 352733

URL: http://llvm.org/viewvc/llvm-project?rev=352733&view=rev
Log:
Revert "[CMake] Unify scripts for generating VCS headers"

This reverts commits r352729 and r352731: this broke Sanitizer Windows bots

Modified:
cfe/trunk/lib/Basic/CMakeLists.txt
cfe/trunk/lib/Basic/Version.cpp

Modified: cfe/trunk/lib/Basic/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/CMakeLists.txt?rev=352733&r1=352732&r2=352733&view=diff
==
--- cfe/trunk/lib/Basic/CMakeLists.txt (original)
+++ cfe/trunk/lib/Basic/CMakeLists.txt Wed Jan 30 23:12:43 2019
@@ -4,34 +4,45 @@ set(LLVM_LINK_COMPONENTS
   Support
   )
 
-find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
-find_first_existing_vc_file("${CLANG_SOURCE_DIR}" clang_vc)
+find_first_existing_vc_file(llvm_vc "${LLVM_MAIN_SRC_DIR}")
+find_first_existing_vc_file(clang_vc "${CLANG_SOURCE_DIR}")
 
 # The VC revision include that we want to generate.
-set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSRevision.h")
+set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc")
 
-set(get_svn_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake")
+set(get_svn_script "${LLVM_CMAKE_PATH}/GetSVN.cmake")
 
-if(llvm_vc)
-  set(llvm_source_dir ${LLVM_MAIN_SRC_DIR})
+if(DEFINED llvm_vc AND DEFINED clang_vc)
+  # Create custom target to generate the VC revision include.
+  add_custom_command(OUTPUT "${version_inc}"
+DEPENDS "${llvm_vc}" "${clang_vc}" "${get_svn_script}"
+COMMAND
+${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLVM_MAIN_SRC_DIR}"
+ "-DFIRST_NAME=LLVM"
+ "-DSECOND_SOURCE_DIR=${CLANG_SOURCE_DIR}"
+ "-DSECOND_NAME=SVN"
+ "-DHEADER_FILE=${version_inc}"
+ -P "${get_svn_script}")
+
+  # Mark the generated header as being generated.
+  set_source_files_properties("${version_inc}"
+PROPERTIES GENERATED TRUE
+   HEADER_FILE_ONLY TRUE)
+
+  # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC.
+  set_source_files_properties(Version.cpp
+PROPERTIES COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC")
+else()
+  # Not producing a VC revision include.
+  set(version_inc)
+
+  # Being able to force-set the SVN revision in cases where it isn't available
+  # is useful for performance tracking, and matches compatibility from 
autoconf.
+  if(SVN_REVISION)
+set_source_files_properties(Version.cpp
+  PROPERTIES COMPILE_DEFINITIONS "SVN_REVISION=\"${SVN_REVISION}\"")
+  endif()
 endif()
-if(clang_vc)
-  set(clang_source_dir ${CLANG_SOURCE_DIR})
-endif()
-
-# Create custom target to generate the VC revision include.
-add_custom_command(OUTPUT "${version_inc}"
-  DEPENDS "${llvm_vc}" "${clang_vc}" "${get_svn_script}"
-  COMMAND ${CMAKE_COMMAND} "-DNAMES=LLVM\;CLANG"
-   "-DLLVM_SOURCE_DIR=${llvm_source_dir}"
-   "-DCLANG_SOURCE_DIR=${clang_source_dir}"
-   "-DHEADER_FILE=${version_inc}"
-   -P "${get_svn_script}")
-
-# Mark the generated header as being generated.
-set_source_files_properties("${version_inc}"
-  PROPERTIES GENERATED TRUE
- HEADER_FILE_ONLY TRUE)
 
 add_clang_library(clangBasic
   Attributes.cpp

Modified: cfe/trunk/lib/Basic/Version.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Version.cpp?rev=352733&r1=352732&r2=352733&view=diff
==
--- cfe/trunk/lib/Basic/Version.cpp (original)
+++ cfe/trunk/lib/Basic/Version.cpp Wed Jan 30 23:12:43 2019
@@ -10,7 +10,6 @@
 //
 
//===--===//
 
-#include "VCSRevision.h"
 #include "clang/Basic/Version.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Config/config.h"
@@ -18,19 +17,23 @@
 #include 
 #include 
 
+#ifdef HAVE_SVN_VERSION_INC
+#  include "SVNVersion.inc"
+#endif
+
 namespace clang {
 
 std::string getClangRepositoryPath() {
 #if defined(CLANG_REPOSITORY_STRING)
   return CLANG_REPOSITORY_STRING;
 #else
-#ifdef CLANG_REPOSITORY
-  StringRef URL(CLANG_REPOSITORY);
+#ifdef SVN_REPOSITORY
+  StringRef URL(SVN_REPOSITORY);
 #else
   StringRef URL("");
 #endif
 
-  // If the CLANG_REPOSITORY is empty, try to use the SVN keyword. This helps 
us
+  // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
   // pick up a tag in an SVN export, for example.
   StringRef SVNRepository("$URL$");
   if (URL.empty()) {
@@ -68,8 +71,8 @@ std::string getLLVMRepositoryPath() {
 }
 
 std::string getClangRevision() {
-#ifdef CLANG_REVISION
-  return CLANG_REVISION;
+#ifdef SVN_REVISION
+  return SVN_REVISION;
 #else
   return "";
 #endif


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://list

r345889 - [CMake][Fuchsia] Don't restrict Linux runtimes to UNIX

2018-11-01 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Thu Nov  1 13:36:33 2018
New Revision: 345889

URL: http://llvm.org/viewvc/llvm-project?rev=345889&view=rev
Log:
[CMake][Fuchsia] Don't restrict Linux runtimes to UNIX

This allows building Linux runtimes on any platform if the correct
sysroot is provided via CMake option.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=345889&r1=345888&r2=345889&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Thu Nov  1 13:36:33 2018
@@ -31,40 +31,40 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3
 if(APPLE)
   list(APPEND BUILTIN_TARGETS "default")
   list(APPEND RUNTIME_TARGETS "default")
-elseif(UNIX)
-  foreach(target i386;x86_64;armhf;aarch64)
-if(LINUX_${target}_SYSROOT)
-  # Set the per-target builtins options.
-  list(APPEND BUILTIN_TARGETS "${target}-linux-gnu")
-  set(BUILTINS_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
-  set(BUILTINS_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING 
"")
-  set(BUILTINS_${target}-linux-gnu_CMAKE_SYSROOT 
${LINUX_${target}_SYSROOT} CACHE STRING "")
-
-  # Set the per-target runtimes options.
-  list(APPEND RUNTIME_TARGETS "${target}-linux-gnu")
-  set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
-  set(RUNTIMES_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING 
"")
-  set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSROOT 
${LINUX_${target}_SYSROOT} CACHE STRING "")
-  set(RUNTIMES_${target}-linux-gnu_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
-  set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL 
"")
-  set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL 
"")
-  set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_INSTALL_LIBRARY OFF CACHE 
BOOL "")
-  set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL 
"")
-  set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL 
"")
-  set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE 
BOOL "")
-  set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_ENABLE_STATIC_UNWINDER ON 
CACHE BOOL "")
-  set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_INSTALL_LIBRARY OFF CACHE 
BOOL "")
-  set(RUNTIMES_${target}-linux-gnu_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
-  set(RUNTIMES_${target}-linux-gnu_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
-  set(RUNTIMES_${target}-linux-gnu_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON 
CACHE BOOL "")
-  set(RUNTIMES_${target}-linux-gnu_LIBCXX_ABI_VERSION 2 CACHE STRING "")
-  set(RUNTIMES_${target}-linux-gnu_SANITIZER_CXX_ABI "libc++" CACHE STRING 
"")
-  set(RUNTIMES_${target}-linux-gnu_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL 
"")
-  set(RUNTIMES_${target}-linux-gnu_COMPILER_RT_USE_BUILTINS_LIBRARY ON 
CACHE BOOL "")
-endif()
-  endforeach()
 endif()
 
+foreach(target i386;x86_64;armhf;aarch64)
+  if(LINUX_${target}_SYSROOT)
+# Set the per-target builtins options.
+list(APPEND BUILTIN_TARGETS "${target}-linux-gnu")
+set(BUILTINS_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
+set(BUILTINS_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING "")
+set(BUILTINS_${target}-linux-gnu_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} 
CACHE STRING "")
+
+# Set the per-target runtimes options.
+list(APPEND RUNTIME_TARGETS "${target}-linux-gnu")
+set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
+set(RUNTIMES_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING "")
+set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} 
CACHE STRING "")
+set(RUNTIMES_${target}-linux-gnu_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
+set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
+set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL 
"")
+set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL 
"")
+set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL 
"")
+set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
+set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL 
"")
+set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE 
BOOL "")
+set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL 
"")
+set(RUNTIMES_${target}-linux-gnu_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+set(RUNTIMES_${target}-linux-gnu_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
+set(RUNTIMES_${target}-linux-gnu_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE 
BOOL "")
+set(RUNTIMES_${target

Re: r345562 - PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type

2018-11-01 Thread Petr Hosek via cfe-commits
This is triggering an assertion failure in our build, I've filed
PR39528 which also has a reproducer.

On Mon, Oct 29, 2018 at 7:04 PM Richard Smith via cfe-commits
 wrote:
>
> Author: rsmith
> Date: Mon Oct 29 19:02:49 2018
> New Revision: 345562
>
> URL: http://llvm.org/viewvc/llvm-project?rev=345562&view=rev
> Log:
> PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type
> nullptr_t does not access memory.
>
> We now reuse CK_NullToPointer to represent a conversion from a glvalue
> of type nullptr_t to a prvalue of nullptr_t where necessary.
>
> Modified:
> cfe/trunk/lib/AST/Expr.cpp
> cfe/trunk/lib/CodeGen/CGExprAgg.cpp
> cfe/trunk/lib/CodeGen/CGExprScalar.cpp
> cfe/trunk/lib/Sema/SemaExpr.cpp
> cfe/trunk/lib/Sema/SemaInit.cpp
> cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp
> cfe/trunk/test/Analysis/nullptr.cpp
> cfe/trunk/test/CXX/drs/dr21xx.cpp
> cfe/trunk/test/CodeGenCXX/nullptr.cpp
> cfe/trunk/www/cxx_dr_status.html
>
> Modified: cfe/trunk/lib/AST/Expr.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=345562&r1=345561&r2=345562&view=diff
> ==
> --- cfe/trunk/lib/AST/Expr.cpp (original)
> +++ cfe/trunk/lib/AST/Expr.cpp Mon Oct 29 19:02:49 2018
> @@ -1816,6 +1816,11 @@ ImplicitCastExpr *ImplicitCastExpr::Crea
>void *Buffer =
>C.Allocate(totalSizeToAlloc *>(
>PathSize ? 1 : 0, PathSize));
> +  // Per C++ [conv.lval]p3, lvalue-to-rvalue conversions on class and
> +  // std::nullptr_t have special semantics not captured by CK_LValueToRValue.
> +  assert((Kind != CK_LValueToRValue ||
> +  !(T->isNullPtrType() || T->getAsCXXRecordDecl())) &&
> + "invalid type for lvalue-to-rvalue conversion");
>ImplicitCastExpr *E =
>  new (Buffer) ImplicitCastExpr(T, Kind, Operand, PathSize, VK);
>if (PathSize)
>
> Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=345562&r1=345561&r2=345562&view=diff
> ==
> --- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Mon Oct 29 19:02:49 2018
> @@ -1300,7 +1300,8 @@ static bool isSimpleZero(const Expr *E,
>// (int*)0 - Null pointer expressions.
>if (const CastExpr *ICE = dyn_cast(E))
>  return ICE->getCastKind() == CK_NullToPointer &&
> -CGF.getTypes().isPointerZeroInitializable(E->getType());
> +   CGF.getTypes().isPointerZeroInitializable(E->getType()) &&
> +   !E->HasSideEffects(CGF.getContext());
>// '\0'
>if (const CharacterLiteral *CL = dyn_cast(E))
>  return CL->getValue() == 0;
>
> Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=345562&r1=345561&r2=345562&view=diff
> ==
> --- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Mon Oct 29 19:02:49 2018
> @@ -1895,14 +1895,14 @@ Value *ScalarExprEmitter::VisitCastExpr(
>
>case CK_NullToPointer:
>  if (MustVisitNullValue(E))
> -  (void) Visit(E);
> +  CGF.EmitIgnoredExpr(E);
>
>  return 
> CGF.CGM.getNullPointer(cast(ConvertType(DestTy)),
>DestTy);
>
>case CK_NullToMemberPointer: {
>  if (MustVisitNullValue(E))
> -  (void) Visit(E);
> +  CGF.EmitIgnoredExpr(E);
>
>  const MemberPointerType *MPT = CE->getType()->getAs();
>  return CGF.CGM.getCXXABI().EmitNullMemberPointer(MPT);
>
> Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=345562&r1=345561&r2=345562&view=diff
> ==
> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Oct 29 19:02:49 2018
> @@ -623,8 +623,11 @@ ExprResult Sema::DefaultLvalueConversion
>if (E->getType().getObjCLifetime() == Qualifiers::OCL_Weak)
>  Cleanup.setExprNeedsCleanups(true);
>
> -  ExprResult Res = ImplicitCastExpr::Create(Context, T, CK_LValueToRValue, E,
> -nullptr, VK_RValue);
> +  // C++ [conv.lval]p3:
> +  //   If T is cv std::nullptr_t, the result is a null pointer constant.
> +  CastKind CK = T->isNullPtrType() ? CK_NullToPointer : CK_LValueToRValue;
> +  ExprResult Res =
> +  ImplicitCastExpr::Create(Context, T, CK, E, nullptr, VK_RValue);
>
>// C11 6.3.2.1p2:
>//   ... if the lvalue has atomic type, the value has the non-atomic 
> version
>
> Modified: cfe/trunk/lib/Sema/SemaInit.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=345562&r1=345561&r2=345562&view=diff
> ===

r346056 - [CMake][Fuchsia] Set -fuse-ld=lld explicitly for Linux runtimes

2018-11-02 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri Nov  2 16:49:36 2018
New Revision: 346056

URL: http://llvm.org/viewvc/llvm-project?rev=346056&view=rev
Log:
[CMake][Fuchsia] Set -fuse-ld=lld explicitly for Linux runtimes

We set lld as the default linker on non-Darwin platforms, but we still
need to set -fuse-ld=lld explicitly in to support cross-compiling Linux
runtimes on Darwin.

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

Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake

Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=346056&r1=346055&r2=346056&view=diff
==
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Fri Nov  2 16:49:36 2018
@@ -40,12 +40,18 @@ foreach(target i386;x86_64;armhf;aarch64
 set(BUILTINS_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
 set(BUILTINS_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING "")
 set(BUILTINS_${target}-linux-gnu_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} 
CACHE STRING "")
+set(BUILTINS_${target}-linux-gnu_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" 
CACHE STRING "")
+set(BUILTINS_${target}-linux-gnu_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" 
CACHE STRING "")
+set(BUILTINS_${target}-linux-gnu_CMAKE_EXE_LINKER_FLAG "-fuse-ld=lld" 
CACHE STRING "")
 
 # Set the per-target runtimes options.
 list(APPEND RUNTIME_TARGETS "${target}-linux-gnu")
 set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
 set(RUNTIMES_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING "")
 set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} 
CACHE STRING "")
+set(RUNTIMES_${target}-linux-gnu_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" 
CACHE STRING "")
+set(RUNTIMES_${target}-linux-gnu_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" 
CACHE STRING "")
+set(RUNTIMES_${target}-linux-gnu_CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld" 
CACHE STRING "")
 set(RUNTIMES_${target}-linux-gnu_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
 set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
 set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL 
"")
@@ -79,25 +85,25 @@ if(FUCHSIA_SDK)
 list(APPEND BUILTIN_TARGETS "${target}-fuchsia")
 set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
 set(BUILTINS_${target}-fuchsia_CMAKE_BUILD_TYPE Release CACHE STRING "")
-set(BUILTINS_${target}-fuchsia_CMAKE_ASM_FLAGS 
${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-set(BUILTINS_${target}-fuchsia_CMAKE_C_FLAGS 
${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-set(BUILTINS_${target}-fuchsia_CMAKE_CXX_FLAGS 
${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-set(BUILTINS_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS 
${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
-set(BUILTINS_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS 
${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
-set(BUILTINS_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS 
${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
+set(BUILTINS_${target}-fuchsia_CMAKE_ASM_FLAGS 
${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
+set(BUILTINS_${target}-fuchsia_CMAKE_C_FLAGS 
${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
+set(BUILTINS_${target}-fuchsia_CMAKE_CXX_FLAGS 
${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
+set(BUILTINS_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS 
${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
+set(BUILTINS_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS 
${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
+set(BUILTINS_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS 
${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
 set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} 
CACHE PATH "")
 
 # Set the per-target runtimes options.
 list(APPEND RUNTIME_TARGETS "${target}-fuchsia")
 set(RUNTIMES_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
 set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_TYPE Release CACHE STRING "")
-set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE 
STRING "")
-set(RUNTIMES_${target}-fuchsia_CMAKE_ASM_FLAGS 
${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-set(RUNTIMES_${target}-fuchsia_CMAKE_C_FLAGS 
${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-set(RUNTIMES_${target}-fuchsia_CMAKE_CXX_FLAGS 
${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-set(RUNTIMES_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS 
${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
-set(RUNTIMES_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS 
${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
-set(RUNTIMES_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS 
${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
+set

r346064 - [Driver] Use -push-/-pop-state and -as-needed for libc++ on Fuchsia

2018-11-02 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Fri Nov  2 18:43:25 2018
New Revision: 346064

URL: http://llvm.org/viewvc/llvm-project?rev=346064&view=rev
Log:
[Driver] Use -push-/-pop-state and -as-needed for libc++ on Fuchsia

This avoids introducing unnecessary DT_NEEDED entries when using
C++ driver for linking C code or C++ code that doesn't use C++
standard library.

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

Modified:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/test/Driver/fuchsia.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=346064&r1=346063&r2=346064&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Fri Nov  2 18:43:25 2018
@@ -122,13 +122,14 @@ void fuchsia::Linker::ConstructJob(Compi
   if (ToolChain.ShouldLinkCXXStdlib(Args)) {
 bool OnlyLibstdcxxStatic = Args.hasArg(options::OPT_static_libstdcxx) 
&&
!Args.hasArg(options::OPT_static);
+CmdArgs.push_back("--push-state");
+CmdArgs.push_back("--as-needed");
 if (OnlyLibstdcxxStatic)
-  CmdArgs.push_back("-Bstatic");
+  CmdArgs.push_back("-static");
 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
-if (OnlyLibstdcxxStatic)
-  CmdArgs.push_back("-Bdynamic");
+CmdArgs.push_back("-lm");
+CmdArgs.push_back("--pop-state");
   }
-  CmdArgs.push_back("-lm");
 }
 
 AddRunTimeLibs(ToolChain, D, CmdArgs, Args);

Modified: cfe/trunk/test/Driver/fuchsia.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.cpp?rev=346064&r1=346063&r2=346064&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.cpp (original)
+++ cfe/trunk/test/Driver/fuchsia.cpp Fri Nov  2 18:43:25 2018
@@ -15,7 +15,11 @@
 // CHECK-NOT: crti.o
 // CHECK-NOT: crtbegin.o
 // CHECK: "-L[[SYSROOT]]{{/|}}lib"
-// CHECK: "-lc++" "-lm"
+// CHECK: "--push-state"
+// CHECK: "--as-needed"
+// CHECK: "-lc++"
+// CHECK: "-lm"
+// CHECK: "--pop-state"
 // CHECK: "{{.*[/\\]}}libclang_rt.builtins-x86_64.a"
 // CHECK: "-lc"
 // CHECK-NOT: crtend.o
@@ -29,8 +33,10 @@
 // RUN: %clangxx %s -### --target=x86_64-unknown-fuchsia -static-libstdc++ \
 // RUN: -fuse-ld=lld 2>&1 \
 // RUN: | FileCheck %s -check-prefix=CHECK-STATIC
-// CHECK-STATIC: "-Bstatic"
+// CHECK-STATIC: "--push-state"
+// CHECK-STATIC: "--as-needed"
+// CHECK-STATIC: "-static"
 // CHECK-STATIC: "-lc++"
-// CHECK-STATIC: "-Bdynamic"
 // CHECK-STATIC: "-lm"
+// CHECK-STATIC: "--pop-state"
 // CHECK-STATIC: "-lc"


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


r346088 - [Driver] Always match resource dir in Fuchsia driver tests

2018-11-03 Thread Petr Hosek via cfe-commits
Author: phosek
Date: Sat Nov  3 20:53:07 2018
New Revision: 346088

URL: http://llvm.org/viewvc/llvm-project?rev=346088&view=rev
Log:
[Driver] Always match resource dir in Fuchsia driver tests

This makes the tests stricter by not only matching the runtime file
name, but the entire path into the resource directory.

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

Modified:
cfe/trunk/test/Driver/fuchsia.c
cfe/trunk/test/Driver/fuchsia.cpp

Modified: cfe/trunk/test/Driver/fuchsia.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.c?rev=346088&r1=346087&r2=346088&view=diff
==
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Sat Nov  3 20:53:07 2018
@@ -10,6 +10,7 @@
 // CHECK: "--mrelax-relocations"
 // CHECK: "-munwind-tables"
 // CHECK: "-fuse-init-array"
+// CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
 // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
 // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|}}include"
 // CHECK: "-fsanitize=safe-stack"
@@ -25,8 +26,8 @@
 // CHECK-NOT: crti.o
 // CHECK-NOT: crtbegin.o
 // CHECK: "-L[[SYSROOT]]{{/|}}lib"
-// CHECK-X86_64: "{{.*[/\\]}}libclang_rt.builtins.a"
-// CHECK-AARCH64: "{{.*[/\\]}}libclang_rt.builtins.a"
+// CHECK-X86_64: 
"[[RESOURCE_DIR]]{{/|}}x86_64-fuchsia{{/|}}lib{{/|}}libclang_rt.builtins.a"
+// CHECK-AARCH64: 
"[[RESOURCE_DIR]]{{/|}}aarch64-fuchsia{{/|}}lib{{/|}}libclang_rt.builtins.a"
 // CHECK: "-lc"
 // CHECK-NOT: crtend.o
 // CHECK-NOT: crtn.o
@@ -57,8 +58,9 @@
 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
 // RUN: -fuse-ld=lld \
 // RUN: | FileCheck %s -check-prefix=CHECK-SAFESTACK
+// CHECK-SAFESTACK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
 // CHECK-SAFESTACK: "-fsanitize=safe-stack"
-// CHECK-SAFESTACK-NOT: "{{.*[/\\]}}libclang_rt.safestack.a"
+// CHECK-SAFESTACK-NOT: 
"[[RESOURCE_DIR]]{{/|}}x86_64-fuchsia{{/|}}lib{{/|}}libclang_rt.safestack.a"
 // CHECK-SAFESTACK-NOT: "__safestack_init"
 
 // RUN: %clang %s -### --target=x86_64-fuchsia \
@@ -94,52 +96,58 @@
 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
 // RUN: -fuse-ld=lld \
 // RUN: | FileCheck %s -check-prefix=CHECK-ASAN-SHARED
+// CHECK-ASAN-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
 // CHECK-ASAN-SHARED: "-fsanitize=address"
 // CHECK-ASAN-SHARED: "-fsanitize-address-globals-dead-stripping"
-// CHECK-ASAN-SHARED: "{{.*[/\\]}}libclang_rt.asan.so"
-// CHECK-ASAN-SHARED-NOT: "{{.*[/\\]}}libclang_rt.asan-preinit.a"
+// CHECK-ASAN-SHARED: 
"[[RESOURCE_DIR]]{{/|}}x86_64-fuchsia{{/|}}lib{{/|}}libclang_rt.asan.so"
+// CHECK-ASAN-SHARED-NOT: 
"[[RESOURCE_DIR]]{{/|}}x86_64-fuchsia{{/|}}lib{{/|}}libclang_rt.asan-preinit.a"
 
 // RUN: %clang %s -### --target=x86_64-fuchsia \
 // RUN: -fsanitize=fuzzer 2>&1 \
 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
 // RUN: -fuse-ld=lld \
 // RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-X86
+// CHECK-FUZZER-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
 // CHECK-FUZZER-X86: "-fsanitize=fuzzer,fuzzer-no-link,safe-stack"
-// CHECK-FUZZER-X86: "{{.*[/\\]}}libclang_rt.fuzzer.a"
+// CHECK-FUZZER-X86: 
"[[RESOURCE_DIR]]{{/|}}x86_64-fuchsia{{/|}}lib{{/|}}libclang_rt.fuzzer.a"
 
 // RUN: %clang %s -### --target=aarch64-fuchsia \
 // RUN: -fsanitize=fuzzer 2>&1 \
 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
 // RUN: -fuse-ld=lld \
 // RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-AARCH64
+// CHECK-FUZZER-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
 // CHECK-FUZZER-AARCH64: "-fsanitize=fuzzer,fuzzer-no-link,safe-stack"
-// CHECK-FUZZER-AARCH64: "{{.*[/\\]}}libclang_rt.fuzzer.a"
+// CHECK-FUZZER-AARCH64: 
"[[RESOURCE_DIR]]{{/|}}aarch64-fuchsia{{/|}}lib{{/|}}libclang_rt.fuzzer.a"
 
 // RUN: %clang %s -### --target=x86_64-fuchsia \
 // RUN: -fsanitize=scudo 2>&1 \
 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
 // RUN: -fuse-ld=lld \
 // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-X86
+// CHECK-SCUDO-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
 // CHECK-SCUDO-X86: "-fsanitize=safe-stack,scudo"
 // CHECK-SCUDO-X86: "-pie"
-// CHECK-SCUDO-X86: "{{.*[/\\]}}libclang_rt.scudo.so"
+// CHECK-SCUDO-X86: 
"[[RESOURCE_DIR]]{{/|}}x86_64-fuchsia{{/|}}lib{{/|}}libclang_rt.scudo.so"
 
 // RUN: %clang %s -### --target=aarch64-fuchsia \
 // RUN: -fsanitize=scudo 2>&1 \
 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
 // RUN: -fuse-ld=lld \
 // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-AARCH64
+// CHECK-SCUDO-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
 // CHECK-SCUDO-AARCH64: "-fsanitize=safe-stack,scudo"
 // CHECK-SCUDO-AARCH64: "-pie"
-// CHECK-SCUDO-AARCH64: "{{.*[/\\]}}libcl

  1   2   3   4   5   6   7   8   9   10   >