With IO sandboxing enabled, Clang requires all FS accesses happen through the one "true" VFS instance. That instance is currently not being propagated into the assembly parser, and doing so would be super involved. This triggers sandbox violations whenever an `.incbin` directive is encountered, since the parser needs the VFS to open the file. However, it seems that `asm()` directives are only parsed to get the symbols of an LLVM module, which cannot be affected by `.incbin` directives. This PR adds an option to the asm parser to avoid resolving `.incbin` directives when collecting module symbols, avoiding the sandbox violation.
9 lines
226 B
C
9 lines
226 B
C
// RUN: split-file %s %t
|
|
//--- foo.h
|
|
//--- tu.c
|
|
asm(".incbin \"foo.h\"");
|
|
// RUN: cd %t
|
|
// RUN: %clang -c -emit-llvm %t/tu.c -o %t/tu.ll
|
|
// RUN: llvm-dis %t/tu.ll -o - | FileCheck %s
|
|
// CHECK: module asm ".incbin \22foo.h\22"
|