The attached paches fixes the build by 

- use system definition for ucontext_t
- compile the affected file with clang++

The latter is not the correct fix, but an upstream commit[1]
suggests these types are deprecated. The correct fix is then
to replace the usage with std::vector etc.

https://android.googlesource.com/platform/system/core/+/b8f152d3e2b9368717743ebcb1277239a6c00659%5E%21/
diff -Nru android-platform-system-core-7.0.0+r33/debian/changelog android-platform-system-core-7.0.0+r33/debian/changelog
--- android-platform-system-core-7.0.0+r33/debian/changelog	2017-07-05 16:55:06.000000000 +0300
+++ android-platform-system-core-7.0.0+r33/debian/changelog	2018-01-12 10:41:37.000000000 +0200
@@ -1,3 +1,10 @@
+android-platform-system-core (1:7.0.0+r33-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix build
+
+ -- Riku Voipio <riku.voi...@linaro.org>  Fri, 12 Jan 2018 10:41:37 +0200
+
 android-platform-system-core (1:7.0.0+r33-2) unstable; urgency=medium
 
   * fix CVE-2017-0647 (Closes: #867229)
diff -Nru android-platform-system-core-7.0.0+r33/debian/control android-platform-system-core-7.0.0+r33/debian/control
--- android-platform-system-core-7.0.0+r33/debian/control	2017-04-25 22:46:58.000000000 +0300
+++ android-platform-system-core-7.0.0+r33/debian/control	2018-01-12 10:33:04.000000000 +0200
@@ -7,6 +7,7 @@
            Chirayu Desai <chirayudes...@gmail.com>
 Build-Depends: android-libunwind-dev (>= 7.0.0+r1~) [amd64 i386 armel armhf arm64 mips mipsel mips64el],
                bash-completion,
+               clang,
                debhelper (>= 10),
                dh-exec,
                dpkg-dev (>= 1.17.14),
@@ -251,7 +252,7 @@
  fastboot mode, etc..
 
 Package: simg2img
-Architecture: amd64 i386
+Architecture: amd64 i386 armel armhf arm64 mips mipsel mips64el
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Breaks: android-tools-fsutils (<< 6.0~)
 Replaces: android-tools-fsutils (<< 6.0~)
@@ -260,7 +261,7 @@
  be manipulated with the standard tools.
 
 Package: img2simg
-Architecture: amd64 i386
+Architecture: amd64 i386 armel armhf arm64 mips mipsel mips64el
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Breaks: android-tools-fsutils (<< 6.0~)
 Replaces: android-tools-fsutils (<< 6.0~)
@@ -268,7 +269,7 @@
  A command line tool to create sparse images for usage with Android devices.
 
 Package: append2simg
-Architecture: amd64 i386
+Architecture: amd64 i386 armel armhf arm64 mips mipsel mips64el
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: Android sparse image tool
  A command line tool to append data to the end of a sparse image.
diff -Nru android-platform-system-core-7.0.0+r33/debian/libutils.mk android-platform-system-core-7.0.0+r33/debian/libutils.mk
--- android-platform-system-core-7.0.0+r33/debian/libutils.mk	2016-12-06 15:08:28.000000000 +0200
+++ android-platform-system-core-7.0.0+r33/debian/libutils.mk	2018-01-12 10:33:45.000000000 +0200
@@ -31,8 +31,8 @@
            -lpthread -L. -llog -lcutils -lbacktrace
 
 build: $(SOURCES)
-	$(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
+	clang++ $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
 	ln -s $(NAME).so.0 $(NAME).so
 
 clean:
-	$(RM) $(NAME).so*
\ No newline at end of file
+	$(RM) $(NAME).so*
diff -Nru android-platform-system-core-7.0.0+r33/debian/patches/fix-backtrace.patch android-platform-system-core-7.0.0+r33/debian/patches/fix-backtrace.patch
--- android-platform-system-core-7.0.0+r33/debian/patches/fix-backtrace.patch	1970-01-01 02:00:00.000000000 +0200
+++ android-platform-system-core-7.0.0+r33/debian/patches/fix-backtrace.patch	2018-01-12 10:41:37.000000000 +0200
@@ -0,0 +1,22 @@
+Index: android-platform-system-core-7.0.0+r33/include/backtrace/Backtrace.h
+===================================================================
+--- android-platform-system-core-7.0.0+r33.orig/include/backtrace/Backtrace.h
++++ android-platform-system-core-7.0.0+r33/include/backtrace/Backtrace.h
+@@ -23,6 +23,7 @@
+ #include <string>
+ #include <vector>
+ 
++#include <sys/ucontext.h>
+ #include <backtrace/backtrace_constants.h>
+ #include <backtrace/BacktraceMap.h>
+ 
+@@ -65,9 +66,6 @@ struct backtrace_frame_data_t {
+ #if defined(__APPLE__)
+ struct __darwin_ucontext;
+ typedef __darwin_ucontext ucontext_t;
+-#else
+-struct ucontext;
+-typedef ucontext ucontext_t;
+ #endif
+ 
+ struct backtrace_stackinfo_t {
diff -Nru android-platform-system-core-7.0.0+r33/debian/patches/series android-platform-system-core-7.0.0+r33/debian/patches/series
--- android-platform-system-core-7.0.0+r33/debian/patches/series	2017-07-05 16:53:22.000000000 +0300
+++ android-platform-system-core-7.0.0+r33/debian/patches/series	2018-01-12 10:36:45.000000000 +0200
@@ -7,3 +7,4 @@
 adb_libssl_bc.diff
 move-log-file-to-proper-dir.patch
 fix-CVE-2017-0647.patch
+fix-backtrace.patch

Reply via email to