Skip to content

clang makes a lot of system calls for output files #9746

@sunfishcode

Description

@sunfishcode
Bugzilla Link 9374
Resolution FIXED
Resolved on Jul 27, 2011 19:48
Version unspecified
OS All
CC @akyrtzi,@efriedma-quic,@tkremenek

Extended Description

Running clang -c testcase.c gets the following in a system call trace (which I've manually filtered):

[pid 17523] stat("testcase.o", {st_mode=S_IFREG|0600, st_size=1120, ...}) = 0
[pid 17523] stat("testcase.o", {st_mode=S_IFREG|0600, st_size=1120, ...}) = 0
[pid 17523] access("testcase.o", W_OK) = 0
[pid 17523] stat("testcase.o", {st_mode=S_IFREG|0600, st_size=1120, ...}) = 0
[pid 17523] open("testcase.o-rM0aoW", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
[pid 17523] close(3) = 0
[pid 17523] open("testcase.o-rM0aoW", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
[pid 17523] close(3) = 0
[pid 17523] open("testcase.o-rM0aoW", O_WRONLY|O_CREAT|O_TRUNC, 0664) = 3
[pid 17523] fstat(3, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
[pid 17523] close(3) = 0
[pid 17523] rename("testcase.o-rM0aoW", "testcase.o") = 0

This is pretty excessive. A fair amount of it appears to have come from r114187, which was apparently intended for AST/PCH files, but was implemented to apply to all output files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclangClang issues not falling into any other categoryslow-compile

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions