An Example Using the LLVM Tool Chain
clang hello.c -o hello
clang -O3 -emit-llvm hello.c -c -o hello.bc
clang -S -emit-llvm hello.c -o hello.ll
lli hello.bc # invoke LLVM JIT
llvm-dis < hello.bc | less # .bc to .ll
llvm-as hello.ll -o hello.bc # .ll to bc
llc hello.bc -o hello.s
llc hello.ll -o hello.s
llvm-lit: LLVM integrated tester.
References: LLVM doc: Writing new regression tests Lit documentation More Cheri References: reference # llvm/utils/lit/lit/llvm/config.py tool_substitutions = [ # CHERI substitutions (order is important due to repeated substitutions!) ToolSubst('%cheri_purecap_cc1', command='%cheri_cc1', extra_args=['-target-abi', 'purecap']+additional_flags), ToolSubst('%cheri128_purecap_cc1', command='%cheri128_cc1', extra_args=['-target-abi', 'purecap']+additional_flags), ToolSubst('%cheri256_purecap_cc1', command='%cheri256_cc1', extra_args=['-target-abi', 'purecap']+additional_flags), ToolSubst('%cheri_cc1', command=self.config.clang, extra_args=cheri_cc1_args+additional_flags), ToolSubst('%cheri128_cc1', command=self.config.clang, extra_args=cheri128_cc1_args+additional_flags), ToolSubst('%cheri256_cc1', command=self.config.clang, extra_args=cheri256_cc1_args+additional_flags), ToolSubst('%cheri_clang', command=self.config.clang, extra_args=cheri_clang_args+additional_flags), ToolSubst('%cheri_purecap_clang', command=self.config.clang, extra_args=cheri_clang_args + ['-mabi=purecap']+additional_flags), ToolSubst('%riscv32_cheri_purecap_cc1', command='%riscv32_cheri_cc1', extra_args=['-target-abi', 'il32pc64', '-target-feature', '+cap-mode']+additional_flags), ToolSubst('%riscv64_cheri_purecap_cc1', command='%riscv64_cheri_cc1', extra_args=['-target-abi', 'l64pc128', '-target-feature', '+cap-mode']+additional_flags), ToolSubst('%riscv32_cheri_purecap_clang', command='%riscv32_cheri_clang', extra_args=['-mabi=il32pc64']+additional_flags), ToolSubst('%riscv64_cheri_purecap_clang', command='%riscv64_cheri_clang', extra_args=['-mabi=l64pc128']+additional_flags), ToolSubst('%riscv32_cheri_cc1', command=self.
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?