[PATCH] D75605: [lld] Avoid creating files outside of work directory.

Stephan Herhut via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 06:11:30 PST 2020


herhut created this revision.
Herald added subscribers: llvm-commits, dexonsmith, steven_wu, MaskRay, hiraditya, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

looks good


A test is passing `-o -` to lld in the hope of writing the output to
standard out but that is not the case. Instead it creates a file named
`-.lto.o`. This fixes it by creating a temporary file in the work
directory.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75605

Files:
  lld/test/ELF/lto/thinlto.ll


Index: lld/test/ELF/lto/thinlto.ll
===================================================================
--- lld/test/ELF/lto/thinlto.ll
+++ lld/test/ELF/lto/thinlto.ll
@@ -26,7 +26,7 @@
 ; RUN: mkdir -p %t.dir
 ; RUN: cp %t2.o %t.dir/t.o
 ; RUN: llvm-ar rcsT %t.dir/t.a %t.dir/t.o
-; RUN: ld.lld -save-temps %t1.o %t.dir/t.a -o - > /dev/null
+; RUN: ld.lld -save-temps %t1.o %t.dir/t.a -o %t.null
 ; RUN: ls '%t.dir/t.a(t.o at 0).0.preopt.bc'
 
 ; NM1: T f


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75605.248157.patch
Type: text/x-patch
Size: 456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200304/960554b0/attachment-0001.bin>


More information about the llvm-commits mailing list