Skip to content

Commit e0f181f

Browse files
authored
README: describe using QEMU_CPU variable and running llvm-test-suite (#9)
1 parent 4ce375b commit e0f181f

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,41 @@ Hello world!
102102
Please note that is Musl, the `libc.so` shared object is both the C library to
103103
link your executables to as well as the dynamic loader.
104104

105+
As explained in the output of `qemu-aarch64 --help`, one may define `QEMU_CPU`
106+
environment variable to adjust emulated CPU features. For example,
107+
108+
```
109+
QEMU_CPU="neoverse-v1,pauth-impdef=on" ./hello-world
110+
```
111+
112+
would emulate a CPU core not implementing FEAT_FPAC. Furthermore,
113+
`pauth-impdef=on` makes QEMU use an implementation-defined hashing algorithm,
114+
which is not cryptographically-secure but is much faster to emulate
115+
(`pauth-impdef=on` was [made the default](https://gitlab.com/qemu-project/qemu/-/commit/132f8ec799cea261ad6b60ac8ae86f17cc98b9a1)
116+
recently).
117+
118+
# Running llvm-test-suite
119+
120+
One can use example `llvm-test-suite.cmake.example` CMake cache file the same
121+
way as other cache files from llvm-test-suite (located under `/cmake/caches`).
122+
123+
Furthermore, `lit.cfg` file in the root of llvm-test-suite repository has to be
124+
patched like this:
125+
126+
```
127+
--- a/lit.cfg
128+
+++ b/lit.cfg
129+
@@ -25,6 +25,8 @@ config.traditional_output = False
130+
config.single_source = False
131+
if "SSH_AUTH_SOCK" in os.environ:
132+
config.environment["SSH_AUTH_SOCK"] = os.environ["SSH_AUTH_SOCK"]
133+
+config.environment["QEMU_LD_PREFIX"] = "/opt/llvm-pauth/aarch64-linux-pauthtest/usr"
134+
+config.environment["QEMU_CPU"] = "neoverse-v1,pauth-impdef=on"
135+
if not hasattr(config, "remote_host"):
136+
config.remote_host = ""
137+
config.remote_host = lit_config.params.get("remote_host", config.remote_host)
138+
```
139+
105140
# Cross-debugging with qemu-user and GDB
106141

107142
To debug a program for a different CPU architecture, a special GDB build may be

0 commit comments

Comments
 (0)