Skip to content

Commit 8ca26cc

Browse files
committed
Building libunwind with new CMakeLists.
The old CMakeLists file of libunwind used the C compiler to compile assembly files. This caused such code not to be hardened.
1 parent 72a8e6b commit 8ca26cc

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-module-level-assembly.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,3 @@ global_asm!(".start_module_asm:
1010
movq (%rdi), %rax
1111
retq
1212
.end_module_asm:" );
13-
14-
// CHECK: .start_module_asm
15-
// TODO add check, when module-level pass is corrected
16-
// CHECK: .end_module_asm

src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh

+2-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,8 @@ function check {
3131

3232
build
3333

34-
#TODO: re-enable check when newly compiled libunwind is used
35-
#check unw_getcontext unw_getcontext.checks
36-
37-
#TODO: re-enable check when newly compiled libunwind is used
38-
#check "libunwind::Registers_x86_64::jumpto()" jumpto.checks
39-
34+
check unw_getcontext unw_getcontext.checks
35+
check "libunwind::Registers_x86_64::jumpto()" jumpto.checks
4036
check "std::io::stdio::_print::h87f0c238421c45bc" print.checks
4137
check rust_plus_one_global_asm rust_plus_one_global_asm.checks || echo "warning: module level assembly currently not hardened"
4238

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CHECK: unw_getcontext
22
CHECK: lfence
33
CHECK: lfence
4-
CHECK: notq (%rsp)
5-
CHECK-NEXT: notq (%rsp)
4+
CHECK: shlq $0, (%rsp)
65
CHECK-NEXT: lfence
76
CHECK-NEXT: retq

0 commit comments

Comments
 (0)