Skip to content

"--sysroot /" mess up overlaid VFS #28283

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 27909
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @benlangmuir,@bcardosolopes,@zygoloid

Extended Description

Virtual file system cannot find overlaid file if "--sysroot /" is specified.

Way to reproduce:
$ cat overlay.yml
{
"version": 0,
"use-external-names": false,
"roots": [
{
"type": "file",
"name": "/usr/include/stdio_vfs.h",
"external-contents": "/usr/include/stdio.h"
}
]
}
$ cat foo.c
#include <stdio_vfs.h>
int main() {
printf("foo");
}
$ clang -ivfsoverlay overlay.yml foo.c # NO PROBLEM
$ clang --sysroot / -ivfsoverlay overlay.yml foo.c
foo.c:1:10: fatal error: 'stdio_vfs.h' file not found
#include <stdio_vfs.h>
^
1 error generated.
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions