Skip to content

[clang] embeds use absolute paths for dependency output #161950

@olemayu

Description

@olemayu

Clang generates absolute paths for embeds, whereas includes use paths relative to the current working directory.

/* source/main.c */
#include <stdio.h>
#include "include.h"

int main() {
    static const char embed[] = {
        #embed "include.h"
    };
    
    printf("%s\n", embed);
    
    return 0;
}

Built with:

clang-22 -MMD source/main.c -std=c23

Dependency output:

main.o: source/main.c source/include.h \
  /home/user/project/source/include.h

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions