Update to 31.0.0p1 (tnx yamah)

This commit is contained in:
survolog (Andrey Grigorev) 2021-11-01 13:17:27 +03:00
parent 64ffd6b153
commit cc98307341
13 changed files with 3134 additions and 3263 deletions

View file

@ -1,5 +1,2 @@
sources:
core-8.1.0_r51.tar.xz: e62c8b16bba3697d0a584d549bb569714da8f8d3
extras-8.1.0_r51.tar.xz: fe466502245f0a8f62045665901008c88ea2350c
boringssl-8.1.0_r51.tar.xz: 96dfdca499ea17092c3b6e37b2eccad7b7fc4860
mdnsresponder-8.1.0_r51.tar.xz: d35e468bf43a9ca91bf92d4b41218962334d620a
android-tools-31.0.0p1.tar.xz: 73a90d7abf19882ca86dfc8d1c3564caeea0f17c

View file

@ -1,36 +0,0 @@
diff --git a/core/base/errors_unix.cpp b/core/base/errors_unix.cpp
index 296995e..48269b6 100644
--- a/core/base/errors_unix.cpp
+++ b/core/base/errors_unix.cpp
@@ -17,6 +17,7 @@
#include "android-base/errors.h"
#include <errno.h>
+#include <string.h>
namespace android {
namespace base {
diff --git a/core/base/file.cpp b/core/base/file.cpp
index 81b04d7..2fd2b6e 100644
--- a/core/base/file.cpp
+++ b/core/base/file.cpp
@@ -22,6 +22,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <string.h>
#include <memory>
#include <mutex>
diff --git a/core/base/logging.cpp b/core/base/logging.cpp
index 6357b4b..3c7dbce 100644
--- a/core/base/logging.cpp
+++ b/core/base/logging.cpp
@@ -23,6 +23,7 @@
#include <fcntl.h>
#include <libgen.h>
#include <time.h>
+#include <string.h>
// For getprogname(3) or program_invocation_short_name.
#if defined(__ANDROID__) || defined(__APPLE__)

View file

@ -0,0 +1,27 @@
From 139adff9b27eaf0bdaac664ec4c9a7db2fe3f920 Mon Sep 17 00:00:00 2001
From: David Benjamin <davidben@google.com>
Date: Thu, 25 Mar 2021 01:41:51 -0400
Subject: [PATCH] Fix mismatch between header and implementation of
bn_sqr_comba8.
Bug: 402
Change-Id: I6de879f44f6e3eca26f2f49c500769d944fa9bc0
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/46404
Reviewed-by: Adam Langley <agl@google.com>
---
crypto/fipsmodule/bn/internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vendor/boringssl/crypto/fipsmodule/bn/internal.h b/vendor/boringssl/crypto/fipsmodule/bn/internal.h
index 623e0c6e7..3d368db06 100644
--- a/vendor/boringssl/crypto/fipsmodule/bn/internal.h
+++ b/vendor/boringssl/crypto/fipsmodule/bn/internal.h
@@ -297,7 +297,7 @@ void bn_mul_comba4(BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4]);
void bn_mul_comba8(BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8]);
// bn_sqr_comba8 sets |r| to |a|^2.
-void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[4]);
+void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[8]);
// bn_sqr_comba4 sets |r| to |a|^2.
void bn_sqr_comba4(BN_ULONG r[8], const BN_ULONG a[4]);

View file

