aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2017-02-21 19:46:24 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2017-02-22 13:17:07 +0100
commitf7326128b848e798922ccba07eeb4c5f51ca8ce0 (patch)
tree4441a9123b60000c000e5212e3778bfecb1f5c9c /meta-oe
parent4816cb8bc5f73f412fd516c71531b8a6c2ca318c (diff)
downloadmeta-openembedded-f7326128b848e798922ccba07eeb4c5f51ca8ce0.tar.gz
android-tools: add libcap dependency and fix build on big endian systems
* add dependency on libcap to fix: android-tools/5.1.1.r37-r0/git/system/core/adb/adb.c:39:28: fatal error: sys/capability.h: No such file or directory #include <sys/capability.h> ^ * add patch from buildroot to fix build with newer glibc and on bit-endian systems android-tools/5.1.1.r37-r0/git/system/core/adb/usb_linux_client.c:38:25: error: initializer element is not constant #define cpu_to_le32(x) htole32(x) ^ * and also disable thumb to fix: http://errors.yoctoproject.org/Errors/Details/133881/ * drop default apply=yes for the .patch files Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-devtools/android-tools/android-tools/fix-big-endian-build.patch39
-rw-r--r--meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb23
2 files changed, 53 insertions, 9 deletions
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools/fix-big-endian-build.patch b/meta-oe/recipes-devtools/android-tools/android-tools/fix-big-endian-build.patch
new file mode 100644
index 0000000000..8deaf3a3d7
--- /dev/null
+++ b/meta-oe/recipes-devtools/android-tools/android-tools/fix-big-endian-build.patch
@@ -0,0 +1,39 @@
+Fix build on big endian systems
+
+The usb_linux_client.c file defines cpu_to_le16/32 by using the C
+library htole16/32 function calls. However, cpu_to_le16/32 are used
+when initializing structures, i.e in a context where a function call
+is not allowed.
+
+It works fine on little endian systems because htole16/32 are defined
+by the C library as no-ops. But on big-endian systems, they are
+actually doing something, which might involve calling a function,
+causing build failures.
+
+To solve this, we simply open-code cpu_to_le16/32 in a way that allows
+them to be used when initializing structures.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/system/core/adb/usb_linux_client.c
+===================================================================
+--- a/system/core/adb/usb_linux_client.c
++++ b/system/core/adb/usb_linux_client.c
+@@ -34,8 +34,15 @@
+ #define MAX_PACKET_SIZE_FS 64
+ #define MAX_PACKET_SIZE_HS 512
+
+-#define cpu_to_le16(x) htole16(x)
+-#define cpu_to_le32(x) htole32(x)
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++# define cpu_to_le16(x) (x)
++# define cpu_to_le32(x) (x)
++#else
++# define cpu_to_le16(x) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
++# define cpu_to_le32(x) \
++ ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \
++ (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
++#endif
+
+ struct usb_handle
+ {
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
index a9e7d5d828..f39a82ccc6 100644
--- a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
+++ b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = " \
file://${COMMON_LICENSE_DIR}/BSD-2-Clause;md5=8bef8e6712b1be5aa76af1ebde9d6378 \
file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \
"
-DEPENDS = "libbsd libpcre openssl zlib"
+DEPENDS = "libbsd libpcre openssl zlib libcap"
ANDROID_TAG = "android-5.1.1_r37"
ANDROID_MIRROR = "android.googlesource.com"
@@ -23,14 +23,15 @@ SRC_URI = " \
git://${LIBHARDWARE_REPO};name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware;tag=${ANDROID_TAG} \
git://${LIBSELINUX_REPO};name=libselinux;protocol=https;nobranch=1;destsuffix=git/external/libselinux;tag=${ANDROID_TAG} \
git://${BUILD_REPO};name=build;protocol=https;nobranch=1;destsuffix=git/build;tag=${ANDROID_TAG} \
- file://remove-selinux-android.patch;apply=yes \
- file://use-capability.patch;apply=yes \
- file://use-local-socket.patch;apply=yes \
- file://preserve-ownership.patch;apply=yes \
- file://mkbootimg-Add-dt-parameter-to-specify-DT-image.patch;apply=yes \
- file://remove-bionic-android.patch;apply=yes \
- file://define-shell-command.patch;apply=yes \
- file://implicit-declaration-function-strlcat-strlcopy.patch;apply=yes \
+ file://remove-selinux-android.patch \
+ file://use-capability.patch \
+ file://use-local-socket.patch \
+ file://preserve-ownership.patch \
+ file://mkbootimg-Add-dt-parameter-to-specify-DT-image.patch \
+ file://remove-bionic-android.patch \
+ file://define-shell-command.patch \
+ file://implicit-declaration-function-strlcat-strlcopy.patch \
+ file://fix-big-endian-build.patch \
file://android-tools-adbd.service \
file://.gitignore;subdir=git \
file://adb.mk;subdir=${BPN} \
@@ -43,6 +44,10 @@ SRC_URI = " \
S = "${WORKDIR}/git"
B = "${WORKDIR}/${BPN}"
+# http://errors.yoctoproject.org/Errors/Details/133881/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
inherit systemd
SYSTEMD_SERVICE_${PN} = "android-tools-adbd.service"