The compiler installation Ubuntu16.04 recording gcc-5.4.0

 

The Vmware compile mounted on the Ubuntu gcc-5.5.4 compiler installation gcc-5.4.0,, make mistakes and resolve recorded as follows:

--Question 1

In file included from …/…/…/gcc-5.4.0/libgcc/unwind-dw2.c:401:0:
./md-unwind-support.h: 在函数‘x86_64_fallback_frame_state’中:
./md-unwind-support.h:61:47: 错误: dereferencing pointer to incomplete type ‘struct ucontext’
sc = (struct sigcontext *) (void *) &uc_->uc_mcontext;

md-unwind-support.h line 61 is, struct * uc_ the ucontext = Context-> CFA; modify struct ucontext_t * uc_ = context-> cfa ;

- Question 2

sanitizer_stoptheworld_linux_libcdep.cc:276:22: error: aggregate ‘sigaltstack 
handler_stack’ has incomplete type and cannot be defined

Referring Solutions Solutions The following + - No changes - to + content to content

The following hack works, but is of course no proper solution.

diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
index 806fcd5e2847..a9de6fc237f4 100644
--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
@@ -605,8 +605,8 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
 }
 #endif
 
-uptr internal_sigaltstack(const struct sigaltstack *ss,
-                         struct sigaltstack *oss) {
+uptr internal_sigaltstack(const stack_t *ss,
+                         stack_t *oss) {
   return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
 }
 
diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
index 895bfc18195c..32d6baa092bd 100644
--- a/libsanitizer/sanitizer_common/sanitizer_linux.h
+++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
@@ -17,6 +17,7 @@
 #include "sanitizer_internal_defs.h"
 #include "sanitizer_posix.h"
 #include "sanitizer_platform_limits_posix.h"
+#include "bits/types/stack_t.h"
 
 struct link_map;  // Opaque type returned by dlopen().
 struct sigaltstack;
@@ -28,8 +29,8 @@ struct linux_dirent;
 
 // Syscall wrappers.
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
-uptr internal_sigaltstack(const struct sigaltstack* ss,
-                          struct sigaltstack* oss);
+uptr internal_sigaltstack(const stack_t* ss,
+                          stack_t* oss);
 uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
     __sanitizer_sigset_t *oldset);
 
diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
index 891386dc0ba7..234e8c652c67 100644
--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
@@ -273,7 +273,7 @@ static int TracerThread(void* argument) {
 
   // Alternate stack for signal handling.
   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
-  struct sigaltstack handler_stack;
+  stack_t handler_stack;
   internal_memset(&handler_stack, 0, sizeof(handler_stack));
   handler_stack.ss_sp = handler_stack_memory.data();
   handler_stack.ss_size = kHandlerStackSize;
diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
index 2ed5718a12e3..0045051f1d20 100644
--- a/libsanitizer/tsan/tsan_platform_linux.cc
+++ b/libsanitizer/tsan/tsan_platform_linux.cc
@@ -50,7 +50,7 @@
 #include <dlfcn.h>
 #if SANITIZER_LINUX
 #define __need_res_state
-#include <resolv.h>
+#include "bits/types/res_state.h"
 #endif
 
 #ifdef sa_handler

 

- Question 3

/usr/local/gcc-5.4.0/libsanitizer/asan/asan_linux.cc: In function ‘bool __asan::AsanInterceptsSignal(int)’:
/usr/local/gcc-5.4.0/libsanitizer/asan/asan_linux.cc:222:20: error: ‘SIGSEGV’ was not declared in this scope
   return signum == SIGSEGV && common_flags()->handle_segv;

Solutions reference solution

diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc
index c504168..59087b9 100644
--- a/libsanitizer/asan/asan_linux.cc
+++ b/libsanitizer/asan/asan_linux.cc
@@ -29,6 +29,7 @@
 #include <dlfcn.h>
 #include <fcntl.h>
 #include <pthread.h>
+#include <signal.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <unwind.h>

 

 

Released nine original articles · won praise 4 · views 10000 +

Guess you like

Origin blog.csdn.net/juan190755422/article/details/103709300