@ -0,0 +1,127 @@
From a24ab549e6ae246b391155d7bed3790ac0e07de2 Mon Sep 17 00:00:00 2001
From: David Benjamin <davidben@google.com>
Date: Thu, 25 Mar 2021 15:26:25 -0400
Subject: [PATCH] Use an unsized helper for truncated SHA-512 variants.
Although it is strictly fine to call SHA512_Final in SHA384_Final
(array sizes in C parameters are purely decorational, according to the
language), GCC 11 reportedly checks now and gets upset about the size
mismatch. Use an unsized helper function so all our code matches the
specified bounds.
Unfortunately, the bounds in all the functions are a bit misleading
because SHA512_Final really outputs based on sha->md_len (which Init
function you called) rather than which Final function. I've fixed this
places within a library where we mismatched and added asserts to the
smaller functions. SHA512_Final is assert-less because I've seen lots of
code use SHA384_Init / SHA512_Update / SHA512_Final.
This doesn't fix the SHA256 variant since that is generated by a pile of
macros in a multiply-included file. This is probably a good opportunity
to make that code less macro-heavy.
Update-Note: There is a small chance the asserts will trip something,
but hopefully not since I've left SHA512_Final alone.
Bug: 402
Change-Id: I4c9d579a63ee0a0dea103c19ef219c13bb9aa62c
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/46405
Reviewed-by: Adam Langley <agl@google.com>
---
crypto/fipsmodule/digest/digests.c | 12 ++++++++++--
crypto/fipsmodule/sha/sha512.c | 24 ++++++++++++++++++------
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/vendor/boringssl/crypto/fipsmodule/digest/digests.c b/vendor/boringssl/crypto/fipsmodule/digest/digests.c
index 16daeba65..f006ebbc5 100644
--- a/vendor/boringssl/crypto/fipsmodule/digest/digests.c
+++ b/vendor/boringssl/crypto/fipsmodule/digest/digests.c
@@ -247,13 +247,21 @@ static void sha512_256_init(EVP_MD_CTX *ctx) {
CHECK(SHA512_256_Init(ctx->md_data));
}
+static void sha512_256_update(EVP_MD_CTX *ctx, const void *data, size_t count) {
+ CHECK(SHA512_256_Update(ctx->md_data, data, count));
+}
+
+static void sha512_256_final(EVP_MD_CTX *ctx, uint8_t *md) {
+ CHECK(SHA512_256_Final(md, ctx->md_data));
+}
+
DEFINE_METHOD_FUNCTION(EVP_MD, EVP_sha512_256) {
out->type = NID_sha512_256;
out->md_size = SHA512_256_DIGEST_LENGTH;
out->flags = 0;
out->init = sha512_256_init;
- out->update = sha512_update;
- out->final = sha512_final;
+ out->update = sha512_256_update;
+ out->final = sha512_256_final;
out->block_size = 128;
out->ctx_size = sizeof(SHA512_CTX);
}
diff --git a/vendor/boringssl/crypto/fipsmodule/sha/sha512.c b/vendor/boringssl/crypto/fipsmodule/sha/sha512.c
index fd025743d..ba86c1eda 100644
--- a/vendor/boringssl/crypto/fipsmodule/sha/sha512.c
+++ b/vendor/boringssl/crypto/fipsmodule/sha/sha512.c
@@ -70,6 +70,8 @@
// this writing, so there is no need for a common collector/padding
// implementation yet.
+static int sha512_final_impl(uint8_t *out, SHA512_CTX *sha);
+
int SHA384_Init(SHA512_CTX *sha) {
sha->h[0] = UINT64_C(0xcbbb9d5dc1059ed8);
sha->h[1] = UINT64_C(0x629a292a367cd507);
@@ -146,8 +148,8 @@ uint8_t *SHA512_256(const uint8_t *data, size_t len,
uint8_t out[SHA512_256_DIGEST_LENGTH]) {
SHA512_CTX ctx;
SHA512_256_Init(&ctx);
- SHA512_Update(&ctx, data, len);
- SHA512_Final(out, &ctx);
+ SHA512_256_Update(&ctx, data, len);
+ SHA512_256_Final(out, &ctx);
OPENSSL_cleanse(&ctx, sizeof(ctx));
return out;
}
@@ -161,7 +163,8 @@ static void sha512_block_data_order(uint64_t *state, const uint8_t *in,
int SHA384_Final(uint8_t out[SHA384_DIGEST_LENGTH], SHA512_CTX *sha) {
// |SHA384_Init| sets |sha->md_len| to |SHA384_DIGEST_LENGTH|, so this has a
// |smaller output.
- return SHA512_Final(out, sha);
+ assert(sha->md_len == SHA384_DIGEST_LENGTH);
+ return sha512_final_impl(out, sha);
}
int SHA384_Update(SHA512_CTX *sha, const void *data, size_t len) {
@@ -172,11 +175,11 @@ int SHA512_256_Update(SHA512_CTX *sha, const void *data, size_t len) {
return SHA512_Update(sha, data, len);
}
-int SHA512_256_Final(uint8_t out[SHA512_256_DIGEST_LENGTH],
- SHA512_CTX *sha) {
+int SHA512_256_Final(uint8_t out[SHA512_256_DIGEST_LENGTH], SHA512_CTX *sha) {
// |SHA512_256_Init| sets |sha->md_len| to |SHA512_256_DIGEST_LENGTH|, so this
// has a |smaller output.
- return SHA512_Final(out, sha);
+ assert(sha->md_len == SHA512_256_DIGEST_LENGTH);
+ return sha512_final_impl(out, sha);
}
void SHA512_Transform(SHA512_CTX *c, const uint8_t block[SHA512_CBLOCK]) {
@@ -232,6 +235,15 @@ int SHA512_Update(SHA512_CTX *c, const void *in_data, size_t len) {
}
int SHA512_Final(uint8_t out[SHA512_DIGEST_LENGTH], SHA512_CTX *sha) {
+ // Ideally we would assert |sha->md_len| is |SHA512_DIGEST_LENGTH| to match
+ // the size hint, but calling code often pairs |SHA384_Init| with
+ // |SHA512_Final| and expects |sha->md_len| to carry the over.
+ //
+ // TODO(davidben): Add an assert and fix code to match them up.
+ return sha512_final_impl(out, sha);
+}
+
+static int sha512_final_impl(uint8_t *out, SHA512_CTX *sha) {
uint8_t *p = sha->p;
size_t n = sha->num;

View file

@ -1,15 +0,0 @@
diff --git a/core/adb/client/usb_libusb.cpp b/core/adb/client/usb_libusb.cpp
index 7adb262..b994c8c 100644
--- a/core/adb/client/usb_libusb.cpp
+++ b/core/adb/client/usb_libusb.cpp
@@ -27,8 +27,9 @@
#include <string>
#include <thread>
#include <unordered_map>
+#include <condition_variable>
-#include <libusb/libusb.h>
+#include <libusb-1.0/libusb.h>
#include <android-base/file.h>
#include <android-base/logging.h>

View file

@ -1,17 +0,0 @@
diff --git a/core/libcutils/include/cutils/trace.h b/core/libcutils/include/cutils/trace.h
index fcbdc9b..4281375 100644
--- a/core/libcutils/include/cutils/trace.h
+++ b/core/libcutils/include/cutils/trace.h
@@ -18,7 +18,12 @@
#define _LIBS_CUTILS_TRACE_H
#include <inttypes.h>
+#ifdef __cplusplus
+#include <atomic>
+using namespace std;
+#else
#include <stdatomic.h>
+#endif
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
diff -Nrup a/vendor/boringssl/CMakeLists.txt b/vendor/boringssl/CMakeLists.txt
--- a/vendor/boringssl/CMakeLists.txt 2021-03-22 18:48:14.000000000 +0100
+++ b/vendor/boringssl/CMakeLists.txt 2021-05-04 17:07:59.835325518 +0200
@@ -117,7 +117,7 @@ endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
# Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration
# primarily on our normal Clang one.
- set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla")
+ set(C_CXX_FLAGS "-Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla")
if(MSVC)
# clang-cl sets different default warnings than clang. It also treats -Wall
# as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall.

View file

@ -0,0 +1,8 @@
diff -Nrup a/vendor/boringssl/go.mod b/vendor/boringssl/go.mod
--- a/vendor/boringssl/go.mod 2021-03-22 18:48:14.000000000 +0100
+++ b/vendor/boringssl/go.mod 2021-05-04 07:54:12.549092742 +0200
@@ -2,4 +2,3 @@ module boringssl.googlesource.com/boring
go 1.13
-require golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9

View file

@ -1,14 +0,0 @@
--- android-tools-8.0.0_r4/extras/ext4_utils/contents.c.bak 2017-06-11 09:17:45.000000000 +0200
+++ android-tools-8.0.0_r4/extras/ext4_utils/contents.c 2017-09-02 19:25:01.841722549 +0200
@@ -26,11 +26,7 @@
#include "extent.h"
#include "indirect.h"
-#ifdef __ANDROID__
#include <linux/capability.h>
-#else
-#include <private/android_filesystem_capability.h>
-#endif
#define XATTR_SELINUX_SUFFIX "selinux"
#define XATTR_CAPS_SUFFIX "capability"

View file

@ -1,24 +0,0 @@
diff -urN android-tools-8.1.0_r51-orig/core/adb/sysdeps/posix/network.cpp android-tools-8.1.0_r51-patched/core/adb/sysdeps/posix/network.cpp
--- android-tools-8.1.0_r51-orig/core/adb/sysdeps/posix/network.cpp 2018-12-02 12:12:01.474776920 +1000
+++ android-tools-8.1.0_r51-patched/core/adb/sysdeps/posix/network.cpp 2018-12-02 11:58:01.325761000 +1000
@@ -20,7 +20,7 @@
#include <netinet/in.h>
#include <sys/socket.h>
-#include <string>
+#include <string.h>
#include "adb_unique_fd.h"
diff -urN android-tools-8.1.0_r51-orig/core/libsparse/sparse_read.cpp android-tools-8.1.0_r51-patched/core/libsparse/sparse_read.cpp
--- android-tools-8.1.0_r51-orig/core/libsparse/sparse_read.cpp 2018-12-02 12:11:10.338775951 +1000
+++ android-tools-8.1.0_r51-patched/core/libsparse/sparse_read.cpp 2018-12-02 12:11:23.466776199 +1000
@@ -25,7 +25,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string>
+#include <string.h>
#include <unistd.h>
#include <sparse/sparse.h>

View file

@ -1,36 +1,34 @@
Summary: Android platform tools (adb, fastboot, mkbootimg)
Name: android-tools
Version: 8.1.0_r51
Release: 2
# The entire source code is Apache Software License except fastboot/ which is BSD
Version: 31.0.0p1
Release: 1
License: Apache Software License and BSD
Group: Development/Tools
Url: http://developer.android.com/tools/
#http://developer.android.com/guide/developing/tools/
# git clone https://android.googlesource.com/platform/system/core.git && cd core
# git archive android-%%{version} --prefix=core-%%{version}/ adb fastboot libzipfile libcutils libmincrypt libsparse mkbootimg include/cutils include/zipfile include/mincrypt | bzip2 > ../core-%%{version}.tar.bz2
#
# git clone https://android.googlesource.com/platform/system/extras.git && cd extras
# git archive android-%%{version} --prefix=extras/ ext4_utils | bzip2 > ../extras-%%{version}.tar.bz2
Source0: core-%{version}.tar.xz
Source1: extras-%{version}.tar.xz
Source2: generate_build.rb
Source3: boringssl-%{version}.tar.xz
Source4: mdnsresponder-%{version}.tar.xz
Url: https://github.com/nmeum/android-tools
Source0: https://github.com/nmeum/android-tools/releases/download/%{version}/%{name}-%{version}.tar.xz
Source5: 51-android.rules
Source6: adb.service
Patch1: 0001-Add-string-h.patch
Patch2: 0002-libusb-modifications.patch
Patch3: 0003-atomic-fix.patch
Patch5: android-tools-4.4.2-ignore-android_filesystem_capability.h.patch
Patch6: android-tools-8.1.0_r51-string.patch
BuildRequires: ruby
BuildRequires: gtest-devel
BuildRequires: pkgconfig(libselinux)
# From Fedora
Patch0: android-tools-31.0.0-system-golang-x-crypto.patch
# Fix for GCC 11 (P1,P2,P3)
Patch1: 0001-Fix-mismatch-between-header-and-implementation-of-bn_sqr_comba8.patch
Patch2: 0002-Use-an-unsized-helper-for-truncated-SHA-512-variants.patch
Patch3: android-tools-31.0.0-disable-Werror-with-gcc11.patch
BuildRequires: cmake
BuildRequires: go
BuildRequires: golang-x-crypto-devel
BuildRequires: pkgconfig(bash-completion)
BuildRequires: pkgconfig(gtest)
BuildRequires: pkgconfig(libbrotlidec)
BuildRequires: pkgconfig(libbrotlienc)
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(libpcre2-8)
BuildRequires: pkgconfig(libunwind-generic)
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(protobuf)
BuildRequires: pkgconfig(zlib)
Requires(post,preun): rpm-helper
Provides: adb = %{EVRD}
Provides: fastboot = %{EVRD}
Provides: mkbootimg = %{EVRD}
@ -54,25 +52,30 @@ The fastboot program works in conjunction with firmware on the phone
to read and write the flash partitions. It needs the same USB device
setup between the host and the target phone as adb.
For ROSA you must use the following commands :
For Rosa Fresh you must use the following commands:
- adb
- fastboot-android
- fastboot
- mkbootimg
%files
%doc core/adb/OVERVIEW.TXT core/adb/SERVICES.TXT core/adb/NOTICE core/adb/protocol.txt
%{_udevrulesdir}/51-android.rules
%{_unitdir}/adb.service
%attr(0755,root,root) %dir %{_sharedstatedir}/adb
%attr(0755,root,root) %dir %{_var}/lib/adb
#Apache Software License
%doc README.md
%{_bindir}/adb
%{_bindir}/simg2img
%{_bindir}/append2simg
%{_bindir}/fastboot
%{_bindir}/img2simg
%{_bindir}/mkbootimg
#Apache Software License and BSD.
%{_bindir}/fastboot-android
%{_bindir}/mke2fs.android
%{_bindir}/simg2img
%{_datadir}/bash-completion/completions/adb
%{_datadir}/bash-completion/completions/fastboot
%{_datadir}/licenses/%{name}/
%{_datadir}/%{name}/
%{_datadir}/zsh/site-functions/_adb
%{_datadir}/zsh/site-functions/_fastboot
%attr(0755,root,root) %dir %{_sharedstatedir}/adb
%{_udevrulesdir}/51-android.rules
%{_unitdir}/adb.service
%post
%_post_service adb
@ -83,25 +86,21 @@ For ROSA you must use the following commands :
#----------------------------------------------------------------------------
%prep
%setup -q -a 1 -a 3 -a 4 -c %{name}-%{version}
ln -s core-%{version} core
ln -s extras-%{version} extras
ln -s boringssl-%{version} boringssl
ln -s mdnsresponder-%{version} mdnsresponder
%apply_patches
%autosetup -p1
sed -i -e '1s/python$/python3/' vendor/mkbootimg/mkbootimg.py
%build
pushd core
ruby %{SOURCE2} | tee build.sh
PKGVER=android-%{version} CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" sh -xe build.sh
popd
%cmake \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_STATIC_LIBS:BOOL=ON
%make
%install
install -d -m 0755 %{buildroot}%{_bindir}
%makeinstall_std -C build
install -d -m 0775 %{buildroot}%{_sharedstatedir}/adb
install -d -m 0775 %{buildroot}%{_var}/lib/adb
install -m 0755 -t %{buildroot}%{_bindir} core/adb/adb core/fastboot/fastboot core/libsparse/simg2img core/libsparse/img2simg core/mkbootimg/mkbootimg
mv %{buildroot}%{_bindir}/fastboot %{buildroot}%{_bindir}/fastboot-android
install -m 0755 vendor/mkbootimg/mkbootimg.py %{buildroot}%{_bindir}/mkbootimg
# for 51-android.rules
mkdir -p %{buildroot}%{_udevrulesdir}

View file

@ -1,212 +0,0 @@
#!/usr/bin/ruby
# Android build system is complicated and does not allow to build
# separate parts easily.
# This script tries to mimic Android build rules.
def expand(dir, files)
files.map{|f| File.join(dir,f)}
end
# Compiles sources to *.o files.
# Returns array of output *.o filenames
def compile(sources, cflags)
outputs = []
for s in sources
ext = File.extname(s)
case ext
when '.c'
cc = 'gcc'
lang_flags = '-std=gnu11 $CFLAGS $CPPFLAGS'
when '.cpp', '.cc'
cc = 'g++'
lang_flags = '-std=gnu++14 $CXXFLAGS $CPPFLAGS'
else
raise "Unknown extension #{ext}"
end
output = s + '.o'
outputs << output
puts "#{cc} -o #{output} #{lang_flags} #{cflags} -c #{s}\n"
end
return outputs
end
# Links object files
def link(output, objects, ldflags)
puts "g++ -o #{output} #{ldflags} $LDFLAGS #{objects.join(' ')}"
end
adbdfiles = %w(
client/usb_dispatch.cpp
client/usb_libusb.cpp
client/usb_linux.cpp
adb.cpp
adb_io.cpp
socket_spec.cpp
adb_listeners.cpp
adb_utils.cpp
sockets.cpp
transport.cpp
transport_local.cpp
transport_usb.cpp
services.cpp
adb_trace.cpp
diagnose_usb.cpp
adb_auth_host.cpp
sysdeps_unix.cpp
sysdeps/posix/network.cpp
)
libadbd = compile(expand('adb', adbdfiles), '-DADB_VERSION=\"$PKGVER\" -DADB_HOST=1 -fpermissive -I../boringssl/include -Iadb -Iinclude -Ibase/include -Ilibcrypto_utils/include')
adbshfiles = %w(
fdevent.cpp
shell_service.cpp
shell_service_protocol.cpp
)
libadbsh = compile(expand('adb', adbshfiles), '-DADB_VERSION=\"$PKGVER\" -DADB_HOST=0 -D_Nonnull= -D_Nullable= -fpermissive -Iadb -Iinclude -Ibase/include')
adbfiles = %w(
console.cpp
bugreport.cpp
commandline.cpp
adb_client.cpp
sysdeps/errno.cpp
file_sync_client.cpp
line_printer.cpp
transport_mdns.cpp
client/main.cpp
)
libadb = compile(expand('adb', adbfiles), '-DADB_VERSION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -D_Nonnull= -D_Nullable= -fpermissive -Iadb -I../mdnsresponder/mDNSShared -Iinclude -Ibase/include')
basefiles = %w(
file.cpp
logging.cpp
parsenetaddress.cpp
stringprintf.cpp
strings.cpp
errors_unix.cpp
test_utils.cpp
)
libbase = compile(expand('base', basefiles), '-DADB_HOST=1 -D_GNU_SOURCE -Ibase/include -Iinclude')
logfiles = %w(
logger_write.c
local_logger.c
config_read.c
logprint.c
stderr_write.c
config_write.c
logger_lock.c
logger_name.c
log_event_list.c
log_event_write.c
fake_log_device.c
fake_writer.c
)
liblog = compile(expand('liblog', logfiles), '-DLIBLOG_LOG_TAG=1005 -DFAKE_LOG_DEVICE=1 -D_GNU_SOURCE -Ilog/include -Iinclude')
cutilsfiles = %w(
load_file.c
socket_inaddr_any_server_unix.c
socket_local_client_unix.c
socket_local_server_unix.c
socket_network_client_unix.c
threads.c
sockets.cpp
android_get_control_file.cpp
sockets_unix.cpp
)
libcutils = compile(expand('libcutils', cutilsfiles), '-D_GNU_SOURCE -Iinclude')
cryptofiles = %w(
android_pubkey.c
)
libcryptoutils = compile(expand('libcrypto_utils', cryptofiles), '-Ilibcrypto_utils/include -I../boringssl/include -Iinclude')
boringcryptofiles = %w(
fipsmodule/bn/cmp.c
fipsmodule/bn/bn.c
fipsmodule/bn/bytes.c
bytestring/cbb.c
mem.c
thread_pthread.c
buf/buf.c
bio/file.c
bn_extra/convert.c
base64/base64.c
)
boringcrypto = compile(expand('../boringssl/src/crypto', boringcryptofiles), '-I../boringssl/include -Iinclude')
mdnsfiles = %w(
mDNSShared/dnssd_ipc.c
mDNSShared/dnssd_clientstub.c
)
mdns = compile(expand('../mdnsresponder', mdnsfiles), '-D_GNU_SOURCE -DHAVE_IPV6 -DHAVE_LINUX -DNOT_HAVE_SA_LEN -DUSES_NETLINK -UMDNS_DEBUGMSGS -DMDNS_DEBUGMSGS=0 -I../mdnsresponder/mDNSShared -I../mdnsresponder/mDNSCore -Iinclude')
link('adb/adb', libbase + liblog + libcutils + boringcrypto + libcryptoutils + libadbd + libadbsh + mdns + libadb, '-lrt -ldl -lpthread -lcrypto -lutil -lusb-1.0')
fastbootfiles = %w(
socket.cpp
tcp.cpp
udp.cpp
protocol.cpp
engine.cpp
bootimg_utils.cpp
fastboot.cpp
util.cpp
fs.cpp
usb_linux.cpp
)
libfastboot = compile(expand('fastboot', fastbootfiles), '-DFASTBOOT_VERSION=\"$PKGVER\" -D_GNU_SOURCE -Iadb -Iinclude -Imkbootimg -Ibase/include -Ilibsparse/include -Ilibziparchive/include -I../extras/ext4_utils/include -I../extras/f2fs_utils')
sparsefiles = %w(
backed_block.c
output_file.c
sparse.c
sparse_crc32.c
sparse_err.c
sparse_read.cpp
)
libsparse = compile(expand('libsparse', sparsefiles), '-Ilibsparse/include -Ibase/include')
zipfiles = %w(
zip_archive.cc
)
libzip = compile(expand('libziparchive', zipfiles), '-Ibase/include -Iinclude -Ilibziparchive/include')
utilfiles = %w(
FileMap.cpp
)
libutil = compile(expand('libutils', utilfiles), '-Iinclude')
ext4files = %w(
make_ext4fs.c
ext4fixup.c
ext4_utils.c
allocate.c
contents.c
extent.c
indirect.c
sha1.c
wipe.c
crc16.c
ext4_sb.c
)
libext4 = compile(expand('../extras/ext4_utils', ext4files), '-Ilibsparse/include -Iinclude -I../extras/ext4_utils/include')
link('fastboot/fastboot', libsparse + libzip + liblog + libutil + libcutils + boringcrypto + libcryptoutils + libbase + libext4 + libfastboot + libadbsh + libadbd, '-lpthread -lselinux -lz -lcrypto -lutil -lusb-1.0')
simg2imgfiles = %w(
simg2img.c
)
libsimg2img = compile(expand('libsparse', simg2imgfiles), '-Iinclude -Ilibsparse/include')
link('libsparse/simg2img', libbase + libsparse + libsimg2img, '-lz')
img2simgfiles = %w(
img2simg.c
)
libimg2simg = compile(expand('libsparse', img2simgfiles), '-Iinclude -Ilibsparse/include')
link('libsparse/img2simg', libbase + libsparse + libimg2simg, '-lz')