9 cp -a $TEST_DIR/enclave .
12 # HACK(eddyb) sets `RUSTC_BOOTSTRAP=1` so Cargo can accept nightly features.
13 # These come from the top-level Rust workspace, that this crate is not a
14 # member of, but Cargo tries to load the workspace `Cargo.toml` anyway.
16 cargo
-v run
--target $TARGET
23 local checks
="${TEST_DIR}/$2"
25 local objdump
="${BUILD_DIR}/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-objdump"
26 local filecheck
="${BUILD_DIR}/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck"
28 ${objdump} --disassemble-symbols=${func} --demangle \
29 ${WORK_DIR}/enclave
/target
/x86_64-fortanix-unknown-sgx
/debug
/enclave
> ${asm}
30 ${filecheck} --input-file ${asm} ${checks}
35 check unw_getcontext unw_getcontext.checks
36 check
"libunwind::Registers_x86_64::jumpto()" jumpto.checks
37 check
"std::io::stdio::_print::h87f0c238421c45bc" print.checks
38 check rust_plus_one_global_asm rust_plus_one_global_asm.checks \
39 ||
echo "warning: module level assembly currently not hardened"
41 check cc_plus_one_c cc_plus_one_c.checks
42 check cc_plus_one_c_asm cc_plus_one_c_asm.checks
43 check cc_plus_one_cxx cc_plus_one_cxx.checks
44 check cc_plus_one_cxx_asm cc_plus_one_cxx_asm.checks
45 check cc_plus_one_asm cc_plus_one_asm.checks \
46 ||
echo "warning: the cc crate forwards assembly files to the CC compiler." \
47 "Clang uses its own intergrated assembler, which does not include the LVI passes."
49 check cmake_plus_one_c cmake_plus_one_c.checks
50 check cmake_plus_one_c_asm cmake_plus_one_c_asm.checks
51 check cmake_plus_one_c_global_asm cmake_plus_one_c_global_asm.checks \
52 ||
echo "warning: module level assembly currently not hardened"
53 check cmake_plus_one_cxx cmake_plus_one_cxx.checks
54 check cmake_plus_one_cxx_asm cmake_plus_one_cxx_asm.checks
55 check cmake_plus_one_cxx_global_asm cmake_plus_one_cxx_global_asm.checks \
56 ||
echo "warning: module level assembly currently not hardened"
57 check cmake_plus_one_asm cmake_plus_one_asm.checks