Update to upstream git commit e7195be7725a

- Resolves: rhbz 1323632 1423219 Add optflags. Support new versions.
This commit is contained in:
Ivan Afonichev 2017-03-11 02:55:09 +04:00
commit 145ed9889b
6 changed files with 118 additions and 42 deletions

View file

@ -11,26 +11,26 @@ index 296995e..48269b6 100644
namespace android {
namespace base {
diff --git a/base/file.cpp b/base/file.cpp
index da1adba..91a3901 100644
index 81b04d7..2fd2b6e 100644
--- a/base/file.cpp
+++ b/base/file.cpp
@@ -20,6 +20,7 @@
#include <fcntl.h>
@@ -22,6 +22,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <string.h>
#include <string>
#include <memory>
#include <mutex>
diff --git a/base/logging.cpp b/base/logging.cpp
index 1741871..0f9e11a 100644
index 6357b4b..3c7dbce 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -29,6 +29,7 @@
#include <errno.h>
#endif
@@ -23,6 +23,7 @@
#include <fcntl.h>
#include <libgen.h>
#include <time.h>
+#include <string.h>
#include <iostream>
#include <limits>
#include <sstream>
// For getprogname(3) or program_invocation_short_name.
#if defined(__ANDROID__) || defined(__APPLE__)

View file

@ -0,0 +1,15 @@
diff --git a/adb/client/usb_libusb.cpp b/adb/client/usb_libusb.cpp
index 7adb262..b994c8c 100644
--- a/adb/client/usb_libusb.cpp
+++ b/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>

17
0003-atomic-fix.patch Normal file
View file

@ -0,0 +1,17 @@
diff --git a/libcutils/include/cutils/trace.h b/libcutils/include/cutils/trace.h
index fcbdc9b..4281375 100644
--- a/libcutils/include/cutils/trace.h
+++ b/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>

View file

@ -1,15 +1,20 @@
%global date 20160327
%global git_commit 3761365735de
%global date 20170311
%global git_commit e7195be7725a
%global packdname core-%{git_commit}
%global extras_git_commit 7f5999a
%global extras_git_commit 61f6603
%global extras_packdname extras-%{extras_git_commit}
%global boring_git_commit 7d422bc
%global boring_packdname boringssl-%{boring_git_commit}
%global mdns_git_commit ca0cba5
%global mdns_packdname mdnsresponder-%{mdns_git_commit}
%global _hardened_build 1
Name: android-tools
Version: %{date}git%{git_commit}
Release: 3%{?dist}
Release: 1%{?dist}
Summary: Android platform tools(adb, fastboot)
Group: Applications/System
@ -18,17 +23,28 @@ License: ASL 2.0 and (ASL 2.0 and BSD)
URL: http://developer.android.com/guide/developing/tools/
# using git archive since upstream hasn't created tarballs.
# git archive --format=tar --prefix=%%{packdname}/ %%{git_commit} adb fastboot libzipfile libcutils libmincrypt libsparse mkbootimg include/cutils include/zipfile include/mincrypt include/utils include/private | xz > %%{packdname}.tar.xz
# git archive --format=tar --prefix=%%{packdname}/ %%{git_commit} adb base fastboot libcrypto_utils libcutils liblog libsparse libutils libziparchive mkbootimg include | xz > %%{packdname}.tar.xz
# https://android.googlesource.com/platform/system/core.git
# git archive --format=tar --prefix=extras/ %%{extras_git_commit} ext4_utils f2fs_utils | xz > %%{extras_packdname}.tar.xz
# https://android.googlesource.com/platform/system/extras.git
# git archive --format=tar --prefix=boringssl/ %%{boring_git_commit} src/crypto include src/include | xz > %%{boring_packdname}.tar.xz
# https://android.googlesource.com/platform/external/boringssl
# git archive --format=tar --prefix=mdnsresponder/ %%{mdns_git_commit} mDNSShared | xz > %%{mdns_packdname}.tar.xz
# https://android.googlesource.com/platform/external/mdnsresponder
Source0: %{packdname}.tar.xz
Source1: %{extras_packdname}.tar.xz
Source2: generate_build.rb
Source3: %{boring_packdname}.tar.xz
Source4: %{mdns_packdname}.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
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
@ -37,6 +53,7 @@ BuildRequires: openssl-devel
BuildRequires: libselinux-devel
BuildRequires: f2fs-tools-devel
BuildRequires: gtest-devel
BuildRequires: libusbx-devel
BuildRequires: systemd
BuildRequires: ruby rubypick rubygems
@ -65,8 +82,13 @@ setup between the host and the target phone as adb.
%prep
%setup -q -b 1 -n extras
%setup -q -b 3 -n boringssl
%setup -q -b 4 -n mdnsresponder
%setup -q -b 0 -n %{packdname}
%patch1 -p1
%patch2 -p1
%patch3 -p1
cp -p %{SOURCE5} 51-android.rules
%build
@ -102,6 +124,10 @@ install -p -D -m 0644 %{SOURCE6} \
%changelog
* Sat Mar 11 2017 Ivan Afonichev <ivan.afonichev@gmail.com> - 20170311gite7195be7725a-1
- Update to upstream git commit e7195be7725a
- Resolves: rhbz 1323632 1423219 Add optflags. Support new versions.
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20160327git3761365735de-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

View file

@ -39,21 +39,13 @@ def link(output, objects, ldflags)
puts "g++ -o #{output} #{ldflags} $LDFLAGS #{objects.join(' ')}"
end
minicryptfiles = %w(
dsa_sig.c
p256_ec.c
rsa.c
sha.c
p256.c
p256_ecdsa.c
sha256.c
)
libminicrypt = compile(expand('libmincrypt', minicryptfiles), '-Iinclude')
adbdfiles = %w(
client/usb_dispatch.cpp
client/usb_libusb.cpp
client/usb_linux.cpp
adb.cpp
adb_auth.cpp
adb_io.cpp
socket_spec.cpp
adb_listeners.cpp
adb_utils.cpp
sockets.cpp
@ -62,13 +54,11 @@ adbdfiles = %w(
transport_usb.cpp
services.cpp
adb_trace.cpp
get_my_path_linux.cpp
usb_linux.cpp
diagnose_usb.cpp
adb_auth_host.cpp
sysdeps_unix.cpp
)
libadbd = compile(expand('adb', adbdfiles), '-DADB_REVISION=\"$PKGVER\" -DADB_HOST=1 -fpermissive -Iinclude -Ibase/include')
libadbd = compile(expand('adb', adbdfiles), '-DADB_REVISION=\"$PKGVER\" -DADB_HOST=1 -fpermissive -I../boringssl/include -Iadb -Iinclude -Ibase/include -Ilibcrypto_utils/include')
adbshfiles = %w(
fdevent.cpp
@ -79,13 +69,16 @@ libadbsh = compile(expand('adb', adbshfiles), '-DADB_REVISION=\"$PKGVER\" -DADB_
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_REVISION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -D_Nonnull= -D_Nullable= -fpermissive -Iadb -Iinclude -Ibase/include')
libadb = compile(expand('adb', adbfiles), '-DADB_REVISION=\"$PKGVER\" -D_GNU_SOURCE -DADB_HOST=1 -D_Nonnull= -D_Nullable= -fpermissive -Iadb -I../mdnsresponder/mDNSShared -Iinclude -Ibase/include')
basefiles = %w(
file.cpp
@ -99,6 +92,10 @@ libbase = compile(expand('base', basefiles), '-DADB_HOST=1 -D_GNU_SOURCE -Ibase/
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
@ -114,17 +111,37 @@ cutilsfiles = %w(
socket_inaddr_any_server_unix.c
socket_local_client_unix.c
socket_local_server_unix.c
socket_loopback_client_unix.c
socket_loopback_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')
link('adb/adb', libbase + liblog + libcutils + libadbd + libadbsh + libadb, '-lrt -ldl -lpthread -lcrypto -lutil')
cryptofiles = %w(
android_pubkey.c
)
libcryptoutils = compile(expand('libcrypto_utils', cryptofiles), '-Ilibcrypto_utils/include -I../boringssl/include -Iinclude')
boringcryptofiles = %w(
bn/cmp.c
bn/bn.c
bytestring/cbb.c
bio/file.c
bn/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
@ -137,9 +154,8 @@ fastbootfiles = %w(
util.cpp
fs.cpp
usb_linux.cpp
util_linux.cpp
)
libfastboot = compile(expand('fastboot', fastbootfiles), '-DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Iadb -Iinclude -Imkbootimg -Ibase/include -Ilibsparse/include -I../extras/ext4_utils -I../extras/f2fs_utils')
libfastboot = compile(expand('fastboot', fastbootfiles), '-DFASTBOOT_REVISION=\"$PKGVER\" -D_GNU_SOURCE -Iadb -Iinclude -Imkbootimg -Ibase/include -Ilibsparse/include -I../extras/ext4_utils/include -I../extras/f2fs_utils')
sparsefiles = %w(
backed_block.c
@ -174,9 +190,9 @@ ext4files = %w(
crc16.c
ext4_sb.c
)
libext4 = compile(expand('../extras/ext4_utils', ext4files), '-Ilibsparse/include -Iinclude')
libext4 = compile(expand('../extras/ext4_utils', ext4files), '-Ilibsparse/include -Iinclude -I../extras/ext4_utils/include')
link('fastboot/fastboot', libsparse + libzip + liblog + libutil + libcutils + libbase + libext4 + libfastboot + libadbsh + libadbd, '-lpthread -lselinux -lz -lcrypto -lutil')
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

View file

@ -1,2 +1,4 @@
bdccaa042b73d1f5a29630c69ae5df26 core-3761365735de.tar.xz
2cd5ea576fdf35f5e9ee1c208f6d9fa5 extras-7f5999a.tar.xz
SHA512 (core-e7195be7725a.tar.xz) = 817cdee3cb71721757c53c07b958e3c308566d3c5c21bf4e013c33445c11ea49c9acab8e0b02d949d2fb4eede41e50d2faacdaadfc59e551a85a5b93a96d6ca1
SHA512 (extras-61f6603.tar.xz) = 464afcd4186b3e7d0dd8117a44878cace0b0df077ae452b5b244cf8c44456b5f4299241a8c962dc4ee7f0da291c388ea58e83d0137fbbc60a52fd22350ad58f3
SHA512 (boringssl-7d422bc.tar.xz) = a06009933408045a3fc7064460d5ddc15c5f5958327cf044a0d1f00729193f373e2190f3c07937d1a3edf8e6c85374fb8ade81b952c6608e67b0590c3538ddd5
SHA512 (mdnsresponder-ca0cba5.tar.xz) = 2139e26ab19c845a636818090d2f6282685a87f9a1b16e51384474480bd1b038de5fab4ea415b6276efb64402832ae46be14030931b100684e9952d6efc1ab9b