Closed
Description
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.
$