Commit a3260630 authored by Sylvestre Ledru's avatar Sylvestre Ledru

Merge remote-tracking branch 'origin/7' into 8

parents d28dee30 ef29b2eb
[hurd] Fix unconditional use of PATH_MAX
The GNU/Hurd system does not define an arbitrary PATH_MAX limitation, the POSIX 2001 realpath extension can be used instead, and the size of symlinks can be determined.
https://reviews.llvm.org/D54677
Index: llvm-toolchain-snapshot_8~svn347511/libcxx/src/filesystem/operations.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn347511.orig/libcxx/src/filesystem/operations.cpp
+++ llvm-toolchain-snapshot_8~svn347511/libcxx/src/filesystem/operations.cpp
@@ -530,11 +530,20 @@ path __canonical(path const& orig_p, err
ErrorHandler<path> err("canonical", ec, &orig_p, &cwd);
path p = __do_absolute(orig_p, &cwd, ec);
+#if _POSIX_VERSION >= 200112 || defined(__GLIBC__)
+ char *buff;
+ if ((buff = ::realpath(p.c_str(), NULL)) == nullptr)
+ return err.report(capture_errno());
+ path ret = {buff};
+ free(buff);
+ return ret;
+#else
char buff[PATH_MAX + 1];
char* ret;
if ((ret = ::realpath(p.c_str(), buff)) == nullptr)
return err.report(capture_errno());
return {ret};
+#endif
}
void __copy(const path& from, const path& to, copy_options options,
@@ -1076,16 +1085,27 @@ void __permissions(const path& p, perms
path __read_symlink(const path& p, error_code* ec) {
ErrorHandler<path> err("read_symlink", ec, &p);
- char buff[PATH_MAX + 1];
- error_code m_ec;
+ struct stat sb;
+ if (lstat(p.c_str(), &sb) == -1) {
+ return err.report(capture_errno());
+ }
+ size_t size = sb.st_size + 1;
+ char *buff = (char*) malloc(size);
+ if (buff == NULL) {
+ return err.report(capture_errno());
+ }
+
::ssize_t ret;
- if ((ret = ::readlink(p.c_str(), buff, PATH_MAX)) == -1) {
+ if ((ret = ::readlink(p.c_str(), buff, size)) == -1) {
+ free(buff);
return err.report(capture_errno());
}
- _LIBCPP_ASSERT(ret <= PATH_MAX, "TODO");
+ _LIBCPP_ASSERT(ret < size, "TODO");
_LIBCPP_ASSERT(ret > 0, "TODO");
buff[ret] = 0;
- return {buff};
+ path res = {buff};
+ free(buff);
+ return res;
}
bool __remove(const path& p, error_code* ec) {
Index: llvm-toolchain-snapshot_8~svn339515/utils/TableGen/CodeEmitterGen.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn339515.orig/utils/TableGen/CodeEmitterGen.cpp
+++ llvm-toolchain-snapshot_8~svn339515/utils/TableGen/CodeEmitterGen.cpp
@@ -239,6 +239,9 @@ void CodeEmitterGen::run(raw_ostream &o)
ArrayRef<const CodeGenInstruction*> NumberedInstructions =
Target.getInstructionsByEnumValue();
+ o << "// Undef for HURD\n";
+ o << "#ifdef EIEIO\n#undef EIEIO\n#endif\n";
+
// Emit function declaration
o << "uint64_t " << Target.getName();
o << "MCCodeEmitter::getBinaryCodeForInstr(const MCInst &MI,\n"
Index: llvm-toolchain-snapshot_8~svn349138/clang/lib/Basic/FileManager.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn349138.orig/clang/lib/Basic/FileManager.cpp
+++ llvm-toolchain-snapshot_8~svn349138/clang/lib/Basic/FileManager.cpp
@@ -528,6 +528,12 @@ void FileManager::invalidateCache(const
UniqueRealFiles.erase(Entry->getUniqueID());
}
+// For GNU Hurd
+#if defined(__GNU__) && !defined(PATH_MAX)
+# define PATH_MAX 4096
+#endif
+
+
void FileManager::GetUniqueIDMapping(
SmallVectorImpl<const FileEntry *> &UIDToFiles) const {
UIDToFiles.clear();
Index: llvm-toolchain-snapshot_8~svn349138/lldb/include/lldb/lldb-defines.h
===================================================================
--- llvm-toolchain-snapshot_8~svn349138.orig/lldb/include/lldb/lldb-defines.h
+++ llvm-toolchain-snapshot_8~svn349138/lldb/include/lldb/lldb-defines.h
@@ -28,6 +28,11 @@
#define INT32_MAX 2147483647
#endif
+// For GNU Hurd
+#if defined(__GNU__) && !defined(PATH_MAX)
+# define PATH_MAX 4096
+#endif
+
#if !defined(UINT32_MAX)
#define UINT32_MAX 4294967295U
#endif
Index: llvm-toolchain-snapshot_8~svn349138/tools/dsymutil/DwarfLinker.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn349138.orig/tools/dsymutil/DwarfLinker.cpp
+++ llvm-toolchain-snapshot_8~svn349138/tools/dsymutil/DwarfLinker.cpp
@@ -101,6 +101,11 @@
#include <utility>
#include <vector>
+// For GNU Hurd
+#if defined(__GNU__) && !defined(PATH_MAX)
+# define PATH_MAX 4096
+#endif
+
namespace llvm {
namespace dsymutil {
Index: llvm-toolchain-snapshot_8~svn349138/polly/lib/External/ppcg/cuda_common.c
===================================================================
--- llvm-toolchain-snapshot_8~svn349138.orig/polly/lib/External/ppcg/cuda_common.c
+++ llvm-toolchain-snapshot_8~svn349138/polly/lib/External/ppcg/cuda_common.c
@@ -15,6 +15,11 @@
#include "cuda_common.h"
#include "ppcg.h"
+// For GNU Hurd
+#if defined(__GNU__) && !defined(PATH_MAX)
+# define PATH_MAX 4096
+#endif
+
/* Open the host .cu file and the kernel .hu and .cu files for writing.
* Add the necessary includes.
*/
Index: llvm-toolchain-snapshot_8~svn349138/clang/lib/Frontend/ModuleDependencyCollector.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn349138.orig/clang/lib/Frontend/ModuleDependencyCollector.cpp
+++ llvm-toolchain-snapshot_8~svn349138/clang/lib/Frontend/ModuleDependencyCollector.cpp
@@ -99,6 +99,11 @@ struct ModuleDependencyMMCallbacks : pub
}
+// For GNU Hurd
+#if defined(__GNU__) && !defined(PATH_MAX)
+# define PATH_MAX 4096
+#endif
+
// TODO: move this to Support/Path.h and check for HAVE_REALPATH?
static bool real_path(StringRef SrcPath, SmallVectorImpl<char> &RealPath) {
#ifdef LLVM_ON_UNIX
Index: llvm-toolchain-snapshot_8~svn348749/lib/Support/Unix/Path.inc
===================================================================
--- llvm-toolchain-snapshot_8~svn348749.orig/lib/Support/Unix/Path.inc
+++ llvm-toolchain-snapshot_8~svn348749/lib/Support/Unix/Path.inc
@@ -177,7 +177,7 @@ std::string getMainExecutable(const char
if (getprogpath(exe_path, argv0) != NULL)
return exe_path;
-#elif defined(__linux__) || defined(__CYGWIN__)
+#elif defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__)
char exe_path[MAXPATHLEN];
StringRef aPath("/proc/self/exe");
if (sys::fs::exists(aPath)) {
Index: llvm-toolchain-snapshot_8~svn350611/libcxx/test/std/thread/thread.condition/thread.condition.condvar/wait_for.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn350611.orig/libcxx/test/std/thread/thread.condition/thread.condition.condvar/wait_for.pass.cpp
+++ llvm-toolchain-snapshot_8~svn350611/libcxx/test/std/thread/thread.condition/thread.condition.condvar/wait_for.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// XFAIL: *
// FLAKY_TEST
Index: llvm-toolchain-snapshot_8~svn350611/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn350611.orig/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
+++ llvm-toolchain-snapshot_8~svn350611/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
@@ -9,6 +9,7 @@
//
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: *
// <shared_mutex>
Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
@@ -14,7 +14,7 @@
//
// GCC currently fails because it needs -fabi-version=6 to fix mangling of
// std::atomic when used with __attribute__((vector(X))).
-// XFAIL: gcc
+// XFAIL: *
// <atomic>
Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/numerics/rand/rand.util/rand.util.canonical/generate_canonical.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/numerics/rand/rand.util/rand.util.canonical/generate_canonical.pass.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/numerics/rand/rand.util/rand.util.canonical/generate_canonical.pass.cpp
@@ -12,6 +12,8 @@
// template<class RealType, size_t bits, class URNG>
// RealType generate_canonical(URNG& g);
+// XFAIL: *
+
#include <random>
#include <cassert>
Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/re/re.traits/isctype.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/re/re.traits/isctype.pass.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/re/re.traits/isctype.pass.cpp
@@ -16,6 +16,7 @@
// TODO(EricWF): This test takes 40+ minutes to build with Clang 3.8 under ASAN or MSAN.
// UNSUPPORTED: asan, msan
+// XFAIL: *
#include <regex>
#include <cassert>
Index: llvm-toolchain-snapshot_7~svn337372/libcxxabi/test/catch_multi_level_pointer.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxxabi/test/catch_multi_level_pointer.pass.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxxabi/test/catch_multi_level_pointer.pass.cpp
@@ -9,6 +9,8 @@
// UNSUPPORTED: libcxxabi-no-exceptions
+// XFAIL: *
+
#include <cassert>
#include <cstdlib>
#include <iostream>
Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
@@ -16,6 +16,8 @@
// template <class T, class... Args> void construct(T* p, Args&&... args);
+// XFAIL: *
+
#include <scoped_allocator>
#include <cassert>
#include <string>
Clang 3.9 regression causes a bug when generating code for
std::atomic_compare_and_exchange*(std::atomic<long long>,...) without
optimizations. If same code is compiled with -O2 tests pass without problems.
Atomics are implement in headers with builtin functions which makes this
affect application code instead of libc++ library code.
libcxx tests default to -O0 compilation so these test need to be marked failing
on arm to allow installing packages. Use cases is so borderline failure that it
shouldn't prevent building the package. (64bit atomics in 32bit mode)
Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// XFAIL: arm
// ... assertion fails line 34
// <atomic>
Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// XFAIL: arm
// ... assertion fails line 38
// <atomic>
Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// XFAIL: arm
// ... assertion fails line 34
// <atomic>
Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// XFAIL: arm
// ... assertion fails line 38
// <atomic>
Lock is_always_lock free test fails on i386 because std::atomic is aligned
to 8 bytes while long long is aligned to 4 bytes. clang can't generate inline
code for unaligned 8 byte atomics even tough instruction set and gcc support
it.
That makes it expected thaqt ATOMIC_LLONG_LOCK_FREE and
std::atomic<long long>::is_always_lock_free don't match on i386. Correct test
for std::atomic<long long> is to check if target cpu support cmpxchg8 instruction.
To set instruction support one can check __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 define.
Bug: https://llvm.org/bugs/show_bug.cgi?id=19355
Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
===================================================================
--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
+++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
@@ -20,6 +20,14 @@
# error Feature test macro missing.
#endif
+#if defined(__i386__) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)
+/* Fix for clang setting __GCC_ATOMIC_LLONG_LOCK_FREE incorecctly for x86
+ * https://llvm.org/bugs/show_bug.cgi?id=19355
+ */
+#undef ATOMIC_LLONG_LOCK_FREE
+#define ATOMIC_LLONG_LOCK_FREE 2
+#endif
+
template <typename T> void checkAlwaysLockFree() {
if (std::atomic<T>::is_always_lock_free)
assert(std::atomic<T>().is_lock_free());
......@@ -61,27 +61,27 @@ scan-view-fix-path.diff
fix-scan-view-path.diff
# lldb
lldb-link-atomic-cmake.patch
lldb-addversion-suffix-to-llvm-server-exec.patch
lldb-missing-install.diff
lldb-disable-swig-error.diff
lldb/lldb-link-atomic-cmake.patch
lldb/lldb-addversion-suffix-to-llvm-server-exec.patch
lldb/lldb-missing-install.diff
lldb/lldb-disable-swig-error.diff
# Fix arch issue
disable-error-xray.diff
# OpenMP
openmp-check-execstack.diff
openmp-mips-affinity.patch
bootstrap-with-openmp-version-export-missing.diff
openmp/openmp-check-execstack.diff
openmp/openmp-mips-affinity.patch
openmp/bootstrap-with-openmp-version-export-missing.diff
# libcxx
libcxxabi-test-don-t-fail-extended-long-double.patch
libcxx-test-fix-lockfree-test-for-i386.patch
libcxxabi-arm-ehabi-fix.patch
libcxx-test-atomics-set-compare-exchange-to-be-expected-fails-on-arm.patch
libcxx-silent-test-libcxx.diff
libcxx-silent-failure-ppc64el.diff
libcxx-silent-failure-arm64.diff
libcxx/libcxxabi-test-don-t-fail-extended-long-double.patch
libcxx/libcxx-test-fix-lockfree-test-for-i386.patch
libcxx/libcxxabi-arm-ehabi-fix.patch
libcxx/libcxx-test-atomics-set-compare-exchange-to-be-expected-fails-on-arm.patch
libcxx/libcxx-silent-test-libcxx.diff
libcxx/libcxx-silent-failure-ppc64el.diff
libcxx/libcxx-silent-failure-arm64.diff
# Change default optims
mips-fpxx-enable.diff
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment