1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/include/llvm
Oleg Ranevskyy 2d3f6608fd [Clang/Support/Windows/Unix] Command lines created by clang may exceed the command length limit set by the OS
Summary:
Hi Rafael,

Would you be able to review this patch, please?

(Clang part of the patch is D15832).

When clang runs an external tool, e.g. a linker, it may create a command line that exceeds the length limit.

Clang uses the llvm::sys::argumentsFitWithinSystemLimits function to check if command line length fits the OS 

limitation. There are two problems in this function that may cause exceeding of the limit:

1. It ignores the length of the program path in its calculations. On the other hand, clang adds the program 

path to the command line when it runs the program.

2. It assumes no space character is inserted after the last argument, which is not true for Windows. The flattenArgs function adds the trailing space for *each* argument. The result of this is that the terminating NULL character is not counted and may be placed beyond the length limit if the command line is exactly 32768 characters long. The WinAPI's CreateProcess does not find the NULL character and fails.

Reviewers: rafael, ygao, probinson

Subscribers: asl, llvm-commits

Differential Revision: http://reviews.llvm.org/D15831

llvm-svn: 256866
2016-01-05 19:56:12 +00:00
..
ADT [ptr-traits] Refactor how PointerIntPair does its pointer manipulation 2015-12-30 03:56:19 +00:00
Analysis [MemoryBuiltins] Remove isOperatorNewLike by consolidating non-null inference handling 2016-01-04 22:49:23 +00:00
AsmParser AsmParser: Save and restore the parsing state for types using SlotMapping. 2015-08-21 21:32:39 +00:00
Bitcode Add InaccessibleMemOnly and inaccessibleMemOrArgMemOnly attributes 2015-12-16 16:16:19 +00:00
CodeGen Remove extra whitespace. NFC. 2016-01-05 09:40:03 +00:00
Config [autoconf] Fix MinGW build 2015-11-28 00:54:12 +00:00
DebugInfo Fix several accidental DOS line endings in source files 2016-01-03 17:22:03 +00:00
ExecutionEngine [SectionMemoryManager] Make better use of virtual memory 2015-12-16 11:13:23 +00:00
IR Add function for testing string attributes to InvokeInst and CallSite. NFC. 2016-01-05 19:08:33 +00:00
IRReader [ThinLTO] Metadata linking for imported functions 2015-12-17 17:14:09 +00:00
LibDriver LibDriver: Replace references to lld-link2 with lld-link. 2015-08-06 19:00:42 +00:00
LineEditor Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Linker [ThinLTO] Metadata linking for imported functions 2015-12-17 17:14:09 +00:00
LTO Rename variables to reflect linker split (NFC) 2015-12-18 19:28:59 +00:00
MC (NFC) Change SubtargetFeatures::ToggleFeature and 2016-01-05 10:25:56 +00:00
Object Use make_range to reduce mentions of iterator type. NFC 2015-12-06 05:08:07 +00:00
Option Convert Arg, ArgList, and Option to dump() to dbgs() rather than errs(). 2015-12-18 18:55:26 +00:00
Passes Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
ProfileData llvm/include/llvm/ProfileData/InstrProfData.inc: Add c++-mode in the header. 2016-01-04 00:47:33 +00:00
Support [Clang/Support/Windows/Unix] Command lines created by clang may exceed the command length limit set by the OS 2016-01-05 19:56:12 +00:00
TableGen [TableGen] Fix a typo in r256733. 2016-01-04 06:35:08 +00:00
Target [X86] Make hasFP constant time 2016-01-04 04:49:41 +00:00
Transforms Clarify that the bypassSlowDivision optimization operates on a single BB [v2] 2016-01-04 23:18:58 +00:00
CMakeLists.txt
InitializePasses.h [attrs] Extract the pure inference of function attributes into 2015-12-27 08:41:34 +00:00
LinkAllIR.h
LinkAllPasses.h [PGO] Resubmit "MST based PGO instrumentation infrastructure" (r254021) 2015-12-09 18:08:16 +00:00
module.modulemap llvm/module.modulemap: AVR.def should be textual header. 2015-10-24 00:25:18 +00:00
module.modulemap.build
Pass.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
PassAnalysisSupport.h [PassManager] Tuning Memory Usage of AnalysisUsage 2015-12-08 00:10:56 +00:00
PassInfo.h Reformat partially. 2015-10-05 04:46:30 +00:00
PassRegistry.h Reorganize the C API headers to improve build times. 2015-12-18 01:46:52 +00:00
PassSupport.h Support: Clean up TSan annotations. 2015-08-18 22:31:24 +00:00