]> git.lizzy.rs Git - rust.git/commitdiff
Building libunwind with new CMakeLists.
authorRaoul Strackx <raoul.strackx@fortanix.com>
Fri, 27 Mar 2020 15:46:52 +0000 (16:46 +0100)
committerRaoul Strackx <raoul.strackx@fortanix.com>
Fri, 25 Sep 2020 13:09:57 +0000 (15:09 +0200)
The old CMakeLists file of libunwind used the C compiler to compile assembly files. This caused such code not to be hardened.

src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-module-level-assembly.rs
src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks

index 6b7e7b7767c601f480c3bad8cac350252e72fb8c..b8dc747d3b4cba7aaf5cbef19c7d05957c317483 100644 (file)
@@ -10,7 +10,3 @@
             movq (%rdi), %rax
             retq
             .end_module_asm:" );
-
-// CHECK: .start_module_asm
-// TODO add check, when module-level pass is corrected
-// CHECK: .end_module_asm
index 9f151b34c91784f9453db692468509b2a75c0f85..ee6dc33feae6f125fcef49ee3c87eaa4c0e4430c 100644 (file)
@@ -31,12 +31,8 @@ function check {
 
 build
 
-#TODO: re-enable check when newly compiled libunwind is used
-#check unw_getcontext unw_getcontext.checks
-
-#TODO: re-enable check when newly compiled libunwind is used
-#check "libunwind::Registers_x86_64::jumpto()" jumpto.checks
-
+check unw_getcontext unw_getcontext.checks
+check "libunwind::Registers_x86_64::jumpto()" jumpto.checks
 check "std::io::stdio::_print::h87f0c238421c45bc" print.checks
 check rust_plus_one_global_asm rust_plus_one_global_asm.checks || echo "warning: module level assembly currently not hardened"
 
index 50b828662e350a8174eb8da92d41a51ebabf193f..4b7615b115dc4fe5f062bb37d82899811edd84aa 100644 (file)
@@ -1,7 +1,6 @@
 CHECK: unw_getcontext
 CHECK:      lfence
 CHECK:      lfence
-CHECK:      notq (%rsp)
-CHECK-NEXT: notq (%rsp)
+CHECK:      shlq    $0, (%rsp)
 CHECK-NEXT: lfence
 CHECK-NEXT: retq