On 15 April 2013 14:10, Nathan Froyd <[email protected]> wrote:
> Hi!
>
> This patch addresses PR 15171 by checking if we're constructing a
> too-long argument list for the linker and writing it to a response file
> if the linker supports it.
* Please start function names with a lowercase letter.
* The llvm::sys::Path object is only used to delete the file, so you
can just say:
llvm::sys::Path(TmpPath).eraseFromDisk();
* You don't need to pass the '.' to D.GetTemporaryPath. It was
creating a file ending with "..tmp".
* Don't use braces for single line blocks.
MakeArgString Can take a Twine, so you don't need the FileArg temporary.
> A test case is included that should test the
> newly-added behavior on at least some Windows checkouts (depending on
> where the checkout lives on disk). It doesn't appear that there's any
> tests that clang parses a response file, so this test takes care of that
> too.
For the testcase I had something like the attached file in mind. By
using the preprocessor we can create a large response file. Testing
this on OS X showed that clang does try to use a response file, but
the OS X linker doesn't support it. You should probably pass false to
SupportsResponseFiles when calling from OS X and xfail the test for OS
X.
> Tested on linux x86-64.
Since this is very host dependent, you should probably also test on
windows and OS X at least.
> -Nathan
>
Cheers,
Rafael
// RUN: %clang -E -P -DGEN_INPUT %s > %t
// RUN: %clang @%t %s -o %t3 && false
#if defined(GEN_INPUT)
#define M -Lfoobar
#define M2 M M
#define M4 M2 M2
#define M8 M4 M4
#define M16 M8 M8
#define M32 M16 M16
#define M64 M32 M32
#define M128 M64 M64
#define M256 M128 M128
#define M512 M256 M256
#define M1024 M512 M512
#define M2048 M1024 M1024
#define M4096 M2048 M2048
#define M8192 M4096 M4096
#define M16384 M8192 M8192
M16384
#else
int main()
{
return 0;
}
#endif
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits