[Cmake-commits] CMake branch, next, updated. v3.8.0-rc3-588-gc7df2fb
Kitware Robot
kwrobot at kitware.com
Mon Mar 27 15:05:02 EDT 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via c7df2fb6528c884ec69bedce2a4595997adc72ac (commit)
via 92fe00d33cb029a583de20a16e5bc17bd337ed57 (commit)
from b645aace61d04f73a26faa5496b3ae49f215e1b4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7df2fb6528c884ec69bedce2a4595997adc72ac
commit c7df2fb6528c884ec69bedce2a4595997adc72ac
Merge: b645aac 92fe00d
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 27 18:55:12 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Mar 27 14:56:40 2017 -0400
Stage topic 'ninja-fix-sysconf-non-limit'
Topic-id: 23303
Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/633
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92fe00d33cb029a583de20a16e5bc17bd337ed57
commit 92fe00d33cb029a583de20a16e5bc17bd337ed57
Author: Christian Pfeiffer <cpfeiffer at live.de>
AuthorDate: Mon Mar 27 19:04:50 2017 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 27 13:42:19 2017 -0400
Ninja: Fix command line limit when sysconf has no ARG_MAX
The `sysconf(3)` manual explains that the return value can be `-1` for
limits if there is no definite limit. Recognize this case and skip
using the value as a limit candidate. Otherwise we use response files
unconditionally on such systems instead of checking other limits.
Fixes: #16740
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 4fc664d..b1374c2 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -550,10 +550,6 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
#ifdef _WIN32
8000,
#endif
-#if defined(_SC_ARG_MAX)
- // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
- ((int)sysconf(_SC_ARG_MAX)) - 1000,
-#endif
#if defined(__linux)
// #define MAX_ARG_STRLEN (PAGE_SIZE * 32) in Linux's binfmts.h
((int)sysconf(_SC_PAGESIZE) * 32) - 1000,
@@ -562,7 +558,15 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
};
size_t const arrSz = cmArraySize(limits);
- int const sz = *std::min_element(limits, limits + arrSz);
+ int sz = *std::min_element(limits, limits + arrSz);
+#if defined(_SC_ARG_MAX)
+ // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
+ int const szArgMax = static_cast<int>(sysconf(_SC_ARG_MAX));
+ // a return value of -1 signifies an unrestricted value
+ if (szArgMax != -1) {
+ sz = std::min(sz, szArgMax - 1000);
+ }
+#endif
if (sz == std::numeric_limits<int>::max()) {
return 0;
}
-----------------------------------------------------------------------
Summary of changes:
Source/cmNinjaNormalTargetGenerator.cxx | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list