Skip to content

Commit 716fb9c

Browse files
authored
Merge pull request #1422 from LarsGullik/lto-dep-file
Remove temporary lto files from dependency-file
2 parents 5023160 + fb7a650 commit 716fb9c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/lto-unix.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ static PluginStatus add_input_file(const char *path) {
177177
static i64 file_priority = 100;
178178

179179
MappedFile *mf = must_open_file(ctx, path);
180+
mf->is_dependency = false;
180181

181182
ObjectFile<E> *file = new ObjectFile<E>(ctx, mf, "");
182183
ctx.obj_pool.emplace_back(file);

test/dependency-file-lto.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
. $(dirname $0)/common.inc
3+
4+
cat <<EOF | $CC -flto -o $t/a.o -c -xc -
5+
#include <stdio.h>
6+
int main() {
7+
printf("Hello world\n");
8+
}
9+
EOF
10+
11+
$CC -B. -flto -o $t/exe $t/a.o -Wl,-dependency-file=$t/dep
12+
13+
grep '/exe:.*/a.o ' $t/dep
14+
grep '/a.o:$' $t/dep
15+
not grep '^/tmp' $t/dep
16+

0 commit comments

Comments
 (0)