* New snapshot release

* Fix a typo in the arch declaration
* Remove patch D54677-hurd-path_max.diff (applied upstream)
This commit is contained in:
Sylvestre Ledru 2019-01-17 09:13:38 +01:00
parent 82a5ab04ef
commit 9ffa9d9830
3 changed files with 8 additions and 65 deletions

8
debian/changelog vendored
View File

@ -1,3 +1,11 @@
llvm-toolchain-snapshot (1:9~svn351416-1~exp1) experimental; urgency=medium
* New snapshot release
* Fix a typo in the arch declaration
* Remove patch D54677-hurd-path_max.diff (applied upstream)
-- Sylvestre Ledru <sylvestre@debian.org> Thu, 17 Jan 2019 09:04:49 +0100
llvm-toolchain-snapshot (1:9~svn351375-1~exp1) experimental; urgency=medium
* New snapshot release and move to 9 as upstream branched

View File

@ -1,64 +0,0 @@
[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) {

View File

@ -105,7 +105,6 @@ reproducible-pch.diff
hurd-pathmax.diff
hurd-EIEIO-undef.diff
impl-path-hurd.diff
D54677-hurd-path_max.diff
# powerpcspe
D49754-powerpcspe-clang.diff