Skip to content

Assembly without preprocessing doesn't ignore depfile #2664

@AJIOB

Description

@AJIOB

Example:

alex@pc:~/prj/sccache$ gcc -c test.S -o test.o -MD -MF test.d
alex@pc:~/prj/sccache$ clang-20 -c test.S -o test.o -MD -MF test.d
alex@pc:~/prj/sccache$ clang-20 -c test.s -o test.o -MD -MF test.d
clang-20: warning: argument unused during compilation: '-MD' [-Wunused-command-line-argument]
clang-20: warning: argument unused during compilation: '-MF test.d' [-Wunused-command-line-argument]
alex@pc:~/prj/sccache$ gcc -c test.s -o test.o -MD -MF test.d

In the first 2 calls (gcc & clang-20) file test.d is generated, while in the second one it isn't.

The sccache fails in the last 2 cases, because it cannot find the test.d to store:

sccache: encountered fatal error
sccache: error: failed to zip up compiler outputs
sccache: caused by: failed to zip up compiler outputs
sccache: caused by: failed to open file `"/home/alex/prj/sccache/test.d"`
sccache: caused by: failed to open file `/home/alex/prj/sccache/test.d`: No such file or directory (os error 2)

I'm using the clang 20.1.8 & gcc 13.3.0 on Ubuntu 24.04

P.S. I cannot just drop the -MF flag: in real world it's generated by CMake and cannot be disabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions