ASM .include search paths

When writing assembly code (for AArch64; pulled into an .rs file using global_asm), it is possible to use the .include "some_file" compiler directive.

However, I could only make it work when some_file was an absolute path.
I wonder if I can add/modify the search paths for the .include directive?

You shouldn't do that. There is absolutely no guarantee relative to which path it will evaluate. Ir may be relative to the directory in which rustc was invoked or it may be relative to a temporary directory to which the assembly could be written before passing it to an assembler. Rustc doesn't have any way to specify the search path. As alternative you can use the concat!() and include_str!() rust macros to build a string you can pass to the asm!() macro.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.