added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,39 @@
From 738549dea7a4e6c462a79962c414eaa450c2cffd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 9 Apr 2020 13:06:27 -0700
Subject: [PATCH 1/3] absl: always use <asm/sgidefs.h>
Fixes mips/musl build, since sgidefs.h is not present on all C libraries
but on linux asm/sgidefs.h is there and contains same definitions, using
that makes it portable.
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
absl/base/internal/direct_mmap.h | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
index e492bb0..c8a4fba 100644
--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -41,13 +41,9 @@
#ifdef __mips__
// Include definitions of the ABI currently in use.
-#if defined(__BIONIC__) || !defined(__GLIBC__)
-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
+// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
// definitions we need.
#include <asm/sgidefs.h>
-#else
-#include <sgidefs.h>
-#endif // __BIONIC__ || !__GLIBC__
#endif // __mips__
// SYS_mmap and SYS_munmap are not defined in Android.
--
2.25.1

View File

@@ -0,0 +1,42 @@
From 45fdade6c0415ec5af3f9312e6311a4ccc682a7b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 28 Dec 2022 18:24:21 -0800
Subject: [PATCH] direct_mmap: Use off_t on linux
off64_t is not provided without defining _LARGEFILE64_SOURCE on musl
this define is not defined automatically like glibc where it gets
defined when _GNU_SOURCE is defined. Using off_t makes it portable
across musl/glibc and for using 64bit off_t on glibc 32bit systems
-D_FILE_OFFSET_BITS=64 can be defined during build via CXXFLAGS
Upstream-Status: Submitted [https://github.com/abseil/abseil-cpp/pull/1349]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
absl/base/internal/direct_mmap.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
index 815b8d23..fdf88f0b 100644
--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -72,7 +72,7 @@ namespace base_internal {
// Platform specific logic extracted from
// https://chromium.googlesource.com/linux-syscall-support/+/master/linux_syscall_support.h
inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
- off64_t offset) noexcept {
+ off_t offset) noexcept {
#if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
defined(__m68k__) || defined(__sh__) || \
(defined(__hppa__) && !defined(__LP64__)) || \
@@ -102,7 +102,7 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
#else
return reinterpret_cast<void*>(
syscall(SYS_mmap2, start, length, prot, flags, fd,
- static_cast<off_t>(offset / pagesize)));
+ offset / pagesize));
#endif
#elif defined(__s390x__)
// On s390x, mmap() arguments are passed in memory.
--
2.39.0

View File

@@ -0,0 +1,37 @@
From d25cf3b9aa873595a19e197cc29ab46c0093bff1 Mon Sep 17 00:00:00 2001
From: Sinan Kaya <sinan.kaya@microsoft.com>
Date: Mon, 3 Feb 2020 03:25:57 +0000
Subject: [PATCH 2/3] Remove maes option from cross-compilation
---
absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
absl/copts/GENERATED_copts.bzl | 4 ----
2 files changed, 8 deletions(-)
diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
index a4ab1aa2041e..23b9253c1f00 100644
--- a/absl/copts/GENERATED_AbseilCopts.cmake
+++ b/absl/copts/GENERATED_AbseilCopts.cmake
@@ -158,7 +158,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
)
-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
- "-maes"
- "-msse4.1"
-)
diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
index a6efc98e11d4..1e847f769501 100644
--- a/absl/copts/GENERATED_copts.bzl
+++ b/absl/copts/GENERATED_copts.bzl
@@ -159,7 +159,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
]
-ABSL_RANDOM_HWAES_X64_FLAGS = [
- "-maes",
- "-msse4.1",
-]
--
2.36.1

View File

@@ -0,0 +1,47 @@
From fb24c3e3539b5743d398a429a302a3886186f261 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@bisdn.de>
Date: Thu, 16 Jun 2022 11:46:31 +0000
Subject: [PATCH 3/3] Remove neon option from cross compilation
Not every arm platform supports neon instructions, so do not enforce
them.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
---
absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
absl/copts/GENERATED_copts.bzl | 4 ----
2 files changed, 8 deletions(-)
diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
index 23b9253c1f00..5d112a97f3e4 100644
--- a/absl/copts/GENERATED_AbseilCopts.cmake
+++ b/absl/copts/GENERATED_AbseilCopts.cmake
@@ -147,10 +147,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
"/DNOMINMAX"
)
-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
- "-mfpu=neon"
-)
-
list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
"-march=armv8-a+crypto"
)
diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
index 1e847f769501..3e10db204faf 100644
--- a/absl/copts/GENERATED_copts.bzl
+++ b/absl/copts/GENERATED_copts.bzl
@@ -148,10 +148,6 @@ ABSL_MSVC_TEST_FLAGS = [
"/DNOMINMAX",
]
-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
- "-mfpu=neon",
-]
-
ABSL_RANDOM_HWAES_ARM64_FLAGS = [
"-march=armv8-a+crypto",
]
--
2.36.1

View File

@@ -0,0 +1,79 @@
An all-in-one patch that fixes several issues:
1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
2) powerpc stacktrace implementation only works on glibc (disabled on musl)
3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
Sourced from void linux
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/absl/base/internal/unscaledcycleclock.cc
+++ b/absl/base/internal/unscaledcycleclock.cc
@@ -20,7 +20,7 @@
#include <intrin.h>
#endif
-#if defined(__powerpc__) || defined(__ppc__)
+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
#ifdef __GLIBC__
#include <sys/platform/ppc.h>
#elif defined(__FreeBSD__)
@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
return base_internal::NominalCPUFrequency();
}
-#elif defined(__powerpc__) || defined(__ppc__)
+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
int64_t UnscaledCycleClock::Now() {
#ifdef __GLIBC__
--- a/absl/base/internal/unscaledcycleclock_config.h
+++ b/absl/base/internal/unscaledcycleclock_config.h
@@ -21,7 +21,8 @@
// The following platforms have an implementation of a hardware counter.
#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
- defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \
+ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
+ defined(__riscv) || \
defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC))
#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
#else
--- a/absl/debugging/internal/examine_stack.cc
+++ b/absl/debugging/internal/examine_stack.cc
@@ -33,6 +33,10 @@
#include <csignal>
#include <cstdio>
+#if defined(__powerpc__)
+#include <asm/ptrace.h>
+#endif
+
#include "absl/base/attributes.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h"
@@ -174,8 +178,10 @@ void* GetProgramCounter(void* const vuc) {
return reinterpret_cast<void*>(context->uc_mcontext.pc);
#elif defined(__powerpc64__)
return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) && defined(__GLIBC__)
return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
+#elif defined(__powerpc__)
+ return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
#elif defined(__riscv)
return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
#elif defined(__s390__) && !defined(__s390x__)
--- a/absl/debugging/internal/stacktrace_config.h
+++ b/absl/debugging/internal/stacktrace_config.h
@@ -60,7 +60,7 @@
#elif defined(__i386__) || defined(__x86_64__)
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_x86-inl.inc"
-#elif defined(__ppc__) || defined(__PPC__)
+#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_powerpc-inl.inc"
#elif defined(__aarch64__)

View File

@@ -0,0 +1,36 @@
SUMMARY = "Abseil is a cpp library like STL"
DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
additional useful libraries like algorithm, container, debugging, hash, memory, \
meta, numeric, strings, synchronization, time, types and utility"
HOMEPAGE = "https://abseil.io/"
SECTION = "libs"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
PV = "20230125.2"
SRCREV = "b971ac5250ea8de900eae9f95e06548d14cd95fe"
BRANCH = "lts_2023_01_25"
SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
file://0001-absl-always-use-asm-sgidefs.h.patch \
file://0002-Remove-maes-option-from-cross-compilation.patch \
file://abseil-ppc-fixes.patch \
file://0003-Remove-neon-option-from-cross-compilation.patch \
file://0001-direct_mmap-Use-off_t-on-linux.patch \
"
S = "${WORKDIR}/git"
ASNEEDED:class-native = ""
ASNEEDED:class-nativesdk = ""
inherit cmake
EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_CXX_STANDARD=14 \
-DABSL_ENABLE_INSTALL=ON \
"
BBCLASSEXTEND = "native nativesdk"
FILES:${PN}-dev += "${includedir} ${libdir}/cmake ${libdir}/pkgconfig"

View File

@@ -0,0 +1,4 @@
[Service]
ExecStartPre=/usr/bin/android-gadget-setup
ExecStartPost=/usr/bin/android-gadget-start
ExecStopPost=/usr/bin/android-gadget-cleanup

View File

@@ -0,0 +1,24 @@
#!/bin/sh
[ -d /sys/kernel/config/usb_gadget ] || exit 0
cd /sys/kernel/config/usb_gadget
cd adb
echo -n "" > UDC || true
killall adbd || true
umount /dev/usb-ffs/adb
rm configs/c.1/ffs.usb0
rmdir configs/c.1/strings/0x409
rmdir configs/c.1
rmdir functions/ffs.usb0
rmdir strings/0x409
cd ..
rmdir adb

View File

@@ -0,0 +1,35 @@
#!/bin/sh
set -e
manufacturer=RPB
model="Android device"
serial=0123456789ABCDEF
if [ -r /etc/android-gadget-setup.machine ] ; then
. /etc/android-gadget-setup.machine
fi
[ -d /sys/kernel/config/usb_gadget ] || modprobe libcomposite
cd /sys/kernel/config/usb_gadget
[ -d adb ] && /usr/bin/android-gadget-cleanup || true
mkdir adb
cd adb
mkdir configs/c.1
mkdir functions/ffs.usb0
mkdir strings/0x409
mkdir configs/c.1/strings/0x409
echo -n 0x18d1 > idVendor
echo -n 0xd002 > idProduct
echo "$serial" > strings/0x409/serialnumber
echo "$manufacturer" > strings/0x409/manufacturer
echo "$model" > strings/0x409/product
echo "Conf 1" > configs/c.1/strings/0x409/configuration
ln -s functions/ffs.usb0 configs/c.1
mkdir -p /dev/usb-ffs/adb
mount -t functionfs usb0 /dev/usb-ffs/adb

View File

@@ -0,0 +1,9 @@
#!/bin/sh
set -e
sleep 10
ls /sys/class/udc/ | head -n 1 | xargs echo -n > /sys/kernel/config/usb_gadget/adb/UDC
echo "Setting UDC $(ls /sys/class/udc/ | head -n 1) for USB ADB Gadget usage"

View File

@@ -0,0 +1,35 @@
DESCRIPTION = "Different utilities from Android - corressponding configuration files for using ConfigFS"
SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = " \
file://android-gadget-setup \
file://android-gadget-start \
file://android-gadget-cleanup \
file://10-adbd-configfs.conf \
"
PACKAGE_ARCH = "${MACHINE_ARCH}"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/android-gadget-setup ${D}${bindir}
install -m 0755 ${WORKDIR}/android-gadget-start ${D}${bindir}
install -m 0755 ${WORKDIR}/android-gadget-cleanup ${D}${bindir}
if [ -r ${WORKDIR}/android-gadget-setup.machine ] ; then
install -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/android-gadget-setup.machine ${D}${sysconfdir}
fi
install -d ${D}${systemd_unitdir}/system/android-tools-adbd.service.d
install -m 0644 ${WORKDIR}/10-adbd-configfs.conf ${D}${systemd_unitdir}/system/android-tools-adbd.service.d
}
FILES:${PN} += " \
${systemd_unitdir}/system/ \
"
PROVIDES += "android-tools-conf"
RPROVIDES:${PN} = "android-tools-conf"

View File

@@ -0,0 +1,37 @@
#!/bin/sh
[ ! -e /dev/pts ] && mkdir -p /dev/pts
[ ! -e /dev/pts/0 ] && mount devpts /dev/pts -t devpts
# TODO enable the lines below once we have support for getprop
# retrieve the product info from Android
# manufacturer=$(getprop ro.product.manufacturer Android)
# model=$(getprop ro.product.model Android)
# serial=$(getprop ro.serialno 0123456789ABCDEF)
#below are now needed in order to use FunctionFS for ADB, tested to work with 3.4+ kernels
if grep -q functionfs /proc/filesystems; then
mkdir -p /dev/usb-ffs/adb
mount -t functionfs adb /dev/usb-ffs/adb
#android-gadget-setup doesn't provide below 2 and without them it won't work, so we provide them here.
echo adb > /sys/class/android_usb/android0/f_ffs/aliases
echo ffs > /sys/class/android_usb/android0/functions
fi
manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)"
model="$(cat /system/build.prop | grep -o 'ro.product.model=.*' | cut -d'=' -f 2)"
# get the device serial number from /proc/cmdline directly(since we have no getprop on
# GNU/Linux)
serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')"
echo $serial > /sys/class/android_usb/android0/iSerial
echo $manufacturer > /sys/class/android_usb/android0/iManufacturer
echo $model > /sys/class/android_usb/android0/iProduct
echo "0" > /sys/class/android_usb/android0/enable
echo "18d1" > /sys/class/android_usb/android0/idVendor
echo "D002" > /sys/class/android_usb/android0/idProduct
echo "adb" > /sys/class/android_usb/android0/functions
echo "1" > /sys/class/android_usb/android0/enable
sleep 4

View File

@@ -0,0 +1,20 @@
DESCRIPTION = "Different utilities from Android - corressponding configuration files"
SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://android-gadget-setup"
PACKAGE_ARCH = "${MACHINE_ARCH}"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/android-gadget-setup ${D}${bindir}
}
python () {
pn = d.getVar('PN')
profprov = d.getVar("PREFERRED_PROVIDER_" + pn)
if profprov and pn != profprov:
raise bb.parse.SkipRecipe("PREFERRED_PROVIDER_%s set to %s, not %s" % (pn, profprov, pn))
}

View File

@@ -0,0 +1,72 @@
# Makefile for adb
SRCDIR ?= $(S)
VPATH += $(SRCDIR)/system/core/adb
adb_SRC_FILES += adb.c
adb_SRC_FILES += console.c
adb_SRC_FILES += transport.c
adb_SRC_FILES += transport_local.c
adb_SRC_FILES += transport_usb.c
adb_SRC_FILES += commandline.c
adb_SRC_FILES += adb_client.c
adb_SRC_FILES += adb_auth_host.c
adb_SRC_FILES += sockets.c
adb_SRC_FILES += services.c
adb_SRC_FILES += file_sync_client.c
adb_SRC_FILES += get_my_path_linux.c
adb_SRC_FILES += usb_linux.c
adb_SRC_FILES += usb_vendors.c
adb_SRC_FILES += fdevent.c
adb_OBJS := $(adb_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/core/libcutils
libcutils_SRC_FILES += atomic.c
libcutils_SRC_FILES += hashmap.c
libcutils_SRC_FILES += native_handle.c
libcutils_SRC_FILES += config_utils.c
libcutils_SRC_FILES += cpu_info.c
libcutils_SRC_FILES += load_file.c
# libcutils_SRC_FILES += open_memstream.c
# libcutils_SRC_FILES += strdup16to8.c
# libcutils_SRC_FILES += strdup8to16.c
# libcutils_SRC_FILES += record_stream.c
# libcutils_SRC_FILES += process_name.c
# libcutils_SRC_FILES += threads.c
# libcutils_SRC_FILES += sched_policy.c
# libcutils_SRC_FILES += iosched_policy.c
libcutils_SRC_FILES += str_parms.c
libcutils_SRC_FILES += fs.c
libcutils_SRC_FILES += multiuser.c
libcutils_SRC_FILES += socket_inaddr_any_server.c
libcutils_SRC_FILES += socket_local_client.c
libcutils_SRC_FILES += socket_local_server.c
libcutils_SRC_FILES += socket_loopback_client.c
libcutils_SRC_FILES += socket_loopback_server.c
libcutils_SRC_FILES += socket_network_client.c
libcutils_SRC_FILES += sockets.c
libcutils_SRC_FILES += ashmem-host.c
libcutils_SRC_FILES += dlmalloc_stubs.c
libcutils_OBJS := $(libcutils_SRC_FILES:.c=.o)
CFLAGS += -DANDROID
CFLAGS += -DWORKAROUND_BUG6558362
CFLAGS += -DADB_HOST=1
CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
CFLAGS += -DANDROID_SMP=0
CFLAGS += -I$(SRCDIR)/system/core/adb
CFLAGS += -I$(SRCDIR)/system/core/include
CFLAGS += -include $(SRCDIR)/build/core/combo/include/arch/$(android_arch)/AndroidConfig.h
LIBS += libcutils.a -lpthread -lcrypto
all: adb
adb: libcutils.a $(adb_OBJS)
$(CC) -o $@ $(LDFLAGS) $(adb_OBJS) $(LIBS)
libcutils.a: $(libcutils_OBJS)
$(AR) rcs $@ $(libcutils_OBJS)
clean:
$(RM) $(adb_OBJS) $(libcutils_OBJS) adb *.a

View File

@@ -0,0 +1,164 @@
# Makefile for adbd
SRCDIR ?= $(S)
VPATH += $(SRCDIR)/system/core/adb
adbd_SRC_FILES += adb.c
adbd_SRC_FILES += fdevent.c
adbd_SRC_FILES += transport.c
adbd_SRC_FILES += transport_local.c
adbd_SRC_FILES += transport_usb.c
adbd_SRC_FILES += adb_auth_client.c
adbd_SRC_FILES += sockets.c
adbd_SRC_FILES += services.c
adbd_SRC_FILES += file_sync_service.c
adbd_SRC_FILES += jdwp_service.c
adbd_SRC_FILES += framebuffer_service.c
adbd_SRC_FILES += remount_service.c
adbd_SRC_FILES += disable_verity_service.c
adbd_SRC_FILES += base64.c
adbd_SRC_FILES += usb_linux_client.c
adbd_OBJS := $(adbd_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/core/liblog
liblog_SRC_FILES += logd_write.c
liblog_SRC_FILES += log_event_write.c
liblog_SRC_FILES += logprint.c
liblog_SRC_FILES += event_tag_map.c
liblog_SRC_FILES += fake_log_device.c
liblog_OBJS := $(liblog_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/core/fs_mgr
fs_mgr_SRC_FILES += fs_mgr_fstab.c
fs_mgr_OBJS := $(fs_mgr_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/core/libcutils
libcutils_SRC_FILES += atomic.c
libcutils_SRC_FILES += hashmap.c
libcutils_SRC_FILES += native_handle.c
libcutils_SRC_FILES += config_utils.c
libcutils_SRC_FILES += cpu_info.c
libcutils_SRC_FILES += load_file.c
# libcutils_SRC_FILES += open_memstream.c
# libcutils_SRC_FILES += strdup16to8.c
# libcutils_SRC_FILES += strdup8to16.c
# libcutils_SRC_FILES += record_stream.c
# libcutils_SRC_FILES += process_name.c
# libcutils_SRC_FILES += threads.c
# libcutils_SRC_FILES += sched_policy.c
# libcutils_SRC_FILES += iosched_policy.c
libcutils_SRC_FILES += str_parms.c
libcutils_SRC_FILES += fs.c
libcutils_SRC_FILES += multiuser.c
libcutils_SRC_FILES += socket_inaddr_any_server.c
libcutils_SRC_FILES += socket_local_client.c
libcutils_SRC_FILES += socket_local_server.c
libcutils_SRC_FILES += socket_loopback_client.c
libcutils_SRC_FILES += socket_loopback_server.c
libcutils_SRC_FILES += socket_network_client.c
libcutils_SRC_FILES += sockets.c
libcutils_SRC_FILES += ashmem-host.c
libcutils_SRC_FILES += dlmalloc_stubs.c
libcutils_SRC_FILES += klog.c
libcutils_SRC_FILES += properties.c
libcutils_OBJS := $(libcutils_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/external/libselinux/src
libselinux_SRC_FILES += booleans.c
libselinux_SRC_FILES += canonicalize_context.c
libselinux_SRC_FILES += disable.c
libselinux_SRC_FILES += enabled.c
libselinux_SRC_FILES += fgetfilecon.c
libselinux_SRC_FILES += fsetfilecon.c
libselinux_SRC_FILES += getenforce.c
libselinux_SRC_FILES += getfilecon.c
libselinux_SRC_FILES += getpeercon.c
libselinux_SRC_FILES += lgetfilecon.c
libselinux_SRC_FILES += load_policy.c
libselinux_SRC_FILES += lsetfilecon.c
libselinux_SRC_FILES += policyvers.c
libselinux_SRC_FILES += procattr.c
libselinux_SRC_FILES += setenforce.c
libselinux_SRC_FILES += setfilecon.c
libselinux_SRC_FILES += context.c
libselinux_SRC_FILES += mapping.c
libselinux_SRC_FILES += stringrep.c
libselinux_SRC_FILES += compute_create.c
libselinux_SRC_FILES += compute_av.c
libselinux_SRC_FILES += avc.c
libselinux_SRC_FILES += avc_internal.c
libselinux_SRC_FILES += avc_sidtab.c
libselinux_SRC_FILES += get_initial_context.c
libselinux_SRC_FILES += checkAccess.c
libselinux_SRC_FILES += sestatus.c
libselinux_SRC_FILES += deny_unknown.c
libselinux_SRC_FILES += callbacks.c
libselinux_SRC_FILES += check_context.c
libselinux_SRC_FILES += freecon.c
libselinux_SRC_FILES += init.c
libselinux_SRC_FILES += label.c
libselinux_SRC_FILES += label_file.c
libselinux_SRC_FILES += label_android_property.c
libselinux_OBJS := $(libselinux_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/extras/ext4_utils
libext4_utils_SRC_FILES += make_ext4fs.c
libext4_utils_SRC_FILES += ext4fixup.c
libext4_utils_SRC_FILES += ext4_utils.c
libext4_utils_SRC_FILES += allocate.c
libext4_utils_SRC_FILES += contents.c
libext4_utils_SRC_FILES += extent.c
libext4_utils_SRC_FILES += indirect.c
libext4_utils_SRC_FILES += uuid.c
libext4_utils_SRC_FILES += sha1.c
libext4_utils_SRC_FILES += wipe.c
libext4_utils_SRC_FILES += crc16.c
libext4_utils_SRC_FILES += ext4_sb.c
libext4_utils_OBJS := $(libext4_utils_SRC_FILES:.c=.o)
CFLAGS += -std=gnu11
CFLAGS += -DANDROID
CFLAGS += -DADB_HOST=0
CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
CFLAGS += -DALLOW_ADBD_ROOT=1
CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
CFLAGS += -DPROP_NAME_MAX=32
CFLAGS += -DPROP_VALUE_MAX=92
CFLAGS += -DAUDITD_LOG_TAG=1003
# CFLAGS += -DHOST
CFLAGS += -DANDROID_SMP=0
CFLAGS += -I$(SRCDIR)/system/core/adb
CFLAGS += -I$(SRCDIR)/system/core/include
CFLAGS += -I$(SRCDIR)/system/core/libsparse/include
CFLAGS += -I$(SRCDIR)/system/extras/ext4_utils
CFLAGS += -I$(SRCDIR)/system/core/fs_mgr/include
CFLAGS += -I$(SRCDIR)/hardware/libhardware/include
CFLAGS += -I$(SRCDIR)/external/libselinux/include
CFLAGS += -include $(SRCDIR)/build/core/combo/include/arch/$(android_arch)/AndroidConfig.h
LIBS += liblog.a libfs_mgr.a libcutils.a libselinux.a libext4_utils.a -lpthread -lbsd -lpcre -lresolv -lcrypto
all: adbd
adbd: liblog.a libfs_mgr.a libcutils.a libselinux.a libext4_utils.a $(adbd_OBJS)
$(CC) -o $@ $(LDFLAGS) $(adbd_OBJS) $(LIBS)
liblog.a: $(liblog_OBJS)
$(AR) rcs $@ $(liblog_OBJS)
libfs_mgr.a: $(fs_mgr_OBJS)
$(AR) rcs $@ $(fs_mgr_OBJS)
libcutils.a: $(libcutils_OBJS)
$(AR) rcs $@ $(libcutils_OBJS)
libselinux.a: $(libselinux_OBJS)
export CFLAGS="-DANDROID -DHOST"
$(AR) rcs $@ $(libselinux_OBJS)
libext4_utils.a: $(libext4_utils_OBJS)
$(AR) rcs $@ $(libext4_utils_OBJS)
clean:
$(RM) *.o *.a adbd

View File

@@ -0,0 +1,13 @@
[Unit]
Description=Android Debug Bridge
ConditionPathExists=/var/usb-debugging-enabled
Before=android-system.service
[Service]
Type=simple
Restart=on-failure
ExecStartPre=-/usr/bin/android-gadget-setup adb
ExecStart=/usr/bin/adbd
[Install]
WantedBy=basic.target

View File

@@ -0,0 +1,359 @@
From 82dce13ea7b5b31c63851bd67f66072413917e73 Mon Sep 17 00:00:00 2001
From: Chenxi Mao <maochenxi@eswin.com>
Date: Mon, 20 Apr 2020 15:32:40 +0800
Subject: [PATCH 1/1] Riscv: Add risc-v Android config header
---
.../arch/linux-riscv64/AndroidConfig.h | 340 ++++++++++++++++++
1 file changed, 340 insertions(+)
create mode 100644 core/combo/include/arch/linux-riscv64/AndroidConfig.h
diff --git a/core/combo/include/arch/linux-riscv64/AndroidConfig.h b/core/combo/include/arch/linux-riscv64/AndroidConfig.h
new file mode 100644
index 0000000000..bcbda8f87f
--- /dev/null
+++ b/core/combo/include/arch/linux-riscv64/AndroidConfig.h
@@ -0,0 +1,340 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Android config -- "android-aarch64". Used for ARM aarch64 device builds.
+ */
+#ifndef _ANDROID_CONFIG_H
+#define _ANDROID_CONFIG_H
+
+/*
+ * ===========================================================================
+ * !!! IMPORTANT !!!
+ * ===========================================================================
+ *
+ * This file is included by ALL C/C++ source files. Don't put anything in
+ * here unless you are absolutely certain it can't go anywhere else.
+ *
+ * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//"
+ * comments.
+ */
+
+/*
+ * Threading model. Choose one:
+ *
+ * HAVE_PTHREADS - use the pthreads library.
+ * HAVE_WIN32_THREADS - use Win32 thread primitives.
+ * -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX
+ */
+#define HAVE_PTHREADS
+
+/*
+ * Do we have pthread_setname_np()?
+ *
+ * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with
+ * the same name but different parameters, so we can't use that here.)
+ */
+#define HAVE_ANDROID_PTHREAD_SETNAME_NP
+
+/*
+ * Do we have the futex syscall?
+ */
+#define HAVE_FUTEX
+
+/*
+ * Process creation model. Choose one:
+ *
+ * HAVE_FORKEXEC - use fork() and exec()
+ * HAVE_WIN32_PROC - use CreateProcess()
+ */
+#define HAVE_FORKEXEC
+
+/*
+ * Process out-of-memory adjustment. Set if running on Linux,
+ * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory
+ * badness adjustment.
+ */
+#define HAVE_OOM_ADJ
+
+/*
+ * IPC model. Choose one:
+ *
+ * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget).
+ * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap).
+ * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping).
+ * HAVE_ANDROID_IPC - use Android versions (?, mmap).
+ */
+#define HAVE_ANDROID_IPC
+
+/*
+ * Memory-mapping model. Choose one:
+ *
+ * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h
+ * HAVE_WIN32_FILEMAP - use Win32 filemaps
+ */
+#define HAVE_POSIX_FILEMAP
+
+/*
+ * Define this if you have <termio.h>
+ */
+#define HAVE_TERMIO_H 1
+
+/*
+ * Define this if you have <sys/sendfile.h>
+ */
+#define HAVE_SYS_SENDFILE_H 1
+
+/*
+ * Define this if you build against MSVCRT.DLL
+ */
+/* #define HAVE_MS_C_RUNTIME */
+
+/*
+ * Define this if you have sys/uio.h
+ */
+#define HAVE_SYS_UIO_H 1
+
+/*
+ * Define this if your platforms implements symbolic links
+ * in its filesystems
+ */
+#define HAVE_SYMLINKS
+
+/*
+ * Define this if we have localtime_r().
+ */
+/* #define HAVE_LOCALTIME_R 1 */
+
+/*
+ * Define this if we have gethostbyname_r().
+ */
+/* #define HAVE_GETHOSTBYNAME_R */
+
+/*
+ * Define this if we have ioctl().
+ */
+#define HAVE_IOCTL
+
+/*
+ * Define this if we want to use WinSock.
+ */
+/* #define HAVE_WINSOCK */
+
+/*
+ * Define this if have clock_gettime() and friends
+ */
+#define HAVE_POSIX_CLOCKS
+
+/*
+ * Define this if we have linux style epoll()
+ */
+#define HAVE_EPOLL
+
+/*
+ * Endianness of the target machine. Choose one:
+ *
+ * HAVE_ENDIAN_H -- have endian.h header we can include.
+ * HAVE_LITTLE_ENDIAN -- we are little endian.
+ * HAVE_BIG_ENDIAN -- we are big endian.
+ */
+#define HAVE_ENDIAN_H
+#define HAVE_LITTLE_ENDIAN
+
+#define _FILE_OFFSET_BITS 64
+/* #define _LARGEFILE_SOURCE 1 */
+
+/*
+ * Define if platform has off64_t (and lseek64 and other xxx64 functions)
+ */
+#define HAVE_OFF64_T
+
+/*
+ * Defined if we have the backtrace() call for retrieving a stack trace.
+ * Needed for CallStack to operate; if not defined, CallStack is
+ * non-functional.
+ */
+#define HAVE_BACKTRACE 0
+
+/*
+ * Defined if we have the cxxabi.h header for demangling C++ symbols. If
+ * not defined, stack crawls will be displayed with raw mangled symbols
+ */
+#define HAVE_CXXABI 0
+
+/*
+ * Defined if we have the gettid() system call.
+ */
+#define HAVE_GETTID
+
+/*
+ * Defined if we have the sched_setscheduler() call
+ */
+#define HAVE_SCHED_SETSCHEDULER
+
+/*
+ * Add any extra platform-specific defines here.
+ */
+#ifndef __linux__
+#define __linux__
+#endif
+
+/*
+ * Define if we have <malloc.h> header
+ */
+#define HAVE_MALLOC_H
+
+/*
+ * Define if we're running on *our* linux on device or emulator.
+ */
+#define HAVE_ANDROID_OS 1
+
+/*
+ * Define if we have Linux-style non-filesystem Unix Domain Sockets
+ */
+#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1
+
+/*
+ * Define if we have Linux's inotify in <sys/inotify.h>.
+ */
+#define HAVE_INOTIFY 1
+
+/*
+ * Define if we have madvise() in <sys/mman.h>
+ */
+#define HAVE_MADVISE 1
+
+/*
+ * Define if tm struct has tm_gmtoff field
+ */
+#define HAVE_TM_GMTOFF 1
+
+/*
+ * Define if dirent struct has d_type field
+ */
+#define HAVE_DIRENT_D_TYPE 1
+
+/*
+ * Define if libc includes Android system properties implementation.
+ */
+#define HAVE_LIBC_SYSTEM_PROPERTIES 1
+
+/*
+ * Define if system provides a system property server (should be
+ * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
+ */
+/* #define HAVE_SYSTEM_PROPERTY_SERVER */
+
+/*
+ * What CPU architecture does this platform use?
+ */
+#define ARCH_AARCH64
+
+/*
+ * Define if the size of enums is as short as possible,
+ */
+/* #define HAVE_SHORT_ENUMS */
+
+/*
+ * sprintf() format string for shared library naming.
+ */
+#define OS_SHARED_LIB_FORMAT_STR "lib%s.so"
+
+/*
+ * type for the third argument to mincore().
+ */
+#define MINCORE_POINTER_TYPE unsigned char *
+
+/*
+ * The default path separator for the platform
+ */
+#define OS_PATH_SEPARATOR '/'
+
+/*
+ * Is the filesystem case sensitive?
+ */
+#define OS_CASE_SENSITIVE
+
+/*
+ * Define if <sys/socket.h> exists.
+ */
+#define HAVE_SYS_SOCKET_H 1
+
+/*
+ * Define if the strlcpy() function exists on the system.
+ */
+#define HAVE_STRLCPY 1
+
+/*
+ * Define if the open_memstream() function exists on the system.
+ */
+/* #define HAVE_OPEN_MEMSTREAM 1 */
+
+/*
+ * Define if the BSD funopen() function exists on the system.
+ */
+#define HAVE_FUNOPEN 1
+
+/*
+ * Define if prctl() exists
+ */
+#define HAVE_PRCTL 1
+
+/*
+ * Define if writev() exists
+ */
+#define HAVE_WRITEV 1
+
+/*
+ * Define if <stdint.h> exists.
+ */
+#define HAVE_STDINT_H 1
+
+/*
+ * Define if <stdbool.h> exists.
+ */
+#define HAVE_STDBOOL_H 1
+
+/*
+ * Define if <sched.h> exists.
+ */
+#define HAVE_SCHED_H 1
+
+/*
+ * Define if pread() exists
+ */
+#define HAVE_PREAD 1
+
+/*
+ * Define if we have st_mtim in struct stat
+ */
+#define HAVE_STAT_ST_MTIM 1
+
+/*
+ * Define if printf() supports %zd for size_t arguments
+ */
+#define HAVE_PRINTF_ZD 1
+
+/*
+ * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype.
+ */
+#define HAVE_BSD_QSORT_R 0
+
+/*
+ * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype.
+ */
+#define HAVE_GNU_QSORT_R 0
+
+#endif /* _ANDROID_CONFIG_H */
--
2.17.1

View File

@@ -0,0 +1,44 @@
From 7b7200727413ca4a9bb132221c543ec033dffafa Mon Sep 17 00:00:00 2001
From: Sergio Schvezov <sergio.schvezov@canonical.com>
Date: Wed, 7 Sep 2016 12:58:47 +0300
Subject: [PATCH] adb: remove selinux extensions
* drop useless includes of Android SELINUX extensions
* avoids having to clone another module
* this should be sent upstream
Upstream-Status: Inappropriate
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
adb/file_sync_service.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/adb/file_sync_service.c b/adb/file_sync_service.c
index 7933858516..3cbd0cd863 100644
--- a/adb/file_sync_service.c
+++ b/adb/file_sync_service.c
@@ -26,7 +26,6 @@
#include <errno.h>
#include <private/android_filesystem_config.h>
-#include <selinux/android.h>
#include "sysdeps.h"
#define TRACE_TAG TRACE_SYNC
@@ -73,7 +72,6 @@ static int mkdirs(char *name)
*x = '/';
return ret;
}
- selinux_android_restorecon(name, 0);
}
*x++ = '/';
}
@@ -251,7 +249,6 @@ static int handle_send_file(int s, char *path, uid_t uid,
if(fd >= 0) {
struct utimbuf u;
adb_close(fd);
- selinux_android_restorecon(path, 0);
u.actime = timestamp;
u.modtime = timestamp;
utime(path, &u);

View File

@@ -0,0 +1,35 @@
From db3a3714be07c8ab51b9ae7b035e4afe9f39c645 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 7 Sep 2022 13:20:22 -0700
Subject: [PATCH] memory.h: Always define strlcpy for glibc based systems
android-config.h file includes on compiler cmdline sets HAVE_STRLCPY
unconditionally, since bionic supports it, its no big deal on android
and also no problem when using musl since implementation exists for musl
too, but glibc does not provide this. So either we include libbsd or use
the implementation provided by android-tools here. We are currently
using the in tree implementation for systems which do not provide it
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
include/cutils/memory.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/cutils/memory.h b/include/cutils/memory.h
index e725cdd032..9e99353c58 100644
--- a/include/cutils/memory.h
+++ b/include/cutils/memory.h
@@ -30,7 +30,7 @@ void android_memset16(uint16_t* dst, uint16_t value, size_t size);
/* size is given in bytes and must be multiple of 4 */
void android_memset32(uint32_t* dst, uint32_t value, size_t size);
-#if !HAVE_STRLCPY
+#if !HAVE_STRLCPY || defined(__GLIBC__)
/* Declaration of strlcpy() for platforms that don't already have it. */
size_t strlcpy(char *dst, const char *src, size_t size);
#endif
--
2.37.3

View File

@@ -0,0 +1,70 @@
From d855f042ca09a358cebe2d3c1d29d512afd7ebb8 Mon Sep 17 00:00:00 2001
From: Hilko Bengen <bengen@debian.org>
Date: Wed, 7 Sep 2016 12:58:47 +0300
Subject: [PATCH] adb: Use local sockets where appropriate
Upstream-Status: Inappropriate
---
adb/adb.c | 6 +++++-
adb/adb_client.c | 5 +++--
adb/transport_local.c | 3 ++-
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/adb/adb.c b/adb/adb.c
index 10a1e0da26..027edd9359 100644
--- a/adb/adb.c
+++ b/adb/adb.c
@@ -1230,7 +1230,11 @@ int launch_server(int server_port)
*/
void build_local_name(char* target_str, size_t target_size, int server_port)
{
- snprintf(target_str, target_size, "tcp:%d", server_port);
+ if (gListenAll > 0) {
+ snprintf(target_str, target_size, "tcp:%d", server_port);
+ } else {
+ snprintf(target_str, target_size, "local:%d", server_port);
+ }
}
#if !ADB_HOST
diff --git a/adb/adb_client.c b/adb/adb_client.c
index eb1720d22c..a383faefe3 100644
--- a/adb/adb_client.c
+++ b/adb/adb_client.c
@@ -185,12 +185,12 @@ int _adb_connect(const char *service)
strcpy(__adb_error, "service name too long");
return -1;
}
- snprintf(tmp, sizeof tmp, "%04x", len);
+ snprintf(tmp, sizeof tmp, "%d", __adb_server_port);
if (__adb_server_name)
fd = socket_network_client(__adb_server_name, __adb_server_port, SOCK_STREAM);
else
- fd = socket_loopback_client(__adb_server_port, SOCK_STREAM);
+ fd = socket_local_client(tmp, ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_STREAM);
if(fd < 0) {
strcpy(__adb_error, "cannot connect to daemon");
@@ -201,6 +201,7 @@ int _adb_connect(const char *service)
return -1;
}
+ snprintf(tmp, sizeof tmp, "%04x", len);
if(writex(fd, tmp, 4) || writex(fd, service, len)) {
strcpy(__adb_error, "write failure during connection");
adb_close(fd);
diff --git a/adb/transport_local.c b/adb/transport_local.c
index 948cc15812..71582a8c88 100644
--- a/adb/transport_local.c
+++ b/adb/transport_local.c
@@ -121,7 +121,8 @@ int local_connect_arbitrary_ports(int console_port, int adb_port)
}
#endif
if (fd < 0) {
- fd = socket_loopback_client(adb_port, SOCK_STREAM);
+ snprintf(buf, sizeof buf, "%d", adb_port);
+ fd = socket_local_client(buf, ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_STREAM);
}
if (fd >= 0) {

View File

@@ -0,0 +1,29 @@
From 4421c2e19946dcd651fd8ac022b96627fc526149 Mon Sep 17 00:00:00 2001
From: Fathi Boudra <fabo@debian.org>
Date: Wed, 7 Sep 2016 12:58:47 +0300
Subject: [PATCH] adb: define shell command
we intend to run on Linux system so the shell is always /bin/sh,
for the host or the target.
Upstream-Status: Inappropriate
---
adb/services.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/adb/services.c b/adb/services.c
index 21b08dc201..d44b0c5068 100644
--- a/adb/services.c
+++ b/adb/services.c
@@ -299,11 +299,7 @@ static int create_subproc_raw(const char *cmd, const char *arg0, const char *arg
}
#endif /* !ABD_HOST */
-#if ADB_HOST
#define SHELL_COMMAND "/bin/sh"
-#else
-#define SHELL_COMMAND "/system/bin/sh"
-#endif
#if !ADB_HOST
static void subproc_waiter_service(int fd, void *cookie)

View File

@@ -0,0 +1,45 @@
From 548b8ca62c64a16305929e2eaf3d546d48de9c25 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Tue, 21 Feb 2017 19:46:24 +0100
Subject: [PATCH] adb: 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>
---
adb/usb_linux_client.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/adb/usb_linux_client.c b/adb/usb_linux_client.c
index 8426e0ea14..6e8b5bbbd2 100644
--- a/adb/usb_linux_client.c
+++ b/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
{

View File

@@ -0,0 +1,348 @@
From 753bcb5971401b82fb2e6197d31c9e386f6d0392 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 15 Sep 2017 15:46:38 -0700
Subject: [PATCH] adb: add base64 implementation
musl needs it
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
adb/adb_auth_client.c | 2 +-
adb/base64.c | 315 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 316 insertions(+), 1 deletion(-)
create mode 100644 adb/base64.c
diff --git a/adb/adb_auth_client.c b/adb/adb_auth_client.c
index 55e9dcad19..104b413b8b 100644
--- a/adb/adb_auth_client.c
+++ b/adb/adb_auth_client.c
@@ -75,7 +75,7 @@ static void read_keys(const char *file, struct listnode *list)
if (sep)
*sep = '\0';
- ret = __b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4);
+ ret = b64_pton(buf, (u_char *)&key->key, sizeof(key->key) + 4);
if (ret != sizeof(key->key)) {
D("%s: Invalid base64 data ret=%d\n", file, ret);
free(key);
diff --git a/adb/base64.c b/adb/base64.c
new file mode 100644
index 0000000000..95da284d0d
--- /dev/null
+++ b/adb/base64.c
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software. No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$BINDId: base64.c,v 8.7 1999/10/13 16:39:33 vixie Exp $";
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <resolv.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#define Assert(Cond) if (!(Cond)) abort()
+
+static const char Base64[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char Pad64 = '=';
+
+/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
+ The following encoding technique is taken from RFC 1521 by Borenstein
+ and Freed. It is reproduced here in a slightly edited form for
+ convenience.
+
+ A 65-character subset of US-ASCII is used, enabling 6 bits to be
+ represented per printable character. (The extra 65th character, "=",
+ is used to signify a special processing function.)
+
+ The encoding process represents 24-bit groups of input bits as output
+ strings of 4 encoded characters. Proceeding from left to right, a
+ 24-bit input group is formed by concatenating 3 8-bit input groups.
+ These 24 bits are then treated as 4 concatenated 6-bit groups, each
+ of which is translated into a single digit in the base64 alphabet.
+
+ Each 6-bit group is used as an index into an array of 64 printable
+ characters. The character referenced by the index is placed in the
+ output string.
+
+ Table 1: The Base64 Alphabet
+
+ Value Encoding Value Encoding Value Encoding Value Encoding
+ 0 A 17 R 34 i 51 z
+ 1 B 18 S 35 j 52 0
+ 2 C 19 T 36 k 53 1
+ 3 D 20 U 37 l 54 2
+ 4 E 21 V 38 m 55 3
+ 5 F 22 W 39 n 56 4
+ 6 G 23 X 40 o 57 5
+ 7 H 24 Y 41 p 58 6
+ 8 I 25 Z 42 q 59 7
+ 9 J 26 a 43 r 60 8
+ 10 K 27 b 44 s 61 9
+ 11 L 28 c 45 t 62 +
+ 12 M 29 d 46 u 63 /
+ 13 N 30 e 47 v
+ 14 O 31 f 48 w (pad) =
+ 15 P 32 g 49 x
+ 16 Q 33 h 50 y
+
+ Special processing is performed if fewer than 24 bits are available
+ at the end of the data being encoded. A full encoding quantum is
+ always completed at the end of a quantity. When fewer than 24 input
+ bits are available in an input group, zero bits are added (on the
+ right) to form an integral number of 6-bit groups. Padding at the
+ end of the data is performed using the '=' character.
+
+ Since all base64 input is an integral number of octets, only the
+ -------------------------------------------------
+ following cases can arise:
+
+ (1) the final quantum of encoding input is an integral
+ multiple of 24 bits; here, the final unit of encoded
+ output will be an integral multiple of 4 characters
+ with no "=" padding,
+ (2) the final quantum of encoding input is exactly 8 bits;
+ here, the final unit of encoded output will be two
+ characters followed by two "=" padding characters, or
+ (3) the final quantum of encoding input is exactly 16 bits;
+ here, the final unit of encoded output will be three
+ characters followed by one "=" padding character.
+ */
+
+int
+b64_ntop(const uint8_t* src, size_t srclength, char* target, size_t targsize)
+{
+ size_t datalength = 0;
+ uint8_t input[3];
+ uint8_t output[4];
+ size_t i;
+
+ while (2 < srclength) {
+ input[0] = *src++;
+ input[1] = *src++;
+ input[2] = *src++;
+ srclength -= 3;
+
+ output[0] = input[0] >> 2;
+ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+ output[3] = input[2] & 0x3f;
+ Assert(output[0] < 64);
+ Assert(output[1] < 64);
+ Assert(output[2] < 64);
+ Assert(output[3] < 64);
+
+ if (datalength + 4 > targsize)
+ return (-1);
+ target[datalength++] = Base64[output[0]];
+ target[datalength++] = Base64[output[1]];
+ target[datalength++] = Base64[output[2]];
+ target[datalength++] = Base64[output[3]];
+ }
+
+ /* Now we worry about padding. */
+ if (0 != srclength) {
+ /* Get what's left. */
+ input[0] = input[1] = input[2] = '\0';
+ for (i = 0; i < srclength; i++)
+ input[i] = *src++;
+
+ output[0] = input[0] >> 2;
+ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+ Assert(output[0] < 64);
+ Assert(output[1] < 64);
+ Assert(output[2] < 64);
+
+ if (datalength + 4 > targsize)
+ return (-1);
+ target[datalength++] = Base64[output[0]];
+ target[datalength++] = Base64[output[1]];
+ if (srclength == 1)
+ target[datalength++] = Pad64;
+ else
+ target[datalength++] = Base64[output[2]];
+ target[datalength++] = Pad64;
+ }
+ if (datalength >= targsize)
+ return (-1);
+ target[datalength] = '\0'; /* Returned value doesn't count \0. */
+ return (datalength);
+}
+
+/* skips all whitespace anywhere.
+ converts characters, four at a time, starting at (or after)
+ src from base - 64 numbers into three 8 bit bytes in the target area.
+ it returns the number of data bytes stored at the target, or -1 on error.
+ */
+
+int b64_pton(const char* src, uint8_t* target, size_t targsize)
+{
+ int tarindex, state, ch;
+ char *pos;
+
+ state = 0;
+ tarindex = 0;
+
+ while ((ch = *src++) != '\0') {
+ if (isspace(ch)) /* Skip whitespace anywhere. */
+ continue;
+
+ if (ch == Pad64)
+ break;
+
+ pos = strchr(Base64, ch);
+ if (pos == 0) /* A non-base64 character. */
+ return (-1);
+
+ switch (state) {
+ case 0:
+ if (target) {
+ if ((size_t)tarindex >= targsize)
+ return (-1);
+ target[tarindex] = (pos - Base64) << 2;
+ }
+ state = 1;
+ break;
+ case 1:
+ if (target) {
+ if ((size_t)tarindex + 1 >= targsize)
+ return (-1);
+ target[tarindex] |= (pos - Base64) >> 4;
+ target[tarindex+1] = ((pos - Base64) & 0x0f)
+ << 4 ;
+ }
+ tarindex++;
+ state = 2;
+ break;
+ case 2:
+ if (target) {
+ if ((size_t)tarindex + 1 >= targsize)
+ return (-1);
+ target[tarindex] |= (pos - Base64) >> 2;
+ target[tarindex+1] = ((pos - Base64) & 0x03)
+ << 6;
+ }
+ tarindex++;
+ state = 3;
+ break;
+ case 3:
+ if (target) {
+ if ((size_t)tarindex >= targsize)
+ return (-1);
+ target[tarindex] |= (pos - Base64);
+ }
+ tarindex++;
+ state = 0;
+ break;
+ default:
+ abort();
+ }
+ }
+
+ /*
+ * We are done decoding Base-64 chars. Let's see if we ended
+ * on a byte boundary, and/or with erroneous trailing characters.
+ */
+
+ if (ch == Pad64) { /* We got a pad char. */
+ ch = *src++; /* Skip it, get next. */
+ switch (state) {
+ case 0: /* Invalid = in first position */
+ case 1: /* Invalid = in second position */
+ return (-1);
+
+ case 2: /* Valid, means one byte of info */
+ /* Skip any number of spaces. */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (!isspace(ch))
+ break;
+ /* Make sure there is another trailing = sign. */
+ if (ch != Pad64)
+ return (-1);
+ ch = *src++; /* Skip the = */
+ /* Fall through to "single trailing =" case. */
+ /* FALLTHROUGH */
+
+ case 3: /* Valid, means two bytes of info */
+ /*
+ * We know this char is an =. Is there anything but
+ * whitespace after it?
+ */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (!isspace(ch))
+ return (-1);
+
+ /*
+ * Now make sure for cases 2 and 3 that the "extra"
+ * bits that slopped past the last full byte were
+ * zeros. If we don't check them, they become a
+ * subliminal channel.
+ */
+ if (target && target[tarindex] != 0)
+ return (-1);
+ }
+ } else {
+ /*
+ * We ended by seeing the end of the string. Make sure we
+ * have no partial bytes lying around.
+ */
+ if (state != 0)
+ return (-1);
+ }
+
+ return (tarindex);
+}
+

View File

@@ -0,0 +1,128 @@
From 62d957a1271c88ec08d67984fbe31601f0bd41a9 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 15 Sep 2017 15:50:57 -0700
Subject: [PATCH] adb: Musl fixes
__nonnull is gcc specific
include sys/types.h for size_t
Do not redefine close() and lseek()
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
adb/adb.h | 2 ++
adb/disable_verity_service.c | 13 ++++++++-----
adb/framebuffer_service.c | 7 ++++---
adb/sysdeps.h | 12 ++++++------
4 files changed, 20 insertions(+), 14 deletions(-)
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -18,7 +18,9 @@
#define __ADB_H
#include <limits.h>
+#include <sys/types.h>
+#include "fdevent.h"
#include "adb_trace.h"
#include "transport.h" /* readx(), writex() */
--- a/adb/disable_verity_service.c
+++ b/adb/disable_verity_service.c
@@ -14,25 +14,32 @@
* limitations under the License.
*/
-#include "sysdeps.h"
#define TRACE_TAG TRACE_ADB
#include "adb.h"
+#include "sysdeps.h"
+#include "cutils/properties.h"
+#include "ext4_sb.h"
+#include <fs_mgr.h>
#include <stdio.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <inttypes.h>
-
-#include "cutils/properties.h"
-#include "ext4_sb.h"
-#include <fs_mgr.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdbool.h>
+
+#if defined(__linux__) && !defined(__GLIBC__)
+#define lseek64 lseek
+#define off64_t off_t
+#endif
#define FSTAB_PREFIX "/fstab."
struct fstab *fstab;
-__attribute__((__format__(printf, 2, 3))) __nonnull((2))
+__attribute__((__format__(printf, 2, 3))) __attribute__((nonnull((2))))
static void write_console(int fd, const char* format, ...)
{
char buffer[256];
--- a/adb/framebuffer_service.c
+++ b/adb/framebuffer_service.c
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+#include "fdevent.h"
+#include "adb.h"
+#include "sysdeps.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -23,9 +27,6 @@
#include <sys/types.h>
#include <sys/wait.h>
-#include "fdevent.h"
-#include "adb.h"
-
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
--- a/adb/sysdeps.h
+++ b/adb/sysdeps.h
@@ -123,8 +123,8 @@ static __inline__ int unix_close(int fd
{
return close(fd);
}
-#undef close
-#define close ____xxx_close
+//#undef close
+//#define close ____xxx_close
static __inline__ int unix_read(int fd, void* buf, size_t len)
{
@@ -369,8 +369,8 @@ static __inline__ int adb_close(int fd)
{
return close(fd);
}
-#undef close
-#define close ____xxx_close
+//#undef close
+//#define close ____xxx_close
static __inline__ int adb_read(int fd, void* buf, size_t len)
@@ -392,8 +392,8 @@ static __inline__ int adb_lseek(int f
{
return lseek(fd, pos, where);
}
-#undef lseek
-#define lseek ___xxx_lseek
+//#undef lseek
+//#define lseek ___xxx_lseek
static __inline__ int adb_unlink(const char* path)
{

View File

@@ -0,0 +1,24 @@
From de393bba41c8feff932c77d6c30233945f380d42 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Sat, 11 Aug 2018 13:23:37 +0000
Subject: [PATCH] adb: usb_linux.c: fix build with glibc-2.28
* include sysmacros for major, minor
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
adb/usb_linux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/adb/usb_linux.c b/adb/usb_linux.c
index f16bdd0361..c8a7732441 100644
--- a/adb/usb_linux.c
+++ b/adb/usb_linux.c
@@ -22,6 +22,7 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/time.h>
+#include <sys/sysmacros.h>
#include <dirent.h>
#include <fcntl.h>
#include <errno.h>

View File

@@ -0,0 +1,21 @@
From 3a788e9168c9b9eac66c4fa479413f4a95c61be4 Mon Sep 17 00:00:00 2001
From: Florent Revest <revestflo@gmail.com>
Date: Mon, 30 Oct 2017 21:05:46 +0100
Subject: [PATCH] adb: Allow adbd to be ran as root
---
adb/adb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/adb/adb.c b/adb/adb.c
index 027edd9359..e0f7ecde45 100644
--- a/adb/adb.c
+++ b/adb/adb.c
@@ -1271,6 +1271,7 @@ static int should_drop_privileges() {
int secure = 0;
char value[PROPERTY_VALUE_MAX];
+ return 0;
/* run adbd in secure mode if ro.secure is set and
** we are not in the emulator
*/

View File

@@ -0,0 +1,110 @@
From dd195778a9930b7967b21a3b8eb390b70253dbad Mon Sep 17 00:00:00 2001
From: David Ng <dave@codeaurora.org>
Date: Fri, 27 Jul 2012 17:15:03 -0700
Subject: [PATCH] mkbootimg: Add --dt parameter to specify DT image
New optional --dt parameter to specify a kernel device
tree image.
Upstream-Status: Inappropriate
---
mkbootimg/bootimg.h | 7 +++++--
mkbootimg/mkbootimg.c | 21 +++++++++++++++++++++
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/mkbootimg/bootimg.h b/mkbootimg/bootimg.h
index 9171d85a7b..308c537d6b 100644
--- a/mkbootimg/bootimg.h
+++ b/mkbootimg/bootimg.h
@@ -41,8 +41,8 @@ struct boot_img_hdr
unsigned tags_addr; /* physical addr for kernel tags */
unsigned page_size; /* flash page size we assume */
- unsigned unused[2]; /* future expansion: should be 0 */
-
+ unsigned dt_size; /* device tree in bytes */
+ unsigned unused; /* future expansion: should be 0 */
unsigned char name[BOOT_NAME_SIZE]; /* asciiz product name */
unsigned char cmdline[BOOT_ARGS_SIZE];
@@ -64,10 +64,13 @@ struct boot_img_hdr
** +-----------------+
** | second stage | o pages
** +-----------------+
+** | device tree | p pages
+** +-----------------+
**
** n = (kernel_size + page_size - 1) / page_size
** m = (ramdisk_size + page_size - 1) / page_size
** o = (second_size + page_size - 1) / page_size
+** p = (dt_size + page_size - 1) / page_size
**
** 0. all entities are page_size aligned in flash
** 1. kernel and ramdisk are required (size != 0)
diff --git a/mkbootimg/mkbootimg.c b/mkbootimg/mkbootimg.c
index fc92b4dc30..658052cdf2 100644
--- a/mkbootimg/mkbootimg.c
+++ b/mkbootimg/mkbootimg.c
@@ -65,6 +65,7 @@ int usage(void)
" [ --board <boardname> ]\n"
" [ --base <address> ]\n"
" [ --pagesize <pagesize> ]\n"
+ " [ --dt <filename> ]\n"
" -o|--output <filename>\n"
);
return 1;
@@ -105,6 +106,8 @@ int main(int argc, char **argv)
char *cmdline = "";
char *bootimg = 0;
char *board = "";
+ char *dt_fn = 0;
+ void *dt_data = 0;
unsigned pagesize = 2048;
int fd;
SHA_CTX ctx;
@@ -158,6 +161,8 @@ int main(int argc, char **argv)
fprintf(stderr,"error: unsupported page size %d\n", pagesize);
return -1;
}
+ } else if(!strcmp(arg, "--dt")) {
+ dt_fn = val;
} else {
return usage();
}
@@ -232,6 +237,14 @@ int main(int argc, char **argv)
}
}
+ if(dt_fn) {
+ dt_data = load_file(dt_fn, &hdr.dt_size);
+ if (dt_data == 0) {
+ fprintf(stderr,"error: could not load device tree image '%s'\n", dt_fn);
+ return 1;
+ }
+ }
+
/* put a hash of the contents in the header so boot images can be
* differentiated based on their first 2k.
*/
@@ -242,6 +255,10 @@ int main(int argc, char **argv)
SHA_update(&ctx, &hdr.ramdisk_size, sizeof(hdr.ramdisk_size));
SHA_update(&ctx, second_data, hdr.second_size);
SHA_update(&ctx, &hdr.second_size, sizeof(hdr.second_size));
+ if(dt_data) {
+ SHA_update(&ctx, dt_data, hdr.dt_size);
+ SHA_update(&ctx, &hdr.dt_size, sizeof(hdr.dt_size));
+ }
sha = SHA_final(&ctx);
memcpy(hdr.id, sha,
SHA_DIGEST_SIZE > sizeof(hdr.id) ? sizeof(hdr.id) : SHA_DIGEST_SIZE);
@@ -266,6 +283,10 @@ int main(int argc, char **argv)
if(write_padding(fd, pagesize, hdr.second_size)) goto fail;
}
+ if(dt_data) {
+ if(write(fd, dt_data, hdr.dt_size) != (ssize_t) hdr.dt_size) goto fail;
+ if(write_padding(fd, pagesize, hdr.dt_size)) goto fail;
+ }
return 0;
fail:

View File

@@ -0,0 +1,23 @@
From ef743c9c3c7452ae904a5c343ee2b759ab3a87cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Minier?= <loic.minier@ubuntu.com>
Date: Wed, 7 Sep 2016 12:58:47 +0300
Subject: [PATCH] Use linux/capability.h on linux systems too
Upstream-Status: Inappropriate
---
include/private/android_filesystem_config.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h
index 2f528b95c8..3e0b00928e 100644
--- a/include/private/android_filesystem_config.h
+++ b/include/private/android_filesystem_config.h
@@ -27,7 +27,7 @@
#include <sys/types.h>
#include <stdint.h>
-#ifdef HAVE_ANDROID_OS
+#if defined(HAVE_ANDROID_OS) || defined(__linux__)
#include <linux/capability.h>
#else
#include "android_filesystem_capability.h"

View File

@@ -0,0 +1,64 @@
From 9eff8799831961c0edf6e37e5d4cbf43baa7c748 Mon Sep 17 00:00:00 2001
From: Fathi Boudra <fabo@debian.org>
Date: Wed, 7 Sep 2016 12:58:47 +0300
Subject: [PATCH] Remove bionic specific calls
Upstream-Status: Inappropriate
---
include/cutils/properties.h | 1 -
libcutils/properties.c | 2 +-
liblog/logd_write.c | 5 +++++
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/cutils/properties.h b/include/cutils/properties.h
index 798db8b36f..7d01f28d6e 100644
--- a/include/cutils/properties.h
+++ b/include/cutils/properties.h
@@ -19,7 +19,6 @@
#include <sys/cdefs.h>
#include <stddef.h>
-#include <sys/system_properties.h>
#include <stdint.h>
#ifdef __cplusplus
diff --git a/libcutils/properties.c b/libcutils/properties.c
index b283658aa4..4151e7882c 100644
--- a/libcutils/properties.c
+++ b/libcutils/properties.c
@@ -104,10 +104,10 @@ int32_t property_get_int32(const char *key, int32_t default_value) {
return (int32_t)property_get_imax(key, INT32_MIN, INT32_MAX, default_value);
}
+#undef HAVE_LIBC_SYSTEM_PROPERTIES
#ifdef HAVE_LIBC_SYSTEM_PROPERTIES
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-#include <sys/_system_properties.h>
int property_set(const char *key, const char *value)
{
diff --git a/liblog/logd_write.c b/liblog/logd_write.c
index b2668cedb7..f5a44fe901 100644
--- a/liblog/logd_write.c
+++ b/liblog/logd_write.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/syscall.h>
#include <sys/types.h>
#if (FAKE_LOG_DEVICE == 0)
#include <sys/socket.h>
@@ -205,7 +206,11 @@ static int __write_to_log_kernel(log_id_t log_id, struct iovec *vec, size_t nr)
realtime_ts.tv_nsec = ts.tv_nsec;
log_id_buf = log_id;
+#ifdef __BIONIC__
tid = gettid();
+#else
+ tid = (pid_t) syscall(__NR_gettid);
+#endif
newVec[0].iov_base = (unsigned char *) &log_id_buf;
newVec[0].iov_len = sizeof_log_id_t;

View File

@@ -0,0 +1,50 @@
From cd4525d760c6f88c9bf85f7bf488da79cd0d3264 Mon Sep 17 00:00:00 2001
From: Fathi Boudra <fabo@debian.org>
Date: Wed, 7 Sep 2016 12:58:47 +0300
Subject: [PATCH] Fix implicit declaration of stlcat/strlcopy functions
Upstream-Status: Inappropriate
---
adb/adb.c | 1 +
fs_mgr/fs_mgr_fstab.c | 2 +-
include/cutils/sockets.h | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/adb/adb.c b/adb/adb.c
index e0f7ecde45..aaefd9b401 100644
--- a/adb/adb.c
+++ b/adb/adb.c
@@ -41,6 +41,7 @@
#include <sys/prctl.h>
#include <getopt.h>
#include <selinux/selinux.h>
+#include <grp.h>
#else
#include "usb_vendors.h"
#endif
diff --git a/fs_mgr/fs_mgr_fstab.c b/fs_mgr/fs_mgr_fstab.c
index edd9591164..9ddb4643b5 100644
--- a/fs_mgr/fs_mgr_fstab.c
+++ b/fs_mgr/fs_mgr_fstab.c
@@ -17,7 +17,7 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <bsd/string.h>
#include <sys/mount.h>
#include "fs_mgr_priv.h"
diff --git a/include/cutils/sockets.h b/include/cutils/sockets.h
index daf43ec944..d3270c69e7 100644
--- a/include/cutils/sockets.h
+++ b/include/cutils/sockets.h
@@ -19,7 +19,7 @@
#include <errno.h>
#include <stdlib.h>
-#include <string.h>
+#include <bsd/string.h>
#include <stdbool.h>
#ifdef HAVE_WINSOCK

View File

@@ -0,0 +1,189 @@
From 48ddf4fb999931942c359350fb31cd557514e1c6 Mon Sep 17 00:00:00 2001
From: Chenxi Mao <maochenxi@eswin.com>
Date: Mon, 20 Apr 2020 15:27:22 +0800
Subject: [PATCH 1/1] adb: Support riscv64
---
include/cutils/atomic-inline.h | 2 +
include/cutils/atomic-riscv64.h | 156 ++++++++++++++++++++++++++++++++
2 files changed, 158 insertions(+)
create mode 100644 include/cutils/atomic-riscv64.h
diff --git a/include/cutils/atomic-inline.h b/include/cutils/atomic-inline.h
index a31e913579..b5dc38209c 100644
--- a/include/cutils/atomic-inline.h
+++ b/include/cutils/atomic-inline.h
@@ -55,6 +55,8 @@ extern "C" {
#include <cutils/atomic-mips64.h>
#elif defined(__mips__)
#include <cutils/atomic-mips.h>
+#elif defined(__riscv) && __riscv_xlen == 64
+#include <cutils/atomic-riscv64.h>
#else
#error atomic operations are unsupported
#endif
diff --git a/include/cutils/atomic-riscv64.h b/include/cutils/atomic-riscv64.h
new file mode 100644
index 0000000000..2664db5a86
--- /dev/null
+++ b/include/cutils/atomic-riscv64.h
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef ANDROID_CUTILS_ATOMIC_RISCV64_H
+#define ANDROID_CUTILS_ATOMIC_RISCV64_H
+
+#include <stdint.h>
+
+#ifndef ANDROID_ATOMIC_INLINE
+#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline))
+#endif
+
+/*
+ TODOAArch64: Revisit the below functions and check for potential
+ optimizations using assembly code or otherwise.
+*/
+
+extern ANDROID_ATOMIC_INLINE
+void android_compiler_barrier(void)
+{
+ __asm__ __volatile__ ("" : : : "memory");
+}
+
+extern ANDROID_ATOMIC_INLINE
+void android_memory_barrier(void)
+{
+ __asm__ __volatile__ ("fence rw,rw" : : : "memory");
+}
+
+extern ANDROID_ATOMIC_INLINE
+int32_t android_atomic_acquire_load(volatile const int32_t *ptr)
+{
+ int32_t value = *ptr;
+ android_memory_barrier();
+ return value;
+}
+
+extern ANDROID_ATOMIC_INLINE
+int32_t android_atomic_release_load(volatile const int32_t *ptr)
+{
+ android_memory_barrier();
+ return *ptr;
+}
+
+extern ANDROID_ATOMIC_INLINE
+void android_atomic_acquire_store(int32_t value, volatile int32_t *ptr)
+{
+ *ptr = value;
+ android_memory_barrier();
+}
+
+extern ANDROID_ATOMIC_INLINE
+void android_atomic_release_store(int32_t value, volatile int32_t *ptr)
+{
+ android_memory_barrier();
+ *ptr = value;
+}
+
+extern ANDROID_ATOMIC_INLINE
+int android_atomic_cas(int32_t old_value, int32_t new_value,
+ volatile int32_t *ptr)
+{
+ return __sync_val_compare_and_swap(ptr, old_value, new_value) != old_value;
+}
+
+extern ANDROID_ATOMIC_INLINE
+int android_atomic_acquire_cas(int32_t old_value, int32_t new_value,
+ volatile int32_t *ptr)
+{
+ int status = android_atomic_cas(old_value, new_value, ptr);
+ android_memory_barrier();
+ return status;
+}
+
+extern ANDROID_ATOMIC_INLINE
+int android_atomic_release_cas(int32_t old_value, int32_t new_value,
+ volatile int32_t *ptr)
+{
+ android_memory_barrier();
+ return android_atomic_cas(old_value, new_value, ptr);
+}
+
+extern ANDROID_ATOMIC_INLINE
+int32_t android_atomic_add(int32_t increment, volatile int32_t *ptr)
+{
+ int32_t prev, status;
+ android_memory_barrier();
+ do {
+ prev = *ptr;
+ status = android_atomic_cas(prev, prev + increment, ptr);
+ } while (__builtin_expect(status != 0, 0));
+ return prev;
+}
+
+extern ANDROID_ATOMIC_INLINE
+int32_t android_atomic_inc(volatile int32_t *addr)
+{
+ return android_atomic_add(1, addr);
+}
+
+extern ANDROID_ATOMIC_INLINE
+int32_t android_atomic_dec(volatile int32_t *addr)
+{
+ return android_atomic_add(-1, addr);
+}
+
+extern ANDROID_ATOMIC_INLINE
+int32_t android_atomic_and(int32_t value, volatile int32_t *ptr)
+{
+ int32_t prev, status;
+ android_memory_barrier();
+ do {
+ prev = *ptr;
+ status = android_atomic_cas(prev, prev & value, ptr);
+ } while (__builtin_expect(status != 0, 0));
+ return prev;
+}
+
+extern ANDROID_ATOMIC_INLINE
+int32_t android_atomic_or(int32_t value, volatile int32_t *ptr)
+{
+ int32_t prev, status;
+ android_memory_barrier();
+ do {
+ prev = *ptr;
+ status = android_atomic_cas(prev, prev | value, ptr);
+ } while (__builtin_expect(status != 0, 0));
+ return prev;
+}
+
+#endif /* ANDROID_CUTILS_ATOMIC_RISCV_H */
--
2.17.1

View File

@@ -0,0 +1,342 @@
From dae9a11f3a158357966399aef97c48b5f16934d9 Mon Sep 17 00:00:00 2001
From: Jiacheng Liu <jiacheng.liu@mediatek.com>
Date: Sat, 24 Jul 2021 11:01:18 +0800
Subject: [PATCH] android-tools: adb: add u3 ss descriptor support
Porting u3 Superspeed descriptor support to open-embedded android-tools package.
This patch origins from the the patch in android project [1], but has been
modified for backporting to android-tools_5.1.1.r37.
[1] https://android.googlesource.com/platform/system/core/+/d6ee9f26a5163af4121f4380264fcbd4e6851a17%5E%21
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Signed-off-by: Jiacheng Liu <jiacheng.liu@mediatek.com>
---
adb/usb_linux_client.c | 275 +++++++++++++++++++++++++++++++----------
1 file changed, 207 insertions(+), 68 deletions(-)
diff --git a/adb/usb_linux_client.c b/adb/usb_linux_client.c
index 6e8b5bb..884e85e 100644
--- a/adb/usb_linux_client.c
+++ b/adb/usb_linux_client.c
@@ -31,8 +31,10 @@
#define TRACE_TAG TRACE_USB
#include "adb.h"
+#define USB_EXT_PROP_UNICODE 1
#define MAX_PACKET_SIZE_FS 64
#define MAX_PACKET_SIZE_HS 512
+#define MAX_PACKET_SIZE_SS 1024
#if __BYTE_ORDER == __LITTLE_ENDIAN
# define cpu_to_le16(x) (x)
@@ -62,74 +64,185 @@ struct usb_handle
int bulk_in; /* "in" from the host's perspective => sink for adbd */
};
-static const struct {
- struct usb_functionfs_descs_head header;
- struct {
- struct usb_interface_descriptor intf;
- struct usb_endpoint_descriptor_no_audio source;
- struct usb_endpoint_descriptor_no_audio sink;
- } __attribute__((packed)) fs_descs, hs_descs;
-} __attribute__((packed)) descriptors = {
- .header = {
- .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC),
- .length = cpu_to_le32(sizeof(descriptors)),
- .fs_count = 3,
- .hs_count = 3,
+struct func_desc {
+ struct usb_interface_descriptor intf;
+ struct usb_endpoint_descriptor_no_audio source;
+ struct usb_endpoint_descriptor_no_audio sink;
+} __attribute__((packed));
+
+struct ss_func_desc {
+ struct usb_interface_descriptor intf;
+ struct usb_endpoint_descriptor_no_audio source;
+ struct usb_ss_ep_comp_descriptor source_comp;
+ struct usb_endpoint_descriptor_no_audio sink;
+ struct usb_ss_ep_comp_descriptor sink_comp;
+} __attribute__((packed));
+
+struct desc_v1 {
+ struct usb_functionfs_descs_head_v1 {
+ __le32 magic;
+ __le32 length;
+ __le32 fs_count;
+ __le32 hs_count;
+ } __attribute__((packed)) header;
+ struct func_desc fs_descs, hs_descs;
+} __attribute__((packed));
+
+struct usb_os_desc_ext_prop {
+ uint32_t dwSize;
+ uint32_t dwPropertyDataType;
+
+ // Property name and value are transmitted as UTF-16, but the kernel only
+ // accepts ASCII values and performs the conversion for us.
+ uint16_t wPropertyNameLength;
+ char bPropertyName[20];
+
+ uint32_t dwPropertyDataLength;
+ char bProperty[39];
+} __attribute__((packed)) os_desc_guid = {
+ .dwSize = sizeof(struct usb_os_desc_ext_prop),
+ .dwPropertyDataType = cpu_to_le32(USB_EXT_PROP_UNICODE),
+ .wPropertyNameLength = cpu_to_le16(20),
+ .bPropertyName = "DeviceInterfaceGUID",
+ .dwPropertyDataLength = cpu_to_le32(39),
+ .bProperty = "{F72FE0D4-CBCB-407D-8814-9ED673D0DD6B}",
+};
+
+struct usb_ext_prop_values {
+ struct usb_os_desc_ext_prop guid;
+} __attribute__((packed));
+
+struct desc_v2 {
+ struct usb_functionfs_descs_head_v2 header;
+ // The rest of the structure depends on the flags in the header.
+ __le32 fs_count;
+ __le32 hs_count;
+ __le32 ss_count;
+ __le32 os_count;
+ struct func_desc fs_descs, hs_descs;
+ struct ss_func_desc ss_descs;
+ struct usb_os_desc_header os_header;
+ struct usb_ext_compat_desc os_desc;
+ struct usb_os_desc_header os_prop_header;
+ struct usb_ext_prop_values os_prop_values;
+} __attribute__((packed));
+
+static struct func_desc fs_descriptors = {
+ .intf = {
+ .bLength = sizeof(fs_descriptors.intf),
+ .bDescriptorType = USB_DT_INTERFACE,
+ .bInterfaceNumber = 0,
+ .bNumEndpoints = 2,
+ .bInterfaceClass = ADB_CLASS,
+ .bInterfaceSubClass = ADB_SUBCLASS,
+ .bInterfaceProtocol = ADB_PROTOCOL,
+ .iInterface = 1, /* first string from the provided table */
+ },
+ .source = {
+ .bLength = sizeof(fs_descriptors.source),
+ .bDescriptorType = USB_DT_ENDPOINT,
+ .bEndpointAddress = 1 | USB_DIR_OUT,
+ .bmAttributes = USB_ENDPOINT_XFER_BULK,
+ .wMaxPacketSize = MAX_PACKET_SIZE_FS,
+ },
+ .sink = {
+ .bLength = sizeof(fs_descriptors.sink),
+ .bDescriptorType = USB_DT_ENDPOINT,
+ .bEndpointAddress = 2 | USB_DIR_IN,
+ .bmAttributes = USB_ENDPOINT_XFER_BULK,
+ .wMaxPacketSize = MAX_PACKET_SIZE_FS,
+ },
+};
+
+static struct func_desc hs_descriptors = {
+ .intf = {
+ .bLength = sizeof(hs_descriptors.intf),
+ .bDescriptorType = USB_DT_INTERFACE,
+ .bInterfaceNumber = 0,
+ .bNumEndpoints = 2,
+ .bInterfaceClass = ADB_CLASS,
+ .bInterfaceSubClass = ADB_SUBCLASS,
+ .bInterfaceProtocol = ADB_PROTOCOL,
+ .iInterface = 1, /* first string from the provided table */
+ },
+ .source = {
+ .bLength = sizeof(hs_descriptors.source),
+ .bDescriptorType = USB_DT_ENDPOINT,
+ .bEndpointAddress = 1 | USB_DIR_OUT,
+ .bmAttributes = USB_ENDPOINT_XFER_BULK,
+ .wMaxPacketSize = MAX_PACKET_SIZE_HS,
+ },
+ .sink = {
+ .bLength = sizeof(hs_descriptors.sink),
+ .bDescriptorType = USB_DT_ENDPOINT,
+ .bEndpointAddress = 2 | USB_DIR_IN,
+ .bmAttributes = USB_ENDPOINT_XFER_BULK,
+ .wMaxPacketSize = MAX_PACKET_SIZE_HS,
+ },
+};
+
+static struct ss_func_desc ss_descriptors = {
+ .intf = {
+ .bLength = sizeof(ss_descriptors.intf),
+ .bDescriptorType = USB_DT_INTERFACE,
+ .bInterfaceNumber = 0,
+ .bNumEndpoints = 2,
+ .bInterfaceClass = ADB_CLASS,
+ .bInterfaceSubClass = ADB_SUBCLASS,
+ .bInterfaceProtocol = ADB_PROTOCOL,
+ .iInterface = 1, /* first string from the provided table */
+ },
+ .source = {
+ .bLength = sizeof(ss_descriptors.source),
+ .bDescriptorType = USB_DT_ENDPOINT,
+ .bEndpointAddress = 1 | USB_DIR_OUT,
+ .bmAttributes = USB_ENDPOINT_XFER_BULK,
+ .wMaxPacketSize = MAX_PACKET_SIZE_SS,
+ },
+ .source_comp = {
+ .bLength = sizeof(ss_descriptors.source_comp),
+ .bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
+ .bMaxBurst = 4,
},
- .fs_descs = {
- .intf = {
- .bLength = sizeof(descriptors.fs_descs.intf),
- .bDescriptorType = USB_DT_INTERFACE,
- .bInterfaceNumber = 0,
- .bNumEndpoints = 2,
- .bInterfaceClass = ADB_CLASS,
- .bInterfaceSubClass = ADB_SUBCLASS,
- .bInterfaceProtocol = ADB_PROTOCOL,
- .iInterface = 1, /* first string from the provided table */
- },
- .source = {
- .bLength = sizeof(descriptors.fs_descs.source),
- .bDescriptorType = USB_DT_ENDPOINT,
- .bEndpointAddress = 1 | USB_DIR_OUT,
- .bmAttributes = USB_ENDPOINT_XFER_BULK,
- .wMaxPacketSize = MAX_PACKET_SIZE_FS,
- },
- .sink = {
- .bLength = sizeof(descriptors.fs_descs.sink),
- .bDescriptorType = USB_DT_ENDPOINT,
- .bEndpointAddress = 2 | USB_DIR_IN,
- .bmAttributes = USB_ENDPOINT_XFER_BULK,
- .wMaxPacketSize = MAX_PACKET_SIZE_FS,
- },
+ .sink = {
+ .bLength = sizeof(ss_descriptors.sink),
+ .bDescriptorType = USB_DT_ENDPOINT,
+ .bEndpointAddress = 2 | USB_DIR_IN,
+ .bmAttributes = USB_ENDPOINT_XFER_BULK,
+ .wMaxPacketSize = MAX_PACKET_SIZE_SS,
},
- .hs_descs = {
- .intf = {
- .bLength = sizeof(descriptors.hs_descs.intf),
- .bDescriptorType = USB_DT_INTERFACE,
- .bInterfaceNumber = 0,
- .bNumEndpoints = 2,
- .bInterfaceClass = ADB_CLASS,
- .bInterfaceSubClass = ADB_SUBCLASS,
- .bInterfaceProtocol = ADB_PROTOCOL,
- .iInterface = 1, /* first string from the provided table */
- },
- .source = {
- .bLength = sizeof(descriptors.hs_descs.source),
- .bDescriptorType = USB_DT_ENDPOINT,
- .bEndpointAddress = 1 | USB_DIR_OUT,
- .bmAttributes = USB_ENDPOINT_XFER_BULK,
- .wMaxPacketSize = MAX_PACKET_SIZE_HS,
- },
- .sink = {
- .bLength = sizeof(descriptors.hs_descs.sink),
- .bDescriptorType = USB_DT_ENDPOINT,
- .bEndpointAddress = 2 | USB_DIR_IN,
- .bmAttributes = USB_ENDPOINT_XFER_BULK,
- .wMaxPacketSize = MAX_PACKET_SIZE_HS,
- },
+ .sink_comp = {
+ .bLength = sizeof(ss_descriptors.sink_comp),
+ .bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
+ .bMaxBurst = 4,
},
};
+struct usb_ext_compat_desc os_desc_compat = {
+ .bFirstInterfaceNumber = 0,
+ .Reserved1 = cpu_to_le32(1),
+ .CompatibleID = { 'W', 'I', 'N', 'U', 'S', 'B', '\0', '\0'},
+ .SubCompatibleID = {0},
+ .Reserved2 = {0},
+};
+
+static struct usb_os_desc_header os_desc_header = {
+ .interface = cpu_to_le32(0),
+ .dwLength = cpu_to_le32(sizeof(os_desc_header) + sizeof(os_desc_compat)),
+ .bcdVersion = cpu_to_le32(1),
+ .wIndex = cpu_to_le32(4),
+ .bCount = cpu_to_le32(1),
+ .Reserved = cpu_to_le32(0),
+};
+
+static struct usb_os_desc_header os_prop_header = {
+ .interface = cpu_to_le32(0),
+ .dwLength = cpu_to_le32(sizeof(os_desc_header) + sizeof(struct usb_ext_prop_values)),
+ .bcdVersion = cpu_to_le32(1),
+ .wIndex = cpu_to_le32(5),
+ .wCount = cpu_to_le16(1),
+};
+
#define STR_INTERFACE_ "ADB Interface"
static const struct {
@@ -151,8 +264,6 @@ static const struct {
},
};
-
-
static void *usb_adb_open_thread(void *x)
{
struct usb_handle *usb = (struct usb_handle *)x;
@@ -270,6 +381,24 @@ static void usb_adb_init()
static void init_functionfs(struct usb_handle *h)
{
ssize_t ret;
+ struct desc_v1 v1_descriptor = {};
+ struct desc_v2 v2_descriptor = {};
+
+ v2_descriptor.header.magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2);
+ v2_descriptor.header.length = cpu_to_le32(sizeof(v2_descriptor));
+ v2_descriptor.header.flags = FUNCTIONFS_HAS_FS_DESC | FUNCTIONFS_HAS_HS_DESC |
+ FUNCTIONFS_HAS_SS_DESC | FUNCTIONFS_HAS_MS_OS_DESC;
+ v2_descriptor.fs_count = 3;
+ v2_descriptor.hs_count = 3;
+ v2_descriptor.ss_count = 5;
+ v2_descriptor.os_count = 2;
+ v2_descriptor.fs_descs = fs_descriptors;
+ v2_descriptor.hs_descs = hs_descriptors;
+ v2_descriptor.ss_descs = ss_descriptors;
+ v2_descriptor.os_header = os_desc_header;
+ v2_descriptor.os_desc = os_desc_compat;
+ v2_descriptor.os_prop_header = os_prop_header;
+ v2_descriptor.os_prop_values.guid = os_desc_guid;
if (h->control < 0) { // might have already done this before
D("OPENING %s\n", USB_FFS_ADB_EP0);
@@ -279,10 +408,20 @@ static void init_functionfs(struct usb_handle *h)
goto err;
}
- ret = adb_write(h->control, &descriptors, sizeof(descriptors));
+ ret = adb_write(h->control, &v2_descriptor, sizeof(v2_descriptor));
if (ret < 0) {
- D("[ %s: write descriptors failed: errno=%d ]\n", USB_FFS_ADB_EP0, errno);
- goto err;
+ D("[ %s: write v2_descriptor failed: errno=%d ]\n", USB_FFS_ADB_EP0, errno);
+ v1_descriptor.header.magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC);
+ v1_descriptor.header.length = cpu_to_le32(sizeof(v1_descriptor));
+ v1_descriptor.header.fs_count = 3;
+ v1_descriptor.header.hs_count = 3;
+ v1_descriptor.fs_descs = fs_descriptors;
+ v1_descriptor.hs_descs = hs_descriptors;
+ ret = adb_write(h->control, &v1_descriptor, sizeof(v1_descriptor));
+ if (ret < 0) {
+ D("[ %s: failed to write USB descriptors]\n", USB_FFS_ADB_EP0);
+ goto err;
+ }
}
ret = adb_write(h->control, &strings, sizeof(strings));
--
2.18.0

View File

@@ -0,0 +1,60 @@
From 7b74d23ed955206a789a96bdc3288593e702afac Mon Sep 17 00:00:00 2001
From: Sean Anderson <sean.anderson@seco.com>
Date: Thu, 30 Dec 2021 15:16:08 -0500
Subject: [PATCH] libsparse: Split off most of sparse_file_read_normal into a
helper function
This carves out the core of sparse_file_read_normal and splits it off so
it can be reused in the next patch. No functional change intended.
Change-Id: Id00491fd7e5bb6fa28c517a0bb32b8b506539d4d
Upstream-Status: Backport [95657f3e5976d96073f7bbfe3a49192509999d1d]
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---
libsparse/sparse_read.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/libsparse/sparse_read.c b/libsparse/sparse_read.c
index 8e188e9a4..ee4abd86a 100644
--- a/libsparse/sparse_read.c
+++ b/libsparse/sparse_read.c
@@ -353,13 +353,11 @@ static int sparse_file_read_sparse(struct sparse_file *s, int fd, bool crc)
return 0;
}
-static int sparse_file_read_normal(struct sparse_file *s, int fd)
+static int do_sparse_file_read_normal(struct sparse_file *s, int fd, uint32_t* buf, int64_t offset,
+ int64_t remain)
{
int ret;
- uint32_t *buf = malloc(s->block_size);
- unsigned int block = 0;
- int64_t remain = s->len;
- int64_t offset = 0;
+ unsigned int block = offset / s->block_size;
unsigned int to_read;
unsigned int i;
bool sparse_block;
@@ -403,6 +401,19 @@ static int sparse_file_read_normal(struct sparse_file *s, int fd)
return 0;
}
+static int sparse_file_read_normal(struct sparse_file* s, int fd)
+{
+ int ret;
+ uint32_t* buf = (uint32_t*)malloc(s->block_size);
+
+ if (!buf)
+ return -ENOMEM;
+
+ ret = do_sparse_file_read_normal(s, fd, buf, 0, s->len);
+ free(buf);
+ return ret;
+}
+
int sparse_file_read(struct sparse_file *s, int fd, bool sparse, bool crc)
{
if (crc && !sparse) {
--
2.35.1.1320.gc452695387.dirty

View File

@@ -0,0 +1,188 @@
From 41574b628ec4229c24dfe289af7b6978edcca4ed Mon Sep 17 00:00:00 2001
From: Sean Anderson <sean.anderson@seco.com>
Date: Thu, 30 Dec 2021 15:19:41 -0500
Subject: [PATCH] libsparse: Add "hole" mode to sparse_file_read
This adds support for filesystem-level sparse files. These files have
holes which are not stored in the filesystem and when read are full of
zeros. While these zeros may be significant in some types of files,
other types of files may not care about the contents of holes. For
example, most filesystem creation tools write to all the blocks they
care about. Those blocks not written to will remain holes, and can be
safely represented by "don't care" chunks. Using "don't care" chunks
instead of fill chunks can result in a substantial reduction of the time
it takes to program a sparse image.
To accomplish this, we extend the existing "sparse" boolean parameter to
be an enum of mode types. This enum represents the strategy we take when
reading in a file. For the most part the implementation is
straightforward. We use lseek to determine where the holes in the file
are, and then use do_sparse_file_read_normal to create chunks for the
data section. Note that every file has an implicit hole at its end.
Change-Id: I0cfbf08886fca9a91cb753ec8734c84fcbe52c9f
Upstream-Status: Backport [f96466b05543b984ef7315d830bab4a409228d35]
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---
libsparse/img2simg.c | 2 +-
libsparse/include/sparse/sparse.h | 32 +++++++++++---
libsparse/sparse_read.c | 71 +++++++++++++++++++++++++++++--
3 files changed, 93 insertions(+), 12 deletions(-)
diff --git a/libsparse/img2simg.c b/libsparse/img2simg.c
index a0db36f45..2e171b613 100644
--- a/libsparse/img2simg.c
+++ b/libsparse/img2simg.c
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
}
sparse_file_verbose(s);
- ret = sparse_file_read(s, in, false, false);
+ ret = sparse_file_read(s, in, SPARSE_READ_MODE_NORMAL, false);
if (ret) {
fprintf(stderr, "Failed to read file\n");
exit(-1);
diff --git a/libsparse/include/sparse/sparse.h b/libsparse/include/sparse/sparse.h
index 8b757d22a..b68aa21a8 100644
--- a/libsparse/include/sparse/sparse.h
+++ b/libsparse/include/sparse/sparse.h
@@ -196,23 +196,41 @@ int64_t sparse_file_len(struct sparse_file *s, bool sparse, bool crc);
int sparse_file_callback(struct sparse_file *s, bool sparse, bool crc,
int (*write)(void *priv, const void *data, int len), void *priv);
+/**
+ * enum sparse_read_mode - The method to use when reading in files
+ * @SPARSE_READ_MODE_NORMAL: The input is a regular file. Constant chunks of
+ * data (including holes) will be be converted to
+ * fill chunks.
+ * @SPARSE_READ_MODE_SPARSE: The input is an Android sparse file.
+ * @SPARSE_READ_MODE_HOLE: The input is a regular file. Holes will be converted
+ * to "don't care" chunks. Other constant chunks will
+ * be converted to fill chunks.
+ */
+enum sparse_read_mode {
+ SPARSE_READ_MODE_NORMAL = false,
+ SPARSE_READ_MODE_SPARSE = true,
+ SPARSE_READ_MODE_HOLE,
+};
+
/**
* sparse_file_read - read a file into a sparse file cookie
*
* @s - sparse file cookie
* @fd - file descriptor to read from
- * @sparse - read a file in the Android sparse file format
+ * @mode - mode to use when reading the input file
* @crc - verify the crc of a file in the Android sparse file format
*
- * Reads a file into a sparse file cookie. If sparse is true, the file is
- * assumed to be in the Android sparse file format. If sparse is false, the
- * file will be sparsed by looking for block aligned chunks of all zeros or
- * another 32 bit value. If crc is true, the crc of the sparse file will be
- * verified.
+ * Reads a file into a sparse file cookie. If @mode is
+ * %SPARSE_READ_MODE_SPARSE, the file is assumed to be in the Android sparse
+ * file format. If @mode is %SPARSE_READ_MODE_NORMAL, the file will be sparsed
+ * by looking for block aligned chunks of all zeros or another 32 bit value. If
+ * @mode is %SPARSE_READ_MODE_HOLE, the file will be sparsed like
+ * %SPARSE_READ_MODE_NORMAL, but holes in the file will be converted to "don't
+ * care" chunks. If crc is true, the crc of the sparse file will be verified.
*
* Returns 0 on success, negative errno on error.
*/
-int sparse_file_read(struct sparse_file *s, int fd, bool sparse, bool crc);
+int sparse_file_read(struct sparse_file *s, int fd, enum sparse_read_mode mode, bool crc);
/**
* sparse_file_import - import an existing sparse file
diff --git a/libsparse/sparse_read.c b/libsparse/sparse_read.c
index ee4abd86a..81f48cc13 100644
--- a/libsparse/sparse_read.c
+++ b/libsparse/sparse_read.c
@@ -414,16 +414,79 @@ static int sparse_file_read_normal(struct sparse_file* s, int fd)
return ret;
}
-int sparse_file_read(struct sparse_file *s, int fd, bool sparse, bool crc)
+#ifdef __linux__
+static int sparse_file_read_hole(struct sparse_file* s, int fd)
{
- if (crc && !sparse) {
+ int ret;
+ uint32_t* buf = (uint32_t*)malloc(s->block_size);
+ int64_t end = 0;
+ int64_t start = 0;
+
+ if (!buf) {
+ return -ENOMEM;
+ }
+
+ do {
+ start = lseek(fd, end, SEEK_DATA);
+ if (start < 0) {
+ if (errno == ENXIO)
+ /* The rest of the file is a hole */
+ break;
+
+ error("could not seek to data");
+ free(buf);
+ return -errno;
+ } else if (start > s->len) {
+ break;
+ }
+
+ end = lseek(fd, start, SEEK_HOLE);
+ if (end < 0) {
+ error("could not seek to end");
+ free(buf);
+ return -errno;
+ }
+ end = min(end, s->len);
+
+ start = ALIGN_DOWN(start, s->block_size);
+ end = ALIGN(end, s->block_size);
+ if (lseek(fd, start, SEEK_SET) < 0) {
+ free(buf);
+ return -errno;
+ }
+
+ ret = do_sparse_file_read_normal(s, fd, buf, start, end - start);
+ if (ret) {
+ free(buf);
+ return ret;
+ }
+ } while (end < s->len);
+
+ free(buf);
+ return 0;
+}
+#else
+static int sparse_file_read_hole(struct sparse_file* s __unused, int fd __unused)
+{
+ return -ENOTSUP;
+}
+#endif
+
+int sparse_file_read(struct sparse_file *s, int fd, enum sparse_read_mode mode, bool crc)
+{
+ if (crc && mode != SPARSE_READ_MODE_SPARSE) {
return -EINVAL;
}
- if (sparse) {
+ switch (mode) {
+ case SPARSE_READ_MODE_SPARSE:
return sparse_file_read_sparse(s, fd, crc);
- } else {
+ case SPARSE_READ_MODE_NORMAL:
return sparse_file_read_normal(s, fd);
+ case SPARSE_READ_MODE_HOLE:
+ return sparse_file_read_hole(s, fd);
+ default:
+ return -EINVAL;
}
}
--
2.35.1.1320.gc452695387.dirty

View File

@@ -0,0 +1,114 @@
From 00cce57eff1a0de3b93efa5da225e9eb33d19659 Mon Sep 17 00:00:00 2001
From: Sean Anderson <sean.anderson@seco.com>
Date: Thu, 30 Dec 2021 15:34:28 -0500
Subject: [PATCH] img2simg: Add support for converting holes to "don't care"
chunks
This adds support for converting files with holes to "don't care"
chunks. This can result in a substantial reduction in the time it takes
to program an image if it has many holes.
Generally, constants compared to argc have been reduced by one, since we
no longer have the program name as the first argument.
Change-Id: I00750edc07d6415dcc07ae0351e9397b0222b7ba
Upstream-Status: Backport [6150b00b6025918da8c28e5c2f929ecdf480a9d6]
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---
libsparse/img2simg.c | 41 ++++++++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 11 deletions(-)
diff --git a/libsparse/img2simg.c b/libsparse/img2simg.c
index 2e171b613..c985d5449 100644
--- a/libsparse/img2simg.c
+++ b/libsparse/img2simg.c
@@ -40,25 +40,42 @@
void usage()
{
- fprintf(stderr, "Usage: img2simg <raw_image_file> <sparse_image_file> [<block_size>]\n");
+ fprintf(stderr, "Usage: img2simg [-s] <raw_image_file> <sparse_image_file> [<block_size>]\n");
}
int main(int argc, char *argv[])
{
+ char *arg_in;
+ char *arg_out;
+ enum sparse_read_mode mode = SPARSE_READ_MODE_NORMAL;
+ int extra;
int in;
+ int opt;
int out;
int ret;
struct sparse_file *s;
unsigned int block_size = 4096;
off64_t len;
- if (argc < 3 || argc > 4) {
+ while ((opt = getopt(argc, argv, "s")) != -1) {
+ switch (opt) {
+ case 's':
+ mode = SPARSE_READ_MODE_HOLE;
+ break;
+ default:
+ usage();
+ exit(-1);
+ }
+ }
+
+ extra = argc - optind;
+ if (extra < 2 || extra > 3) {
usage();
exit(-1);
}
- if (argc == 4) {
- block_size = atoi(argv[3]);
+ if (extra == 3) {
+ block_size = atoi(argv[optind + 2]);
}
if (block_size < 1024 || block_size % 4 != 0) {
@@ -66,22 +83,24 @@ int main(int argc, char *argv[])
exit(-1);
}
- if (strcmp(argv[1], "-") == 0) {
+ arg_in = argv[optind];
+ if (strcmp(arg_in, "-") == 0) {
in = STDIN_FILENO;
} else {
- in = open(argv[1], O_RDONLY | O_BINARY);
+ in = open(arg_in, O_RDONLY | O_BINARY);
if (in < 0) {
- fprintf(stderr, "Cannot open input file %s\n", argv[1]);
+ fprintf(stderr, "Cannot open input file %s\n", arg_in);
exit(-1);
}
}
- if (strcmp(argv[2], "-") == 0) {
+ arg_out = argv[optind + 1];
+ if (strcmp(arg_out, "-") == 0) {
out = STDOUT_FILENO;
} else {
- out = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0664);
+ out = open(arg_out, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0664);
if (out < 0) {
- fprintf(stderr, "Cannot open output file %s\n", argv[2]);
+ fprintf(stderr, "Cannot open output file %s\n", arg_out);
exit(-1);
}
}
@@ -96,7 +115,7 @@ int main(int argc, char *argv[])
}
sparse_file_verbose(s);
- ret = sparse_file_read(s, in, SPARSE_READ_MODE_NORMAL, false);
+ ret = sparse_file_read(s, in, mode, false);
if (ret) {
fprintf(stderr, "Failed to read file\n");
exit(-1);
--
2.35.1.1320.gc452695387.dirty

View File

@@ -0,0 +1,39 @@
Description: adb: Make compatible with openssl 1.1
OpenSSL version 1.1 brought some API changes which broke the build here,
fix that by accessing rsa->n (and e) directly, using RSA_get0_key instead.
Author: Chirayu Desai <chirayudesai1@gmail.com
Last-Update: 2016-11-10
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
system/core/adb/adb_auth_host.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/adb/adb_auth_host.c
+++ b/adb/adb_auth_host.c
@@ -75,6 +75,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
BIGNUM* rem = BN_new();
BIGNUM* n = BN_new();
BIGNUM* n0inv = BN_new();
+ BIGNUM* e = BN_new();
if (RSA_size(rsa) != RSANUMBYTES) {
ret = 0;
@@ -82,7 +83,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
}
BN_set_bit(r32, 32);
- BN_copy(n, rsa->n);
+ RSA_get0_key(rsa, &n, &e, NULL);
BN_set_bit(r, RSANUMWORDS * 32);
BN_mod_sqr(rr, r, n, ctx);
BN_div(NULL, rem, n, r32, ctx);
@@ -96,7 +97,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
BN_div(n, rem, n, r32, ctx);
pkey->n[i] = BN_get_word(rem);
}
- pkey->exponent = BN_get_word(rsa->e);
+ pkey->exponent = BN_get_word(e);
out:
BN_free(n0inv);

View File

@@ -0,0 +1,14 @@
Add protoype declaration for b64_pton
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/adb/adb_auth_client.c
+++ b/adb/adb_auth_client.c
@@ -29,6 +29,7 @@
#define TRACE_TAG TRACE_AUTH
+extern int b64_pton(const char* src, uint8_t* target, size_t targsize);
struct adb_public_key {
struct listnode node;

View File

@@ -0,0 +1,103 @@
# Makefile for ext4_utils
SRCDIR ?= $(S)
VPATH += $(SRCDIR)/system/extras/ext4_utils
make_ext4fs_SRC_FILES += make_ext4fs_main.c
make_ext4fs_SRC_FILES += canned_fs_config.c
make_ext4fs_OBJS := $(make_ext4fs_SRC_FILES:.c=.o)
ext2simg_SRC_FILES += ext2simg.c
ext2simg_OBJS := $(ext2simg_SRC_FILES:.c=.o)
ext4fixup_SRC_FILES += ext4fixup_main.c
ext4fixup_OBJS := $(ext4fixup_SRC_FILES:.c=.o)
libext4_utils_SRC_FILES += make_ext4fs.c
libext4_utils_SRC_FILES += ext4fixup.c
libext4_utils_SRC_FILES += ext4_utils.c
libext4_utils_SRC_FILES += allocate.c
libext4_utils_SRC_FILES += contents.c
libext4_utils_SRC_FILES += extent.c
libext4_utils_SRC_FILES += indirect.c
libext4_utils_SRC_FILES += uuid.c
libext4_utils_SRC_FILES += sha1.c
libext4_utils_SRC_FILES += wipe.c
libext4_utils_SRC_FILES += crc16.c
libext4_utils_SRC_FILES += ext4_sb.c
libext4_utils_OBJS := $(libext4_utils_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/core/libsparse
simg2img_SRC_FILES += simg2img.c
simg2img_SRC_FILES += sparse_crc32.c
simg2img_OBJS := $(simg2img_SRC_FILES:.c=.o)
img2simg_SRC_FILES += img2simg.c
img2simg_OBJS := $(img2simg_SRC_FILES:.c=.o)
simg2simg_SRC_FILES += simg2simg.c
simg2simg_SRC_FILES += sparse_crc32.c
simg2simg_OBJS := $(simg2simg_SRC_FILES:.c=.o)
libsparse_SRC_FILES += backed_block.c
libsparse_SRC_FILES += output_file.c
libsparse_SRC_FILES += sparse.c
libsparse_SRC_FILES += sparse_crc32.c
libsparse_SRC_FILES += sparse_err.c
libsparse_SRC_FILES += sparse_read.c
libsparse_OBJS := $(libsparse_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/external/libselinux/src
libselinux_SRC_FILES += callbacks.c
libselinux_SRC_FILES += check_context.c
libselinux_SRC_FILES += freecon.c
libselinux_SRC_FILES += init.c
libselinux_SRC_FILES += label.c
libselinux_SRC_FILES += label_file.c
libselinux_SRC_FILES += label_android_property.c
libselinux_OBJS := $(libselinux_SRC_FILES:.c=.o)
CFLAGS += -DANDROID
CFLAGS += -DHOST
CFLAGS += -I$(SRCDIR)/system/extras/ext4_utils
CFLAGS += -I$(SRCDIR)/system/core/include
CFLAGS += -I$(SRCDIR)/system/core/libsparse/include
CFLAGS += -I$(SRCDIR)/external/libselinux/include
CFLAGS += -include $(SRCDIR)/build/core/combo/include/arch/$(android_arch)/AndroidConfig.h
all: make_ext4fs ext2simg ext4fixup simg2img img2simg simg2simg
make_ext4fs: libext4_utils.a libsparse.a libselinux.a $(make_ext4fs_OBJS)
$(CC) -o $@ $(LDFLAGS) $(make_ext4fs_OBJS) \
libext4_utils.a libsparse.a libselinux.a -lz -lpcre
ext2simg: libext4_utils.a libselinux.a libsparse.a $(ext2simg_OBJS)
$(CC) -o $@ $(LDFLAGS) $(ext2simg_OBJS) \
libext4_utils.a libselinux.a libsparse.a -lz -lpcre
ext4fixup: libext4_utils.a libsparse.a $(ext4fixup_OBJS)
$(CC) -o $@ $(LDFLAGS) $(ext4fixup_OBJS) libext4_utils.a libsparse.a -lz
simg2img: libsparse.a $(simg2img_OBJS)
$(CC) -o $@ $(LDFLAGS) $(simg2img_OBJS) libsparse.a -lz
img2simg: libsparse.a $(img2simg_OBJS)
$(CC) -o $@ $(LDFLAGS) $(img2simg_OBJS) libsparse.a -lz
simg2simg: libsparse.a $(simg2simg_OBJS)
$(CC) -o $@ $(LDFLAGS) $(simg2simg_OBJS) libsparse.a -lz
libext4_utils.a: $(libext4_utils_OBJS)
$(AR) rcs $@ $(libext4_utils_OBJS)
libsparse.a: $(libsparse_OBJS)
$(AR) rcs $@ $(libsparse_OBJS)
libselinux.a: $(libselinux_OBJS)
$(AR) rcs $@ $(libselinux_OBJS)
clean:
$(RM) $(make_ext4fs_OBJS) $(ext2simg_OBJS) $(ext4fixup_OBJS) \
$(simg2img_OBJS) $(img2simg_OBJS) $(simg2simg_OBJS) \
$(libext4_utils_OBJS) $(libsparse_OBJS) $(libselinux_OBJS) \
make_ext4fs ext2simg ext4fixup simg2img img2simg simg2simg *.a

View File

@@ -0,0 +1,39 @@
From 354604da9d152f1931e91991d3f34197fc8fc759 Mon Sep 17 00:00:00 2001
From: Sergio Schvezov <sergio.schvezov@canonical.com>
Date: Tue, 2 Oct 2018 16:36:54 +0000
Subject: [PATCH] ext4_utils: remove selinux extensions
* drop useless includes of Android SELINUX extensions
* avoids having to clone another module
* this should be sent upstream
Upstream-Status: Inappropriate
---
ext4_utils/make_ext4fs.c | 1 -
ext4_utils/make_ext4fs_main.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 2f89ae8a0..732afbed7 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -62,7 +62,6 @@
#include <selinux/selinux.h>
#include <selinux/label.h>
-#include <selinux/android.h>
#define O_BINARY 0
diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c
index a6c5f6160..f8e7b9da9 100644
--- a/ext4_utils/make_ext4fs_main.c
+++ b/ext4_utils/make_ext4fs_main.c
@@ -32,7 +32,6 @@
#ifndef USE_MINGW
#include <selinux/selinux.h>
#include <selinux/label.h>
-#include <selinux/android.h>
#else
struct selabel_handle;
#endif

View File

@@ -0,0 +1,78 @@
From b9254539811ce912bfd16dd1d185eba7a10cceff Mon Sep 17 00:00:00 2001
From: Markus Mayer <mmayer@mmayer.net>
Date: Wed, 7 Sep 2016 12:58:47 +0300
Subject: [PATCH] ext4_utils: add -o argument to preserve ownership
See also https://android-review.googlesource.com/#/c/100312/
Upstream-Status: Inappropriate
---
ext4_utils/make_ext4fs.c | 6 ++++++
ext4_utils/make_ext4fs_main.c | 10 ++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 732afbed7..2cbf04399 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -67,6 +67,8 @@
#endif
+int preserve_owner = 0;
+
/* TODO: Not implemented:
Allocating blocks in the same block group as the file inode
Hash or binary tree directories
@@ -185,6 +187,10 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path
} else {
dentries[i].mtime = fixed_time;
}
+ if (preserve_owner) {
+ dentries[i].uid = stat.st_uid;
+ dentries[i].gid = stat.st_gid;
+ }
uint64_t capabilities;
if (fs_config_func != NULL) {
#ifdef ANDROID
diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c
index f8e7b9da9..e82d43277 100644
--- a/ext4_utils/make_ext4fs_main.c
+++ b/ext4_utils/make_ext4fs_main.c
@@ -47,13 +47,15 @@ struct selabel_handle;
extern struct fs_info info;
+extern int preserve_owner;
+
static void usage(char *path)
{
fprintf(stderr, "%s [ -l <len> ] [ -j <journal size> ] [ -b <block_size> ]\n", basename(path));
fprintf(stderr, " [ -g <blocks per group> ] [ -i <inodes> ] [ -I <inode size> ]\n");
fprintf(stderr, " [ -L <label> ] [ -f ] [ -a <android mountpoint> ]\n");
fprintf(stderr, " [ -S file_contexts ] [ -C fs_config ] [ -T timestamp ]\n");
- fprintf(stderr, " [ -z | -s ] [ -w ] [ -c ] [ -J ] [ -v ] [ -B <block_list_file> ]\n");
+ fprintf(stderr, " [ -z | -s ] [ -w ] [ -c ] [ -J ] [ -o ] [ -v ] [ -B <block_list_file> ]\n");
fprintf(stderr, " <filename> [<directory>]\n");
}
@@ -79,7 +81,7 @@ int main(int argc, char **argv)
struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "" } };
#endif
- while ((opt = getopt(argc, argv, "l:j:b:g:i:I:L:a:S:T:C:B:fwzJsctv")) != -1) {
+ while ((opt = getopt(argc, argv, "l:j:b:g:i:I:L:a:S:T:C:B:fwzJsctov")) != -1) {
switch (opt) {
case 'l':
info.len = parse_num(optarg);
@@ -142,6 +144,10 @@ int main(int argc, char **argv)
}
#endif
break;
+ case 'o':
+ preserve_owner = 1;
+ printf("Warning: Enabling 'preserve ownership', this is an unofficial feature!\n");
+ break;
case 'v':
verbose = 1;
break;

View File

@@ -0,0 +1,89 @@
# Makefile for fastboot
SRCDIR ?= $(S)
VPATH += $(SRCDIR)/system/core/fastboot
fastboot_SRC_FILES += protocol.c
fastboot_SRC_FILES += engine.c
fastboot_SRC_FILES += bootimg.c
fastboot_SRC_FILES += fastboot.c
fastboot_SRC_FILES += util.c
fastboot_SRC_FILES += fs.c
fastboot_SRC_FILES += usb_linux.c
fastboot_SRC_FILES += util_linux.c
fastboot_OBJS := $(fastboot_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/core/libzipfile
libzipfile_SRC_FILES += centraldir.c
libzipfile_SRC_FILES += zipfile.c
libzipfile_OBJS := $(libzipfile_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/extras/ext4_utils
libext4_utils_SRC_FILES += make_ext4fs.c
libext4_utils_SRC_FILES += ext4fixup.c
libext4_utils_SRC_FILES += ext4_utils.c
libext4_utils_SRC_FILES += allocate.c
libext4_utils_SRC_FILES += contents.c
libext4_utils_SRC_FILES += extent.c
libext4_utils_SRC_FILES += indirect.c
libext4_utils_SRC_FILES += uuid.c
libext4_utils_SRC_FILES += sha1.c
libext4_utils_SRC_FILES += wipe.c
libext4_utils_SRC_FILES += crc16.c
libext4_utils_SRC_FILES += ext4_sb.c
libext4_utils_OBJS := $(libext4_utils_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/core/libsparse
libsparse_SRC_FILES += backed_block.c
libsparse_SRC_FILES += output_file.c
libsparse_SRC_FILES += sparse.c
libsparse_SRC_FILES += sparse_crc32.c
libsparse_SRC_FILES += sparse_err.c
libsparse_SRC_FILES += sparse_read.c
libsparse_OBJS := $(libsparse_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/external/libselinux/src
libselinux_SRC_FILES += callbacks.c
libselinux_SRC_FILES += check_context.c
libselinux_SRC_FILES += freecon.c
libselinux_SRC_FILES += init.c
libselinux_SRC_FILES += label.c
libselinux_SRC_FILES += label_file.c
libselinux_SRC_FILES += label_android_property.c
libselinux_OBJS := $(libselinux_SRC_FILES:.c=.o)
CFLAGS += -std=gnu11
CFLAGS += -DANDROID
# CFLAGS += -DUSE_F2FS
CFLAGS += -DHOST
CFLAGS += -I$(SRCDIR)/system/core/fastboot
CFLAGS += -I$(SRCDIR)/system/core/include
CFLAGS += -I$(SRCDIR)/system/core/mkbootimg
CFLAGS += -I$(SRCDIR)/system/extras/ext4_utils
CFLAGS += -I$(SRCDIR)/system/extras/f2fs_utils
CFLAGS += -I$(SRCDIR)/system/core/libsparse/include
CFLAGS += -I$(SRCDIR)/external/libselinux/include
CFLAGS += -include $(SRCDIR)/build/core/combo/include/arch/$(android_arch)/AndroidConfig.h
LIBS += libzipfile.a libext4_utils.a libsparse.a libselinux.a -lz -lpcre
all: fastboot
fastboot: libzipfile.a libext4_utils.a libsparse.a libselinux.a $(fastboot_OBJS)
$(CC) -o $@ $(LDFLAGS) $(fastboot_OBJS) $(LIBS)
libzipfile.a: $(libzipfile_OBJS)
$(AR) rcs $@ $(libzipfile_OBJS)
libext4_utils.a: $(libext4_utils_OBJS)
$(AR) rcs $@ $(libext4_utils_OBJS)
libsparse.a: $(libsparse_OBJS)
$(AR) rcs $@ $(libsparse_OBJS)
libselinux.a: $(libselinux_OBJS)
$(AR) rcs $@ $(libselinux_OBJS)
clean:
$(RM) $(fastboot_OBJS) $(libzipfile_OBJS) $(libext4_utils_OBJS) \
$(libsparse_OBJS) $(libselinux_OBJS) fastboot *.a

View File

@@ -0,0 +1,59 @@
*
!.gitignore
!*.indirectionsymlink
!*.[ch]
!*.mk
!*.patch
!*.service
!NOTICE
!MODULE_LICENSE_*
!/system/
!/system/core/
!/system/core/adb/
!/system/core/fastboot/
!/system/core/fs_mgr/
!/system/core/fs_mgr/include/
!/system/core/include/
!/system/core/include/android/
!/system/core/include/cutils/
!/system/core/include/log/
!/system/core/include/mincrypt/
!/system/core/include/private/
!/system/core/include/utils/
!/system/core/include/zipfile/
!/system/core/liblog/
!/system/core/liblog/tests/
!/system/core/libcutils/
!/system/core/libmincrypt/
!/system/core/libzipfile/
!/system/core/libsparse/
!/system/core/libsparse/include/
!/system/core/libsparse/include/sparse/
!/system/core/libsparse/simg_dump.py
!/system/core/mkbootimg/
!/system/extras/
!/system/extras/ext4_utils/
!/system/extras/ext4_utils/mkuserimg.sh
!/system/extras/ext4_utils/test_ext4fixup
!/system/extras/f2fs_utils/
!/hardware/
!/hardware/libhardware/
!/hardware/libhardware/include/
!/hardware/libhardware/include/hardware/
!/external/
!/external/libselinux/
!/external/libselinux/include/
!/external/libselinux/include/selinux/
!/external/libselinux/src/
!/external/f2fs-tools/
!/external/f2fs-tools/include/
!/external/f2fs-tools/lib/
!/external/f2fs-tools/mkfs/
!/build/
!/build/core/
!/build/core/version_defaults.mk
!/build/core/combo/
!/build/core/combo/include/
!/build/core/combo/include/arch/
!/build/core/combo/include/arch/linux-*/
!/build/core/combo/include/arch/linux-*/AndroidConfig.h

View File

@@ -0,0 +1,25 @@
From 36654a4484117e5f4d63a810c0d94bc9c7ee3a83 Mon Sep 17 00:00:00 2001
From: Fathi Boudra <fabo@debian.org>
Date: Tue, 2 Oct 2018 16:36:54 +0000
Subject: [PATCH] Remove bionic specific calls
Upstream-Status: Inappropriate
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
src/procattr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/procattr.c b/src/procattr.c
index f350808..761cf8e 100644
--- a/src/procattr.c
+++ b/src/procattr.c
@@ -8,7 +8,7 @@
#include "selinux_internal.h"
#include "policy.h"
-#ifdef HOST
+#ifndef __BIONIC__
static pid_t gettid(void)
{
return syscall(__NR_gettid);

View File

@@ -0,0 +1,49 @@
From f4f9d24860e1b5cd4f6a014f3fda7cd33ebe5be7 Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Sat, 27 Jul 2019 08:20:20 -0700
Subject: [PATCH] libselinux: Do not define gettid() if glibc >= 2.30 is used
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since version 2.30 glibc implements gettid() system call wrapper, see
https://sourceware.org/bugzilla/show_bug.cgi?id=6399
Fixes:
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I../include -D_GNU_SOURCE -DNO_ANDROID_BACKEND -c -o procattr.o procattr.c
procattr.c:28:14: error: static declaration of gettid follows non-static declaration
28 | static pid_t gettid(void)
| ^~~~~~
In file included from /usr/include/unistd.h:1170,
from procattr.c:2:
/usr/include/bits/unistd_ext.h:34:16: note: previous declaration of gettid was here
34 | extern __pid_t gettid (void) __THROW;
| ^~~~~~
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/procattr.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--- a/src/procattr.c
+++ b/src/procattr.c
@@ -8,12 +8,16 @@
#include "selinux_internal.h"
#include "policy.h"
-#ifndef __BIONIC__
+/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and
+ * has a definition for it */
+#if defined(__GLIBC_)
+#if !__GLIBC_PREREQ(2,30)
static pid_t gettid(void)
{
return syscall(__NR_gettid);
}
#endif
+#endif
static int getprocattrcon(char ** context,
pid_t pid, const char *attr)

View File

@@ -0,0 +1,29 @@
# Makefile for mkbootimg
SRCDIR ?= $(S)
VPATH += $(SRCDIR)/system/core/mkbootimg
mkbootimg_SRC_FILES += mkbootimg.c
mkbootimg_OBJS := $(mkbootimg_SRC_FILES:.c=.o)
VPATH += $(SRCDIR)/system/core/libmincrypt
libmincrypt_SRC_FILES := dsa_sig.c p256.c p256_ec.c p256_ecdsa.c rsa.c sha.c sha256.c
libmincrypt_OBJS := $(libmincrypt_SRC_FILES:.c=.o)
CFLAGS += -DANDROID
CFLAGS += -I$(SRCDIR)/system/core/mkbootimg
CFLAGS += -I$(SRCDIR)/system/core/include
CFLAGS += -include $(SRCDIR)/build/core/combo/include/arch/$(android_arch)/AndroidConfig.h
LIBS += libmincrypt.a
all: mkbootimg
mkbootimg: libmincrypt.a $(mkbootimg_OBJS)
$(CC) -o $@ $(LDFLAGS) $(mkbootimg_OBJS) $(LIBS)
libmincrypt.a: $(libmincrypt_OBJS)
$(AR) rcs $@ $(libmincrypt_OBJS)
clean:
$(RM) $(mkbootimg_OBJS) $(libmincrypt_OBJS) mkbootimg *.a

View File

@@ -0,0 +1,195 @@
DESCRIPTION = "Different utilities from Android"
SECTION = "console/utils"
LICENSE = "Apache-2.0 & GPL-2.0-only & BSD-2-Clause & BSD-3-Clause"
LIC_FILES_CHKSUM = " \
file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10 \
file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6 \
file://${COMMON_LICENSE_DIR}/BSD-2-Clause;md5=cb641bc04cda31daea161b1bc15da69f \
file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \
"
DEPENDS = "libbsd libpcre zlib libcap"
DEPENDS:append:class-target = " openssl"
ANDROID_MIRROR = "android.googlesource.com"
# matches with android-5.1.1_r37
SRCREV_core = "2314b110bdebdbfd2d94c502282f9e57c849897e"
SRCREV_extras = "3ecbe8d841df96127d7855661293e5ab6ba6c205"
SRCREV_libhardware = "be55eb1f4d840c82ffaf7c47460df17ff5bc4d9b"
SRCREV_libselinux = "07e9e1339ad1ba608acfba9dce2d0f474b252feb"
SRCREV_build = "16e987def3d7d8f7d30805eb95cef69e52a87dbc"
SRCREV_FORMAT = "core_extras_libhardware_libselinux_build"
SRC_URI = " \
git://${ANDROID_MIRROR}/platform/system/core;name=core;protocol=https;nobranch=1;destsuffix=git/system/core \
git://${ANDROID_MIRROR}/platform/system/extras;name=extras;protocol=https;nobranch=1;destsuffix=git/system/extras \
git://${ANDROID_MIRROR}/platform/hardware/libhardware;name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware \
git://${ANDROID_MIRROR}/platform/external/libselinux;name=libselinux;protocol=https;nobranch=1;destsuffix=git/external/libselinux \
git://${ANDROID_MIRROR}/platform/build;name=build;protocol=https;nobranch=1;destsuffix=git/build \
file://core/0001-adb-remove-selinux-extensions.patch;patchdir=system/core \
file://core/0002-adb-Use-local-sockets-where-appropriate.patch;patchdir=system/core \
file://core/0003-adb-define-shell-command.patch;patchdir=system/core \
file://core/0004-adb-Fix-build-on-big-endian-systems.patch;patchdir=system/core \
file://core/0005-adb-add-base64-implementation.patch;patchdir=system/core \
file://core/0006-adb-Musl-fixes.patch;patchdir=system/core \
file://core/0007-adb-usb_linux.c-fix-build-with-glibc-2.28.patch;patchdir=system/core \
file://core/0008-adb-Allow-adbd-to-be-ran-as-root.patch;patchdir=system/core \
file://core/0009-mkbootimg-Add-dt-parameter-to-specify-DT-image.patch;patchdir=system/core \
file://core/0010-Use-linux-capability.h-on-linux-systems-too.patch;patchdir=system/core \
file://core/0011-Remove-bionic-specific-calls.patch;patchdir=system/core \
file://core/0012-Fix-implicit-declaration-of-stlcat-strlcopy-function.patch;patchdir=system/core \
file://core/adb_libssl_11.diff;patchdir=system/core \
file://core/b64_pton_function_decl.patch;patchdir=system/core \
file://core/0013-adb-Support-riscv64.patch;patchdir=system/core \
file://core/0014-add-u3-ss-descriptor-support-for-adb.patch;patchdir=system/core \
file://core/0015-libsparse-Split-off-most-of-sparse_file_read_normal-.patch;patchdir=system/core \
file://core/0016-libsparse-Add-hole-mode-to-sparse_file_read.patch;patchdir=system/core \
file://core/0017-img2simg-Add-support-for-converting-holes-to-don-t-c.patch;patchdir=system/core \
file://core/0001-memory.h-Always-define-strlcpy-for-glibc-based-syste.patch;patchdir=system/core \
file://extras/0001-ext4_utils-remove-selinux-extensions.patch;patchdir=system/extras \
file://extras/0002-ext4_utils-add-o-argument-to-preserve-ownership.patch;patchdir=system/extras \
file://libselinux/0001-Remove-bionic-specific-calls.patch;patchdir=external/libselinux \
file://libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch;patchdir=external/libselinux \
file://android-tools-adbd.service \
file://build/0001-Riscv-Add-risc-v-Android-config-header.patch;patchdir=build \
file://gitignore \
file://adb.mk;subdir=${BPN} \
file://adbd.mk;subdir=${BPN} \
file://ext4_utils.mk;subdir=${BPN} \
file://fastboot.mk;subdir=${BPN} \
file://mkbootimg.mk;subdir=${BPN} \
"
S = "${WORKDIR}/git"
B = "${WORKDIR}/${BPN}"
# http://errors.yoctoproject.org/Errors/Details/133881/
ARM_INSTRUCTION_SET:armv4 = "arm"
ARM_INSTRUCTION_SET:armv5 = "arm"
COMPATIBLE_HOST:powerpc = "(null)"
COMPATIBLE_HOST:powerpc64 = "(null)"
COMPATIBLE_HOST:powerpc64le = "(null)"
inherit systemd
SYSTEMD_PACKAGES = "${PN}-adbd"
SYSTEMD_SERVICE:${PN}-adbd = "android-tools-adbd.service"
# Find libbsd headers during native builds
CC:append:class-native = " -I${STAGING_INCDIR}"
CC:append:class-nativesdk = " -I${STAGING_INCDIR}"
TOOLS = "adb fastboot ext4_utils mkbootimg adbd"
# Adb needs sys/capability.h, which is not available for native*
TOOLS:class-native = "fastboot ext4_utils mkbootimg"
TOOLS:class-nativesdk = "fastboot ext4_utils mkbootimg"
do_compile() {
cp ${WORKDIR}/gitignore ${S}/.gitignore
# Setting both variables below causing our makefiles to not work with
# implicit make rules
unset CFLAGS
unset CPPFLAGS
export SRCDIR=${S}
case "${HOST_ARCH}" in
arm)
export android_arch=linux-arm
;;
aarch64)
export android_arch=linux-arm64
;;
riscv64)
export android_arch=linux-riscv64
;;
mips|mipsel)
export android_arch=linux-mips
;;
mips64|mips64el)
export android_arch=linux-mips64
;;
powerpc|powerpc64)
export android_arch=linux-ppc
;;
i586|i686|x86_64)
export android_arch=linux-x86
;;
esac
for tool in ${TOOLS}; do
mkdir -p ${B}/${tool}
oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool}
done
}
do_install() {
if echo ${TOOLS} | grep -q "ext4_utils" ; then
install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
fi
if echo ${TOOLS} | grep -q "adb\>" ; then
install -d ${D}${bindir}
install -m0755 ${B}/adb/adb ${D}${bindir}
fi
if echo ${TOOLS} | grep -q "adbd" ; then
install -d ${D}${bindir}
install -m0755 ${B}/adbd/adbd ${D}${bindir}
fi
# Outside the if statement to avoid errors during do_package
install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
${D}${systemd_unitdir}/system/android-tools-adbd.service
if echo ${TOOLS} | grep -q "fastboot" ; then
install -d ${D}${bindir}
install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
fi
if echo ${TOOLS} | grep -q "mkbootimg" ; then
install -d ${D}${bindir}
install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
fi
}
PACKAGES =+ "${PN}-fstools ${PN}-adbd"
RDEPENDS:${PN}-adbd = "${PN}-conf"
RDEPENDS:${PN}-fstools = "bash"
FILES:${PN}-adbd = "\
${bindir}/adbd \
${systemd_unitdir}/system/android-tools-adbd.service \
"
FILES:${PN}-fstools = "\
${bindir}/ext2simg \
${bindir}/ext4fixup \
${bindir}/img2simg \
${bindir}/make_ext4fs \
${bindir}/simg2img \
${bindir}/simg2simg \
${bindir}/simg_dump \
${bindir}/mkuserimg \
"
BBCLASSEXTEND = "native"
android_tools_enable_devmode() {
touch ${IMAGE_ROOTFS}/var/usb-debugging-enabled
}
ROOTFS_POSTPROCESS_COMMAND_${PN}-adbd += "${@bb.utils.contains("USB_DEBUGGING_ENABLED", "1", "android_tools_enable_devmode;", "", d)}"

View File

@@ -0,0 +1,34 @@
SUMMARY = "Tools for tracing OpenGL, Direct3D, and other graphics APIs"
HOMEPAGE = "http://apitrace.github.io/"
SECTION = "console/tools"
LICENSE = "MIT & BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=aeb969185a143c3c25130bc2c3ef9a50 \
file://thirdparty/snappy/COPYING;md5=f62f3080324a97b3159a7a7e61812d0c"
SRCREV = "9352fc02bba106fbbeef9e8452ef34643c0d0764"
PV .= "+11.1+git${SRCPV}"
SRC_URI = "gitsm://github.com/${BPN}/${BPN}.git;branch=master;protocol=https \
"
S = "${WORKDIR}/git"
DEPENDS += "zlib libpng python3-native"
inherit cmake
PACKAGECONFIG ??= " ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11', '', d)} "
PACKAGECONFIG[x11] = "-DENABLE_X11=ON,-DENABLE_X11=OFF,libx11"
EXTRA_OECMAKE += "\
-DENABLE_GUI=OFF \
-DENABLE_STATIC_LIBGCC=OFF \
-DENABLE_STATIC_LIBSTDCXX=OFF \
-DPython3_ROOT_DIR=/usr/bin/python3-native \
"
# Use the bundled snappy library
EXTRA_OECMAKE += "\
-DENABLE_STATIC_SNAPPY=ON \
"
SECURITY_CFLAGS:toolchain-clang = ""

View File

@@ -0,0 +1,67 @@
SUMMARY = "A GNU tool that produce shell scripts to automatically configure software"
DESCRIPTION = "Autoconf is an extensible package of M4 macros that produce shell scripts to automatically \
configure software source code packages. Autoconf creates a configuration script for a package from a template \
file that lists the operating system features that the package can use, in the form of M4 macro calls."
SECTION = "devel"
HOMEPAGE = "http://www.gnu.org/software/autoconf/"
LICENSE = "GPL-3.0-only"
LICENSE = "GPL-2.0-only & GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=361b6b837cad26c6900a926b62aada5f"
SRC_URI = " \
${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \
file://0001-Add-config.guess-config.sub-install-to-destdir.patch \
"
S = "${WORKDIR}/${BPN}"
SRC_URI[md5sum] = "9de56d4a161a723228220b0f425dc711"
SRC_URI[sha256sum] = "f0611136bee505811e9ca11ca7ac188ef5323a8e2ef19cffd3edb3cf08fd791e"
inherit texinfo native
DEPENDS += "m4-native gnu-config-native"
RDEPENDS:${PN} = "m4-native gnu-config-native"
PERL = "${USRBINPATH}/perl"
CACHED_CONFIGUREVARS += "ac_cv_path_PERL='${PERL}'"
CONFIGUREOPTS = " \
--build=${BUILD_SYS} \
--host=${HOST_SYS} \
--target=${TARGET_SYS} \
--prefix=${prefix} \
--exec_prefix=${exec_prefix} \
--bindir=${bindir} \
--sbindir=${sbindir} \
--libexecdir=${libexecdir} \
--datadir=${datadir} \
--sysconfdir=${sysconfdir} \
--sharedstatedir=${sharedstatedir} \
--localstatedir=${localstatedir} \
--libdir=${libdir} \
--includedir=${includedir} \
--oldincludedir=${oldincludedir} \
--infodir=${infodir} \
--mandir=${mandir} \
--disable-silent-rules \
"
EXTRA_OECONF += "ac_cv_path_M4=m4 ac_cv_prog_TEST_EMACS=no"
do_configure() {
./configure ${CONFIGUREOPTS}
}
do_install() {
oe_runmake 'DESTDIR=${D}' install
# avoid conflicts with standard autotools
ver="213"
for file in `find ${D}${bindir} -type f`; do
mv $file $file$ver
done
mv ${D}${datadir}/autoconf ${D}${datadir}/autoconf213
}

View File

@@ -0,0 +1,67 @@
From 3d3e23f7b14e87849405a4e109a69b76696615fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Wed, 11 Dec 2019 23:18:19 +0100
Subject: [PATCH] Add config.guess config.sub / install to destdir
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate [Configuration]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
Makefile.in | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index a6c94d4..4b1b708 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -137,23 +137,23 @@ installcheck: all install
cd testsuite && ${MAKE} AUTOCONF=${bindir}/autoconf $@
installdirs:
- $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(acdatadir)
+ $(SHELL) ${srcdir}/mkinstalldirs ${DESTDIR}$(bindir) ${DESTDIR}$(infodir) ${DESTDIR}$(acdatadir)
install: all $(M4FILES) acconfig.h installdirs install-info
for p in $(ASCRIPTS); do \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+ $(INSTALL_PROGRAM) $$p ${DESTDIR}$(bindir)/`echo $$p|sed '$(transform)'`; \
done
for i in $(M4FROZEN); do \
- $(INSTALL_DATA) $$i $(acdatadir)/$$i; \
+ $(INSTALL_DATA) $$i ${DESTDIR}$(acdatadir)/$$i; \
done
for i in $(M4FILES) acconfig.h; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
+ $(INSTALL_DATA) $(srcdir)/$$i ${DESTDIR}$(acdatadir)/$$i; \
done
-if test -f autoscan; then \
- $(INSTALL_PROGRAM) autoscan $(bindir)/`echo autoscan|sed '$(transform)'`; \
+ $(INSTALL_PROGRAM) autoscan ${DESTDIR}$(bindir)/`echo autoscan|sed '$(transform)'`; \
for i in acfunctions acheaders acidentifiers acprograms \
- acmakevars; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
+ acmakevars config.guess config.sub; do \
+ $(INSTALL_DATA) $(srcdir)/$$i ${DESTDIR}$(acdatadir)/$$i; \
done; \
else :; fi
@@ -161,11 +161,11 @@ install: all $(M4FILES) acconfig.h installdirs install-info
install-info: info installdirs
if test -f autoconf.info; then \
for i in *.info*; do \
- $(INSTALL_DATA) $$i $(infodir)/$$i; \
+ $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/$$i; \
done; \
else \
for i in $(srcdir)/*.info*; do \
- $(INSTALL_DATA) $$i $(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
+ $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
done; \
fi
--
2.21.0

View File

@@ -0,0 +1,61 @@
From 5c63eb5d56abd4e5232add4727247965a863d851 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 15 Dec 2019 14:02:45 -0800
Subject: [PATCH] Do not add stack pointer to clobber list
It was being ignored until now when gcc 9.0 became capable
of flagging these silent ignore via [1].
We weren't actually clobbering the stack pointers here
so it should not cause change in behavior.
[1] https://gcc.gnu.org/PR52813
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
linux_syscall_support.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/linux_syscall_support.h b/linux_syscall_support.h
index 9276f56..6e73309 100644
--- a/linux_syscall_support.h
+++ b/linux_syscall_support.h
@@ -1955,7 +1955,7 @@ struct kernel_statfs {
LSS_ENTRYPOINT \
"pop %%ebx" \
args \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res)
#undef _syscall0
#define _syscall0(type,name) \
@@ -2012,7 +2012,7 @@ struct kernel_statfs {
: "i" (__NR_##name), "ri" ((long)(arg1)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
#undef _syscall6
@@ -2034,7 +2034,7 @@ struct kernel_statfs {
: "i" (__NR_##name), "0" ((long)(&__s)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
@@ -2120,7 +2120,7 @@ struct kernel_statfs {
: "0"(-EINVAL), "i"(__NR_clone),
"m"(fn), "m"(child_stack), "m"(flags), "m"(arg),
"m"(parent_tidptr), "m"(newtls), "m"(child_tidptr)
- : "esp", "memory", "ecx", "edx", "esi", "edi");
+ : "memory", "ecx", "edx", "esi", "edi");
LSS_RETURN(int, __res);
}
--
2.24.1

View File

@@ -0,0 +1,54 @@
From 70441611d4e8200d9d16dfed493873b8c1bb57c5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 15 Mar 2021 11:33:38 -0700
Subject: [PATCH] Remove HAVE_GETCONTEXT check to add local implementation
On musl getcontext/setcontext APIs are implemented in libucontext which
can be used
Upstream-Status: Inappropriate [Musl Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile.am | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index ee7454e4..69700192 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -187,10 +187,6 @@ src_client_linux_libbreakpad_client_a_SOURCES = \
src/common/linux/linux_libc_support.cc \
src/common/linux/memory_mapped_file.cc \
src/common/linux/safe_readlink.cc
-if !HAVE_GETCONTEXT
-src_client_linux_libbreakpad_client_a_SOURCES += \
- src/common/linux/breakpad_getcontext.S
-endif
endif LINUX_HOST
if !DISABLE_PROCESSOR
@@ -508,10 +504,6 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \
src/processor/minidump.cc \
src/processor/pathname_stripper.cc \
src/processor/proc_maps_linux.cc
-if !HAVE_GETCONTEXT
-src_client_linux_linux_client_unittest_shlib_SOURCES += \
- src/common/linux/breakpad_getcontext.S
-endif
src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \
$(AM_CPPFLAGS) $(TEST_CFLAGS)
@@ -541,10 +533,6 @@ src_client_linux_linux_client_unittest_shlib_LDADD = \
src/common/string_conversion.o \
$(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-if !HAVE_GETCONTEXT
-src_client_linux_linux_client_unittest_shlib_SOURCES += \
- src/common/linux/breakpad_getcontext_unittest.cc
-endif
if ANDROID_HOST
src_client_linux_linux_client_unittest_shlib_LDFLAGS += \
-llog -lm
--
2.30.2

View File

@@ -0,0 +1,36 @@
From ab8dcad25d0ac1f3a88814e78794e5d450de15ac Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 14 Sep 2017 23:12:51 -0700
Subject: [PATCH 1/5] Turn off sign-compare for musl-libc
Fix
../../../../../../../workspace/sources/breakpad/src/client/linux/crash_generation/crash_generation_server.cc:234:14: error: comparison of integers of different signs: 'unsigned long' and 'int' [-Werror,-Wsign-compare] hdr = CMSG_NXTHDR(&msg, hdr)) { ^~~~~~~~~~~~~~~~~~~~~~
/mnt/a/oe/build/tmp/work/cortexa7hf-neon-vfpv4-bec-linux-musleabi/breakpad/1_1.0+git999-r0/recipe-sysroot/usr/include/sys/socket.h:288:44: note: expanded from macro 'CMSG_NXTHDR' __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/client/linux/crash_generation/crash_generation_server.cc | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/src/client/linux/crash_generation/crash_generation_server.cc
+++ b/src/client/linux/crash_generation/crash_generation_server.cc
@@ -230,8 +230,18 @@ CrashGenerationServer::ClientEvent(short
// Walk the control payload and extract the file descriptor and validated pid.
pid_t crashing_pid = -1;
int signal_fd = -1;
+#ifndef __GLIBC__
+ // In musl-libc, CMSG_NXTHDR typecasts char* to cmsghdr* which causes
+ // clang to throw sign-compare warning. This is to suppress the warning
+ // inline.
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wsign-compare"
+#endif
for (struct cmsghdr* hdr = CMSG_FIRSTHDR(&msg); hdr;
hdr = CMSG_NXTHDR(&msg, hdr)) {
+#ifndef __GLIBC__
+ #pragma clang diagnostic pop
+#endif
if (hdr->cmsg_level != SOL_SOCKET)
continue;
if (hdr->cmsg_type == SCM_RIGHTS) {

View File

@@ -0,0 +1,34 @@
From 66a2b6e4ba8e2b49115043127ce4aa0fcd71ad1e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 11 May 2021 11:12:35 -0700
Subject: [PATCH] exception_handler.cc: Match the types for SIGSTKSZ
In glibc 2.34, SIGSTKSZ is a syscall which returns a long int, therefore
current check fails
| ../git/src/client/linux/handler/exception_handler.cc:141:49: error: no matching function for call to 'max(int, long int)'
| 141 | static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
| | ~~~~~~~~^~~~~~~~~~~~~~~~~
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/client/linux/handler/exception_handler.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
index ca353c40..dc0fc4a9 100644
--- a/src/client/linux/handler/exception_handler.cc
+++ b/src/client/linux/handler/exception_handler.cc
@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() {
// SIGSTKSZ may be too small to prevent the signal handlers from overrunning
// the alternative stack. Ensure that the size of the alternative stack is
// large enough.
- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
+ static const unsigned kSigStackSize = std::max(16384u, (unsigned)SIGSTKSZ);
// Only set an alternative stack if there isn't already one, or if the current
// one is too small.
--
2.31.1

View File

@@ -0,0 +1,26 @@
From 68580cb62f77117be3164c52abae68f75e8e59a1 Mon Sep 17 00:00:00 2001
From: Felix Janda <felix.janda@posteo.de>
Date: Sun, 1 Feb 2015 14:26:52 +0100
Subject: [PATCH 1/3] include <sys/reg.h> to get __WORDSIZE on musl libc
---
src/common/linux/elf_core_dump.h | 1 +
1 file changed, 1 insertion(+)
--- a/src/common/linux/elf_core_dump.h
+++ b/src/common/linux/elf_core_dump.h
@@ -33,10 +33,14 @@
#ifndef COMMON_LINUX_ELF_CORE_DUMP_H_
#define COMMON_LINUX_ELF_CORE_DUMP_H_
+#include <config.h>
#include <elf.h>
#include <limits.h>
#include <link.h>
#include <stddef.h>
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
#include "common/memory_range.h"

View File

@@ -0,0 +1,56 @@
From 5f7333e4f7b7485598bd71aa80967e1a16a7f901 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 14 Sep 2017 22:57:52 -0700
Subject: [PATCH] lss: Match syscalls to match musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
linux_syscall_support.h | 3 +++
1 file changed, 3 insertions(+)
--- a/linux_syscall_support.h
+++ b/linux_syscall_support.h
@@ -816,6 +816,9 @@ struct kernel_statfs {
#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
#endif
+#ifndef __NR_fstatat
+#define __NR_fstatat __NR_fstatat64
+#endif
#if defined(__x86_64__)
#ifndef ARCH_SET_GS
@@ -947,6 +950,7 @@ struct kernel_statfs {
#ifndef __NR_fallocate
#define __NR_fallocate 324
#endif
+
/* End of i386 definitions */
#elif defined(__ARM_ARCH_3__) || defined(__ARM_EABI__)
#ifndef __NR_setresuid
@@ -1239,6 +1243,12 @@ struct kernel_statfs {
#ifndef __NR_fallocate
#define __NR_fallocate 285
#endif
+#ifndef __NR_pread
+#define __NR_pread __NR_pread64
+#endif
+#ifndef __NR_pwrite
+#define __NR_pwrite __NR_pwrite64
+#endif
/* End of x86-64 definitions */
#elif defined(__mips__)
#if _MIPS_SIM == _MIPS_SIM_ABI32
@@ -1418,6 +1428,12 @@ struct kernel_statfs {
#ifndef __NR_ioprio_get
#define __NR_ioprio_get (__NR_Linux + 274)
#endif
+
+#undef __NR_pread
+#define __NR_pread __NR_pread64
+#undef __NR_pwrite
+#define __NR_pwrite __NR_pwrite64
+
/* End of MIPS (64bit API) definitions */
#else
#ifndef __NR_setresuid

View File

@@ -0,0 +1,30 @@
From 7ea7ded187b4d739239f3ab7082fcd5a2ccc1eaa Mon Sep 17 00:00:00 2001
From: mingtaoxt xt <mingtaoxt@gmail.com>
Date: Wed, 19 Oct 2022 19:36:13 +0800
Subject: [PATCH] mainline version gcc-13 cannot use "uintptr_t" via "#include <string>"
Change-Id: I0049bb92658b4226e32783ad4d8271787deef5f3
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3964166
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Upstream-Status: Backport [https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3964166]
Signed-of-by: Khem Raj <raj.khem@gmail.com>
---
src/client/linux/handler/minidump_descriptor.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/client/linux/handler/minidump_descriptor.h b/src/client/linux/handler/minidump_descriptor.h
index 4349b88f..d822c9d9 100644
--- a/src/client/linux/handler/minidump_descriptor.h
+++ b/src/client/linux/handler/minidump_descriptor.h
@@ -32,6 +32,7 @@
#include <assert.h>
#include <sys/types.h>
+#include <cstdint>
#include <string>
#include "client/linux/handler/microdump_extra_info.h"
--
2.39.1

View File

@@ -0,0 +1,80 @@
From 569af712da94637091080943f6a0d69ccb35864e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 14 Sep 2017 23:24:08 -0700
Subject: [PATCH 3/5] Dont include stab.h
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/common/stabs_reader.cc | 1 -
src/common/stabs_reader.h | 12 +++++++++++-
src/common/stabs_reader_unittest.cc | 1 -
3 files changed, 11 insertions(+), 3 deletions(-)
--- a/src/common/stabs_reader.cc
+++ b/src/common/stabs_reader.cc
@@ -34,7 +34,9 @@
#include "common/stabs_reader.h"
#include <assert.h>
+#ifdef HAVE_STAB_H
#include <stab.h>
+#endif
#include <string.h>
#include <string>
--- a/src/common/stabs_reader.h
+++ b/src/common/stabs_reader.h
@@ -58,6 +58,30 @@
#elif defined(HAVE_A_OUT_H)
#include <a.out.h>
#endif
+// Definitions from <stab.h> and <a.out.h> for systems which
+// do not have them
+#ifndef HAVE_A_OUT_H
+#undef N_UNDF
+#define N_UNDF 0x0
+#ifndef N_FUN
+#define N_FUN 0x24
+#endif
+#ifndef N_SLINE
+#define N_SLINE 0x44
+#endif
+#ifndef N_SO
+#define N_SO 0x64
+#endif
+#ifndef N_LSYM
+#define N_LSYM 0x80
+#endif
+#ifndef N_BINCL
+#define N_BINCL 0x82
+#endif
+#ifndef N_SOL
+#define N_SOL 0x84
+#endif
+#endif
#include <string>
#include <vector>
--- a/src/common/stabs_reader_unittest.cc
+++ b/src/common/stabs_reader_unittest.cc
@@ -33,7 +33,9 @@
#include <assert.h>
#include <errno.h>
+#ifdef HAVE_STAB_H
#include <stab.h>
+#endif
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,7 @@ AC_ARG_ENABLE(m32,
AC_HEADER_STDC
AC_SYS_LARGEFILE
AX_PTHREAD
-AC_CHECK_HEADERS([a.out.h sys/mman.h sys/random.h])
+AC_CHECK_HEADERS([a.out.h stab.h sys/mman.h sys/random.h])
AC_CHECK_FUNCS([arc4random getcontext getrandom memfd_create])
AM_CONDITIONAL([HAVE_GETCONTEXT], [test "x$ac_cv_func_getcontext" = xyes])
AM_CONDITIONAL([HAVE_MEMFD_CREATE], [test "x$ac_cv_func_memfd_create" = xyes])

View File

@@ -0,0 +1,35 @@
From 7aa266545dabf9934ccd44d4fc836040497159be Mon Sep 17 00:00:00 2001
From: Felix Janda <felix.janda@posteo.de>
Date: Sun, 1 Feb 2015 13:41:08 +0100
Subject: [PATCH 3/3] Fix conflict between musl libc <dirent.h> and lss
Include <dirent.h> late to avoid the macro getdents64 in musl
libc's <dirent.h> to conflict with linux_sycall_support.h.
---
src/client/linux/crash_generation/crash_generation_server.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/client/linux/crash_generation/crash_generation_server.cc b/src/client/linux/crash_generation/crash_generation_server.cc
index 26c50a5c..2596afde 100644
--- a/src/client/linux/crash_generation/crash_generation_server.cc
+++ b/src/client/linux/crash_generation/crash_generation_server.cc
@@ -28,7 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assert.h>
-#include <dirent.h>
#include <fcntl.h>
#include <limits.h>
#include <poll.h>
@@ -49,6 +48,8 @@
#include "common/linux/guid_creator.h"
#include "common/linux/safe_readlink.h"
+#include <dirent.h>
+
static const char kCommandQuit = 'x';
namespace google_breakpad {
--
2.14.1

View File

@@ -0,0 +1,41 @@
From 680f9590d19a6e35c7c5587e3f4d8194aab0fcd2 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 14 Sep 2017 23:28:36 -0700
Subject: [PATCH 4/5] elf_reader.cc: include <sys/reg.h> to get __WORDSIZE on
musl libc
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/common/dwarf/elf_reader.cc | 1 +
1 file changed, 1 insertion(+)
--- a/src/common/dwarf/elf_reader.cc
+++ b/src/common/dwarf/elf_reader.cc
@@ -30,12 +30,16 @@
#define _GNU_SOURCE // needed for pread()
#endif
+#include <config.h>
#include <fcntl.h>
#include <limits.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
#include <unistd.h>
#include <algorithm>
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,7 @@ AC_ARG_ENABLE(m32,
AC_HEADER_STDC
AC_SYS_LARGEFILE
AX_PTHREAD
-AC_CHECK_HEADERS([a.out.h stab.h sys/mman.h sys/random.h])
+AC_CHECK_HEADERS([a.out.h stab.h sys/mman.h sys/random.h sys/reg.h])
AC_CHECK_FUNCS([arc4random getcontext getrandom memfd_create])
AM_CONDITIONAL([HAVE_GETCONTEXT], [test "x$ac_cv_func_getcontext" = xyes])
AM_CONDITIONAL([HAVE_MEMFD_CREATE], [test "x$ac_cv_func_memfd_create" = xyes])

View File

@@ -0,0 +1,18 @@
map the mcontext_t structure for musl
Upstream-Status: Inappropriate [need to consider Android]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: git/src/client/linux/minidump_writer/linux_core_dumper.cc
===================================================================
--- git.orig/src/client/linux/minidump_writer/linux_core_dumper.cc
+++ git/src/client/linux/minidump_writer/linux_core_dumper.cc
@@ -196,7 +196,7 @@ bool LinuxCoreDumper::EnumerateThreads()
info.tgid = status->pr_pgrp;
info.ppid = status->pr_ppid;
#if defined(__mips__)
-#if defined(__ANDROID__)
+#if defined(__ANDROID__) || !defined(__GLIBC__)
for (int i = EF_R0; i <= EF_R31; i++)
info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
#else // __ANDROID__

View File

@@ -0,0 +1,17 @@
--- a/linux_syscall_support.h
+++ b/linux_syscall_support.h
@@ -119,14 +119,7 @@ extern "C" {
#ifdef __mips__
/* Include definitions of the ABI currently in use. */
-#ifdef __ANDROID__
-/* Android doesn't have sgidefs.h, but does have asm/sgidefs.h,
- * which has the definitions we need.
- */
#include <asm/sgidefs.h>
-#else
-#include <sgidefs.h>
-#endif
#endif
#endif

View File

@@ -0,0 +1,132 @@
# Released under the MIT license (see COPYING.MIT for the terms)
# Applications using this library needs to add link against libbreakpad_client.a.
SUMMARY = "An open-source multi-platform crash reporting system"
DESCRIPTION = "Breakpad is a library and tool suite that allows you to distribute an application to users with compiler-provided debugging information removed, record crashes in compact \"minidump\" files, send them back to your server, and produce C and C++ stack traces from these minidumps. "
HOMEPAGE = "https://code.google.com/p/google-breakpad/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=8bb274ebd1901085fd71a8d8afe8831b"
SECTION = "libs"
inherit autotools
DEPENDS:append:libc-musl = " libucontext"
BBCLASSEXTEND = "native"
PE = "2"
PV = "1.0"
SRCREV_FORMAT = "breakpad_gtest_protobuf_lss_gyp"
SRCREV_breakpad = "8b22babdf894e5aa98b2dbbe103f7e3856a71944"
#v1.10.0
SRCREV_gtest = "4fe018038f87675c083d0cfb6a6b57c274fb1753"
SRCREV_protobuf = "cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac"
SRCREV_lss = "fd00dbbd0c06a309c657d89e9430143b179ff6db"
SRCREV_gyp = "324dd166b7c0b39d513026fa52d6280ac6d56770"
SRC_URI = "git://github.com/google/breakpad;name=breakpad;branch=main;protocol=https \
git://github.com/google/googletest.git;destsuffix=git/src/testing/gtest;name=gtest;branch=main;protocol=https \
git://github.com/protocolbuffers/protobuf.git;destsuffix=git/src/third_party/protobuf/protobuf;name=protobuf;branch=master;protocol=https \
git://chromium.googlesource.com/linux-syscall-support;protocol=https;branch=main;destsuffix=git/src/third_party/lss;name=lss \
git://chromium.googlesource.com/external/gyp;protocol=https;destsuffix=git/src/tools/gyp;name=gyp;branch=master \
file://0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch \
file://0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch \
file://0001-Turn-off-sign-compare-for-musl-libc.patch \
file://0003-Dont-include-stab.h.patch \
file://0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch \
file://mcontext.patch \
file://0001-Remove-HAVE_GETCONTEXT-check-to-add-local-implementa.patch \
file://0001-exception_handler.cc-Match-the-types-for-SIGSTKSZ.patch \
file://0001-mainline-version-gcc-13-cannot-use-uintptr_t-via-inc.patch \
file://0001-lss-Match-syscalls-to-match-musl.patch;patchdir=src/third_party/lss \
file://mips_asm_sgidefs.patch;patchdir=src/third_party/lss \
file://0001-Do-not-add-stack-pointer-to-clobber-list.patch;patchdir=src/third_party/lss \
"
S = "${WORKDIR}/git"
CXXFLAGS += "-D_GNU_SOURCE"
LDFLAGS:append:libc-musl = " -lucontext"
COMPATIBLE_HOST:powerpc = "null"
COMPATIBLE_HOST:powerpc64 = "null"
COMPATIBLE_HOST:powerpc64le = "null"
COMPATIBLE_HOST:riscv64 = "null"
COMPATIBLE_HOST:riscv32 = "null"
do_install:append() {
install -d ${D}${includedir}
install -d ${D}${includedir}/breakpad
install -d ${D}${includedir}/breakpad/client/linux/crash_generation
install -m 0644 ${S}/src/client/linux/crash_generation/crash_generation_client.h ${D}${includedir}/breakpad/client/linux/crash_generation/crash_generation_client.h
install -d ${D}${includedir}/breakpad/client/linux/handler/
install -m 0644 ${S}/src/client/linux/handler/exception_handler.h ${D}${includedir}/breakpad/client/linux/handler/exception_handler.h
install -m 0644 ${S}/src/client/linux/handler/minidump_descriptor.h ${D}${includedir}/breakpad/client/linux/handler/minidump_descriptor.h
install -d ${D}${includedir}/breakpad/client/linux/dump_writer_common
install -m 0644 ${S}/src/client/linux/dump_writer_common/mapping_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/mapping_info.h
install -m 0644 ${S}/src/client/linux/dump_writer_common/thread_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/thread_info.h
install -m 0644 ${S}/src/client/linux/dump_writer_common/raw_context_cpu.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/raw_context_cpu.h
install -d ${D}${includedir}/breakpad/client/linux/minidump_writer
install -m 0644 ${S}/src/client/linux/minidump_writer/linux_dumper.h ${D}${includedir}/breakpad/client/linux/minidump_writer/linux_dumper.h
install -m 0644 ${S}/src/client/linux/minidump_writer/minidump_writer.h ${D}${includedir}/breakpad/client/linux/minidump_writer/minidump_writer.h
install -d ${D}${includedir}/breakpad/common
install -m 0644 ${S}/src/common/memory_allocator.h ${D}${includedir}/breakpad/common/memory_allocator.h
install -m 0644 ${S}/src/common/scoped_ptr.h ${D}${includedir}/breakpad/common/scoped_ptr.h
install -m 0644 ${S}/src/common/using_std_string.h ${D}${includedir}/breakpad/common/using_std_string.h
install -d ${D}${includedir}/breakpad/google_breakpad/common
install -m 0644 ${S}/src/google_breakpad/common/breakpad_types.h ${D}${includedir}/breakpad/google_breakpad/common/breakpad_types.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_format.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_format.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_amd64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_amd64.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm64.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_mips.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_mips.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc64.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_sparc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_sparc.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_x86.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_x86.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_linux.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_linux.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_mac.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_mac.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_ps3.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_ps3.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_solaris.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_solaris.h
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_win32.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_win32.h
install -d ${D}${includedir}/breakpad/third_party/lss
install -m 0644 ${S}/src/third_party/lss/linux_syscall_support.h ${D}${includedir}/breakpad/third_party/lss/linux_syscall_support.h
}
PACKAGES =+ "${PN}-minidump-upload ${PN}-sym-upload"
FILES:${PN}-minidump-upload = "${bindir}/minidump_upload"
FILES:${PN}-sym-upload = "${bindir}/sym_upload"
SYSROOT_PREPROCESS_FUNCS += "breakpad_populate_sysroot"
breakpad_populate_sysroot() {
sysroot_stage_dir ${D}/usr/include ${SYSROOT_DESTDIR}/usr/include
sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
}
# Fails to build with thumb-1 (qemuarm)
#| {standard input}: Assembler messages:
#| {standard input}:2178: Error: selected processor does not support Thumb mode `it ne'
#| {standard input}:2179: Error: Thumb does not support conditional execution
#| {standard input}:2180: Error: selected processor does not support Thumb mode `it eq'
#| {standard input}:2181: Error: Thumb does not support conditional execution
#| {standard input}:2183: Error: lo register required -- `str ip,[r1,#-4]!'
#| {standard input}:2184: Error: Thumb does not support this addressing mode -- `str r6,[r1,#-4]!'
#| {standard input}:2191: Error: lo register required -- `ldr pc,[sp]'
#| make: *** [src/client/linux/handler/exception_handler.o] Error 1
ARM_INSTRUCTION_SET:armv5 = "arm"
ARM_INSTRUCTION_SET:armv4 = "arm"
TOOLCHAIN = "gcc"

View File

@@ -0,0 +1,28 @@
SUMMARY = "Cap'n Proto serialization/RPC system"
DESCRIPTION = "Capn Proto is an insanely fast data interchange format and capability-based RPC system. "
HOMEPAGE = "https://github.com/sandstorm-io/capnproto"
SECTION = "console/tools"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://../LICENSE;md5=a05663ae6cca874123bf667a60dca8c9"
SRC_URI = "git://github.com/sandstorm-io/capnproto.git;branch=release-0.10.3;protocol=https"
SRCREV = "a16468f296a9584f4068072efecdee8a9eb9c2ed"
S = "${WORKDIR}/git/c++"
inherit cmake
CXXFLAGS:append:mips = " -latomic"
CXXFLAGS:append:powerpc = " -latomic"
CXXFLAGS:append:riscv32 = " -latomic"
EXTRA_OECMAKE += "\
-DBUILD_TESTING=OFF \
"
FILES:${PN}-compiler = "${bindir}"
PACKAGE_BEFORE_PN = "${PN}-compiler"
RDEPENDS:${PN}-dev += "${PN}-compiler"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,34 @@
From be56e955a32e5e9da0be32008afb8a8ee60e9b56 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 24 May 2023 19:31:23 -0700
Subject: [PATCH] cgdb: Do not search for cgdb.txt in build dir
If we do cross builds it encodes the build time workdir here and it wont
be useful to look into this dir since cross-built cgdb may not run on
build host and build workdir will not exist on target
Upstream-Status: Inappropriate [Cross-compile specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
cgdb/interface.cpp | 5 -----
1 file changed, 5 deletions(-)
diff --git a/cgdb/interface.cpp b/cgdb/interface.cpp
index dc58137..d3aab5e 100644
--- a/cgdb/interface.cpp
+++ b/cgdb/interface.cpp
@@ -1568,11 +1568,6 @@ void if_display_help(void)
fs_util_get_path(PKGDATADIR, "cgdb.txt", cgdb_help_file);
- /* File doesn't exist. Try to find cgdb.txt in the build dir in case
- * the user is running a built cgdb binary directly. */
- if (!fs_verify_file_exists(cgdb_help_file))
- fs_util_get_path(TOPBUILDDIR, "doc/cgdb.txt", cgdb_help_file);
-
ret_val = source_set_exec_line(src_viewer, cgdb_help_file, 1, 0);
if (ret_val == 0)
--
2.40.1

View File

@@ -0,0 +1,20 @@
SUMMARY = "curses-based interface to GDB"
DESCRIPTION = "cgdb is a lightweight curses (terminal-based) interface to the GNU Debugger (GDB)."
HOMEPAGE = "http://cgdb.github.io/"
SECTION = "devel"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
DEPENDS = "flex-native readline ncurses"
inherit autotools texinfo
SRC_URI = "http://cgdb.me/files/${BP}.tar.gz \
file://0001-cgdb-Do-not-search-for-cgdb.txt-in-build-dir.patch"
SRC_URI[sha256sum] = "0d38b524d377257b106bad6d856d8ae3304140e1ee24085343e6ddf1b65811f1"
CACHED_CONFIGUREVARS = "ac_cv_file__dev_ptmx=yes ac_cv_rl_version=6.2 ac_cv_file__proc_self_status=yes"
EXTRA_OECONF = "--with-readline=${STAGING_LIBDIR} \
--with-ncurses=${STAGING_LIBDIR}"
RDEPENDS:${PN} = "gdb"

View File

@@ -0,0 +1,21 @@
DESCRIPTION = "Ultralightweight JSON parser in ANSI C"
AUTHOR = "Dave Gamble"
HOMEPAGE = "https://github.com/DaveGamble/cJSON"
SECTION = "libs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=218947f77e8cb8e2fa02918dc41c50d0"
SRC_URI = "git://github.com/DaveGamble/cJSON.git;branch=master;protocol=https"
SRCREV = "d348621ca93571343a56862df7de4ff3bc9b5667"
S = "${WORKDIR}/git"
inherit cmake pkgconfig
EXTRA_OECMAKE += "\
-DENABLE_CJSON_UTILS=On \
-DENABLE_CUSTOM_COMPILER_FLAGS=OFF \
-DBUILD_SHARED_AND_STATIC_LIBS=On \
"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,20 @@
SUMMARY = "Count blank lines, comment lines, and physical lines of source code \
in many programming languages."
AUTHOR = "Al Danial"
LICENSE="GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2c1c00f9d3ed9e24fa69b932b7e7aff2"
SRC_URI = "https://github.com/AlDanial/cloc/releases/download/v${PV}/${BP}.tar.gz"
SRC_URI[sha256sum] = "08212290c4e9b21c7bb1abc0a9b4a365ce1c5eb0d8f3ebb74d50b29559a71a9c"
UPSTREAM_CHECK_URI = "https://github.com/AlDanial/${BPN}/releases"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install() {
install -D -m 0755 ${S}/cloc ${D}${bindir}/cloc
}
RDEPENDS:${PN} = "perl perl-modules"

View File

@@ -0,0 +1,32 @@
From 00f822ab79b6c06936147af4d832e439cecf0fc0 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 7 Jan 2023 19:31:58 -0800
Subject: [PATCH] build: Use ilp32d abi on riscv32 and lp64d on rv64
ilp32d is common ABI used for linux distributions therefore a better
default, similarily lp64d is common ABI for rv64 linux
Upstream-Status: Submitted [https://github.com/concurrencykit/ck/pull/204]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
build/ck.build.riscv | 2 +-
build/ck.build.riscv64 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/build/ck.build.riscv b/build/ck.build.riscv
index 61e0033..11ac840 100644
--- a/build/ck.build.riscv
+++ b/build/ck.build.riscv
@@ -1 +1 @@
-CFLAGS+=-mabi=ilp32
+CFLAGS+=-mabi=ilp32d
diff --git a/build/ck.build.riscv64 b/build/ck.build.riscv64
index 9f89791..7639bd6 100644
--- a/build/ck.build.riscv64
+++ b/build/ck.build.riscv64
@@ -1 +1 @@
-CFLAGS+=-mabi=lp64
+CFLAGS+=-mabi=lp64d
--
2.39.0

View File

@@ -0,0 +1,84 @@
From e1dcd27e816520bdabc69511d90c4a2ebc242831 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 6 Jan 2023 18:51:34 -0800
Subject: [PATCH] configure: Fix compoiler detection logic for
cross-compilation
We can not run binaries during cross compile, so poke at compiler to
figure out if it is clang or gcc, for OE we do not have other compilers
in opensource world if there are we can extend this logic
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure | 56 ++++++++++++++++---------------------------------------
1 file changed, 16 insertions(+), 40 deletions(-)
--- a/configure
+++ b/configure
@@ -661,48 +661,24 @@ if test "$PROFILE"; then
fi
printf "Finding suitable compiler........"
-if test ! -x "${CC}"; then
- CC=`pathsearch "${CC:-cc}"`
- if test -z "$CC" -o ! -x "$CC"; then
- CC=`pathsearch "${CC:-gcc}"`
- fi
+if test -z "$CC"; then
+ if test ! -x "${CC}"; then
+ CC=`pathsearch "${CC:-cc}"`
+ if test -z "$CC" -o ! -x "$CC"; then
+ CC=`pathsearch "${CC:-gcc}"`
+ fi
+ fi
+ assert "$CC" "not found"
+fi
+if `$CC --version | grep gcc > /dev/null 2>&1`; then
+ COMPILER=gcc
+elif `$CC --version | grep clang > /dev/null 2>&1`; then
+ COMPILER=clang
+else
+ COMPILER="not-found"
fi
-assert "$CC" "not found"
-
-cat << EOF > .1.c
-#include <stdio.h>
-int main(void) {
-#if defined(_WIN32)
-#if defined(__MINGW64__)
- puts("mingw64");
- return (0);
-#elif defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION >= 3)
- puts("mingw32");
- return (0);
-#else
- return (1);
-#endif /* __MINGW32__ && __MINGW32_MAJOR_VERSION >= 3 */
-#elif defined(__clang__) && (__clang_major__ >= 3)
- puts("clang");
- return (0);
-#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5110)
- puts("suncc");
- return (0);
-#elif defined(__GNUC__) && (__GNUC__ >= 4)
- puts("gcc");
- return (0);
-#else
- return (1);
-#endif
-}
-EOF
-
-$CC -o .1 .1.c
-COMPILER=`./.1 2> /dev/null`
-r=$?
-rm -f .1.c .1
-if test "$r" -ne 0; then
+if test "$COMPILER" = "not-found"; then
assert "" "update compiler"
else
echo "success [$CC]"

View File

@@ -0,0 +1,42 @@
DESCRIPTION = "Concurrency Kit provides a plethora of concurrency primitives, \
safe memory reclamation mechanisms and non-blocking data structures \
designed to aid in the design and implementation of high performance \
concurrent systems."
LICENSE = "BSD-2-Clause & Apache-2.0"
HOMEPAGE = "http://concurrencykit.org"
SECTION = "base"
PV = "0.7.0+git${SRCPV}"
SRCREV = "6e8e5bec2e2f8cef2072a68579cbb07ababf3331"
LIC_FILES_CHKSUM = "file://LICENSE;md5=a0b24c1a8f9ad516a297d055b0294231"
SRC_URI = "git://github.com/concurrencykit/ck.git;branch=master;protocol=https \
file://0001-configure-Fix-compoiler-detection-logic-for-cross-co.patch \
file://0001-build-Use-ilp32d-abi-on-riscv32-and-lp64d-on-rv64.patch"
S = "${WORKDIR}/git"
COMPATIBLE_HOST = "(arm|aarch64|i.86|x86_64|powerpc|powerpc64|riscv32|riscv64).*-linux*"
inherit autotools-brokensep
PLAT:powerpc64 = "ppc64"
PLAT:powerpc64le = "ppc64"
PLAT:riscv32 = "riscv"
PLAT ?= "${HOST_ARCH}"
do_configure () {
export PLATFORM=${PLAT}
${S}/configure \
--prefix=${prefix} \
--includedir=${includedir} \
--libdir=${libdir}
}
do_compile () {
oe_runmake
}
do_install () {
oe_runmake 'DESTDIR=${D}' install
}

View File

@@ -0,0 +1,23 @@
SUMMARY = "Linux tool to dump x86 CPUID information about the CPU(s)"
DESCRIPTION = "cpuid dumps detailed information about the CPU(s) gathered \
from the CPUID instruction, and also determines the exact model of CPU(s). \
It supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, \
UMC, NexGen, Rise, and SiS CPUs"
HOMEPAGE="http://www.etallen.com/cpuid.html"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "http://www.etallen.com/${BPN}/${BP}.src.tar.gz \
"
SRC_URI[sha256sum] = "230772bb88c44732e68a42d2eff43bcff46d893bf4ea6e04151d4cb6e8c88e2f"
COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
inherit perlnative
# The install rule from the Makefile has hardcoded paths, so we duplicate
# the actions to accommodate different paths.
do_install () {
install -D -m 0755 ${B}/cpuid ${D}/${bindir}/cpuid
install -D -m 0444 ${B}/cpuid.man.gz ${D}/${mandir}
}

View File

@@ -0,0 +1,24 @@
# Copyright (C) 2015 Igor Santos <igor.santos@aker.com.br>
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "Cscope is a text screen based source browser"
DESCRIPTION = "Cscope is a developer's tool for browsing source code. \
It has an impeccable Unix pedigree, having been originally \
developed at Bell Labs back in the days of the PDP-11. \
Cscope was part of the official AT&T Unix distribution for \
many years, and has been used to manage projects involving 20 \
million lines of code!"
HOMEPAGE = "http://cscope.sourceforge.net/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=d4667b67b483823043fcffa489ea343b"
inherit autotools
DEPENDS += "ncurses"
SRC_URI = "http://downloads.sourceforge.net/project/cscope/cscope/v${PV}/${BP}.tar.gz"
SRC_URI[md5sum] = "16f3cce078b6c0e42299def4028eea6f"
SRC_URI[sha256sum] = "c5505ae075a871a9cd8d9801859b0ff1c09782075df281c72c23e72115d9f159"

View File

@@ -0,0 +1,34 @@
# Copyright (C) 2015 Igor Santos <igor.santos@aker.com.br>
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "Universal Ctags"
DESCRIPTION = "Universal Ctags is a multilanguage reimplementation of the \
Unix ctags utility. Ctags generates an index of source code \
definitions which is used by numerous editors and utilities \
to instantly locate the definitions."
HOMEPAGE = "https://ctags.io/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
inherit autotools-brokensep pkgconfig manpages
SRCREV = "1231ebe5b4ac1cc095b4480a0bb2b016c135d6fb"
SRC_URI = "git://github.com/universal-ctags/ctags;branch=master;protocol=https"
S = "${WORKDIR}/git"
PACKAGECONFIG ??= " \
readcmd \
xml \
json \
yaml \
"
PACKAGECONFIG[readcmd] = "--enable-readcmd,--disable-readcmd"
PACKAGECONFIG[etags] = "--enable-etags,--disable-etags"
PACKAGECONFIG[xml] = "--enable-xml,--disable-xml,libxml2"
PACKAGECONFIG[json] = "--enable-json,--disable-json,jansson"
PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
PACKAGECONFIG[yaml] = "--enable-yaml,--disable-yaml,libyaml"
PACKAGECONFIG[manpages] = ",,python3-docutils-native"

View File

@@ -0,0 +1,33 @@
From e735fb23f46f0c3c7a1144ba6b4050bfc0015a05 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Wed, 2 Jun 2021 13:34:35 +0800
Subject: [PATCH] do not hardcode the full path of dpkg
While calling debootstrap in sdk, if host does not install dpkg package,
the full path calling will fail
Do not hardcode the full path of dpkg, then then sdk's dpkg will be used.
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
debootstrap | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debootstrap b/debootstrap
index a3cf3af..5e96c3e 100755
--- a/debootstrap
+++ b/debootstrap
@@ -538,7 +538,7 @@ fi
if in_path dpkg && \
dpkg --print-architecture >/dev/null 2>&1; then
- HOST_ARCH=$(/usr/bin/dpkg --print-architecture)
+ HOST_ARCH=$(dpkg --print-architecture)
elif in_path udpkg && \
udpkg --print-architecture >/dev/null 2>&1; then
HOST_ARCH=$(/usr/bin/udpkg --print-architecture)
--
2.27.0

View File

@@ -0,0 +1,41 @@
From 87d0174e8d56e7458dc94f05f82ab7a67a5cf7d0 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Thu, 8 Apr 2021 14:06:05 +0800
Subject: [PATCH 1/2] support to override /usr/sbin and /usr/share
Upstream-Status: Submitted [https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/55]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
Makefile | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 8516803..a2d8c00 100644
--- a/Makefile
+++ b/Makefile
@@ -5,14 +5,16 @@ all:
clean:
-DSDIR=$(DESTDIR)/usr/share/debootstrap
+datadir ?= "/usr/share"
+sbindir ?= "/usr/sbin"
+DSDIR=$(DESTDIR)${datadir}/debootstrap
install:
mkdir -p $(DSDIR)/scripts
- mkdir -p $(DESTDIR)/usr/sbin
+ mkdir -p $(DESTDIR)$(sbindir)
cp -a scripts/* $(DSDIR)/scripts/
install -o root -g root -m 0644 functions $(DSDIR)/
- sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap
- chown root:root $(DESTDIR)/usr/sbin/debootstrap
- chmod 0755 $(DESTDIR)/usr/sbin/debootstrap
+ sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)$(sbindir)/debootstrap
+ chown root:root $(DESTDIR)$(sbindir)/debootstrap
+ chmod 0755 $(DESTDIR)$(sbindir)/debootstrap
--
2.17.1

View File

@@ -0,0 +1,47 @@
From f0420b201f2fb5286ccf5657faa6b38cd2680e10 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Thu, 8 Apr 2021 14:08:06 +0800
Subject: [PATCH 2/2] support to override /usr/bin/arch-test
Upstream-Status: Submitted [https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/55]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
debootstrap | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/debootstrap b/debootstrap
index 9b9e58d..a3cf3af 100755
--- a/debootstrap
+++ b/debootstrap
@@ -51,6 +51,10 @@ INRELEASE_PATH=""
DEF_MIRROR="http://deb.debian.org/debian"
DEF_HTTPS_MIRROR="https://deb.debian.org/debian"
+if [ -z "$ARCH_TEST" ]; then
+ ARCH_TEST="/usr/bin/arch-test"
+fi
+
# set $CONTAINER
detect_container
@@ -645,12 +649,12 @@ fi
###########################################################################
-if [ -x /usr/bin/arch-test ] && am_doing_phase second_stage; then
+if [ -x ${ARCH_TEST} ] && am_doing_phase second_stage; then
if doing_variant fakechroot; then
- ret=0; arch-test "$ARCH" || ret=$?
+ ret=0; ${ARCH_TEST} "$ARCH" || ret=$?
# Avoid failure with old arch-test package
- elif arch-test --version > /dev/null 2>&1; then
- ret=0; arch-test -c "$TARGET" "$ARCH" || ret=$?
+ elif ${ARCH_TEST} --version > /dev/null 2>&1; then
+ ret=0; ${ARCH_TEST} -c "$TARGET" "$ARCH" || ret=$?
else
ret=3
fi
--
2.17.1

View File

@@ -0,0 +1,27 @@
SUMMARY = "Install a Debian system into a subdirectory"
HOMEPAGE = "https://wiki.debian.org/Debootstrap"
SECTION = "devel"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://debian/copyright;md5=1e68ced6e1689d4cd9dac75ff5225608"
SRC_URI = "\
${DEBIAN_MIRROR}/main/d/debootstrap/debootstrap_${PV}.tar.gz \
file://0001-support-to-override-usr-sbin-and-usr-share.patch \
file://0002-support-to-override-usr-bin-arch-test.patch \
file://0001-do-not-hardcode-the-full-path-of-dpkg.patch \
"
SRC_URI[sha256sum] = "09e7f8795fee894b77994213ee3a588e9d8f96ddf5f93afdec91e9a137aa7866"
S = "${WORKDIR}/debootstrap"
DEPENDS = " \
virtual/fakeroot-native \
"
fakeroot do_install() {
oe_runmake 'DESTDIR=${D}' install
chown -R root:root ${D}${datadir}/debootstrap
}
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,29 @@
From 9c2438e85e4d7deb9422be257a25e8ab16093821 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 2 Dec 2016 14:02:02 -0800
Subject: [PATCH] undefined strdup macro
build fails due to strdup define in string2.h
system header.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
dmalloc.h.3 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dmalloc.h.3 b/dmalloc.h.3
index 8bda997..b70c07e 100644
--- a/dmalloc.h.3
+++ b/dmalloc.h.3
@@ -1,5 +1,8 @@
/* NOTE: start of $Id: dmalloc.h.4,v 1.15 2007/05/14 17:23:37 gray Exp $ */
+#undef strndup
+#undef strdup
+
/* dmalloc version defines */
#define DMALLOC_VERSION_MAJOR 5 /* X.0.0 */
#define DMALLOC_VERSION_MINOR 5 /* 0.X.0 */
--
2.10.2

View File

@@ -0,0 +1,312 @@
Description: Changes for building shared libraries
This patch includes changes for building shared libraries with PIC object
files and the correct soname and libname.
Author: Daniel Rus Morales <danirus@tol-project.org>
Index: dmalloc-5.5.2/Makefile.in
===================================================================
--- dmalloc-5.5.2.orig/Makefile.in
+++ dmalloc-5.5.2/Makefile.in
@@ -41,7 +41,7 @@ LIBRARY = lib$(MODULE).a
# thread version of the library
LIB_TH = lib$(MODULE)th.a
-LIB_TH_SL = lib$(MODULE)th.@shlibext@
+LIB_TH_SL = lib$(MODULE)th.@shlibext@.5.5.2
@TH_ON@BUILD_ALL_1 = threads
@TH_ON@INSTALL_LIB_1 = installth
@SL_ON@BUILD_THREADS_1 = $(LIB_TH_SL)
@@ -50,8 +50,8 @@ LIB_TH_SL = lib$(MODULE)th.@shlibext@
@TH_ON@@SL_ON@INSTALL_LIB_2 = installthsl
# C++ version of the library
-LIB_CXX = lib$(MODULE)xx.a
-LIB_CXX_SL = lib$(MODULE)xx.@shlibext@
+LIB_CXX = lib$(MODULE)cxx.a
+LIB_CXX_SL = lib$(MODULE)cxx.@shlibext@.5.5.2
@CXX_ON@BUILD_ALL_3 = $(LIB_CXX)
@CXX_ON@INSTALL_LIB_3 = installcxx
@SL_ON@BUILD_CXX_3 = $(LIB_CXX_SL)
@@ -61,7 +61,7 @@ LIB_CXX_SL = lib$(MODULE)xx.@shlibext@
# threads + C++
LIB_TH_CXX = lib$(MODULE)thcxx.a
-LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@
+LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@.5.5.2
@TH_ON@@CXX_ON@BUILD_ALL_5 = $(LIB_TH_CXX)
@TH_ON@@CXX_ON@INSTALL_LIB_5 = installthcxx
@TH_ON@BUILD_CXX_5 = $(LIB_TH_CXX)
@@ -76,7 +76,7 @@ LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlib
@CXX_ON@@SL_ON@INSTALL_THREADS_6 = installthcxxsl
# shared versions of the libraries
-LIB_SL = lib$(MODULE).@shlibext@
+LIB_SL = lib$(MODULE).@shlibext@.5.5.2
@SL_ON@BUILD_ALL_7 = $(LIB_SL)
@SL_ON@INSTALL_LIB_7 = installsl
@SL_ON@BUILD_TH_CXX_7 = $(LIB_TH_CXX_SL)
@@ -145,9 +145,13 @@ SHELL = /bin/sh
HFLS = dmalloc.h
OBJS = arg_check.o compat.o dmalloc_rand.o dmalloc_tab.o env.o heap.o
+OBJS_SL = arg_check_sl.o compat_sl.o dmalloc_rand_sl.o dmalloc_tab_sl.o env_sl.o heap_sl.o
NORMAL_OBJS = chunk.o error.o malloc.o
+NORMAL_OBJS_SL = chunk_sl.o error_sl.o malloc_sl.o
THREAD_OBJS = chunk_th.o error_th.o malloc_th.o
+THREAD_OBJS_SL = chunk_th_sl.o error_th_sl.o malloc_th_sl.o
CXX_OBJS = dmallocc.o
+CXX_OBJS_SL = dmallocc_sl.o
CFLAGS = $(CCFLAGS)
TEST = $(MODULE)_t
@@ -160,9 +164,9 @@ all : $(BUILD_ALL)
clean :
rm -f $(A_OUT) core *.o *.t
- rm -f $(LIBRARY) $(LIB_TH) $(LIB_CXX) $(LIB_TH_CXX) $(TEST) $(TEST_FC)
- rm -f $(LIB_TH_SL) $(LIB_CXX_SL) $(LIB_TH_CXX_SL) $(LIB_SL)
+ rm -f $(TEST) $(TEST_FC)
rm -f $(UTIL) dmalloc.h
+ rm -f lib$(MODULE)*.*
realclean : clean
@@ -181,43 +185,43 @@ installincs : $(HFLS)
$(INSTALL_DATA) $(HFLS) $(includedir)
installthsl : $(LIB_TH_SL)
- $(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL_PROGRAM) $(LIB_TH_SL) $(libdir)
+ $(srcdir)/mkinstalldirs $(shlibdir)
+ $(INSTALL) $(LIB_TH_SL) $(shlibdir)
installth : $(INSTALL_THREADS)
$(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL_PROGRAM) $(LIB_TH) $(libdir)
+ $(INSTALL) $(LIB_TH) $(libdir)
@CXX_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
@SL_OFF@ @echo "Enter 'make installthsl' to install the threaded shared-library"
installthcxxsl : $(LIB_TH_CXX_SL)
$(srcdir)/mkinstalldirs $(shlibdir)
- $(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(shlibdir)
+ $(INSTALL) $(LIB_TH_CXX_SL) $(shlibdir)
installthcxx : $(INSTALL_TH_CXX)
$(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL_PROGRAM) $(LIB_TH_CXX) $(libdir)
+ $(INSTALL) $(LIB_TH_CXX) $(libdir)
@SL_OFF@ @echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library"
installcxxsl : $(LIB_CXX_SL)
- $(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL_PROGRAM) $(LIB_CXX_SL) $(libdir)
+ $(srcdir)/mkinstalldirs $(shlibdir)
+ $(INSTALL) $(LIB_CXX_SL) $(shlibdir)
installcxx : $(INSTALL_CXX)
$(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL_PROGRAM) $(LIB_CXX) $(libdir)
+ $(INSTALL) $(LIB_CXX) $(libdir)
@TH_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
@SL_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
installsl : $(LIB_SL)
$(srcdir)/mkinstalldirs $(shlibdir)
- $(INSTALL_PROGRAM) $(LIB_SL) $(shlibdir)
+ $(INSTALL) $(LIB_SL) $(shlibdir)
@CXX_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
@TH_OFF@ @echo "Enter 'make installthsl' to install thread shared-library"
installlib : $(INSTALL_LIB)
$(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL_PROGRAM) $(LIBRARY) $(libdir)
+ $(INSTALL) $(LIBRARY) $(libdir)
@RANLIB@ $(libdir)/$(LIBRARY)
@SL_OFF@ @echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)"
@CXX_OFF@ @echo "Enter 'make installcxx' to install the C++ library"
@@ -255,10 +259,8 @@ shlib : $(BUILD_SL)
# NOTE: you may have to edit the configure.ac script to get this to
# work on your operating system. Please send feedback to the author
# via: http://256.com/gray/email.html
-$(LIB_SL) : $(LIBRARY)
- rm -f $@ $@.t
- @shlinkargs@ $(LIBRARY) $(OBJS) $(NORMAL_OBJS)
- mv $@.t $@
+$(LIB_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL)
+ $(CC) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
$(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
ar cr $@ $?
@@ -268,32 +270,26 @@ $(LIB_TH) : $(OBJS) $(THREAD_OBJS)
ar cr $@ $?
@RANLIB@ $@
-$(LIB_TH_SL) : $(LIB_TH)
- rm -f $@ $@.t
- @shlinkargs@ $(LIB_TH) $(OBJS) $(THREAD_OBJS)
- mv $@.t $@
+$(LIB_TH_SL) : $(OBJS_SL) $(THREAD_OBJS_SL)
+ $(CC) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
$(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
ar cr $@ $?
@RANLIB@ $@
-$(LIB_CXX_SL) : $(LIB_CXX)
- rm -f $@ $@.t
- @shlinkargs@ $(LIB_CXX) $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
- mv $@.t $@
+$(LIB_CXX_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
+ $(CC) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
$(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
ar cr $@ $?
@RANLIB@ $@
-$(LIB_TH_CXX_SL) : $(LIB_TH_CXX)
- rm -f $@ $@.t
- @shlinkargs@ $(LIB_TH_CXX) $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
- mv $@.t $@
+$(LIB_TH_CXX_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
+ $(CC) -shared -Wl,-soname,libdmallocthcxx.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
-threadssl : $(LIB_TH_SL)
+threadssl : $(LIB_TH_SL)$(ver)
-threadscxxsl : $(LIB_TH_CXX_SL)
+threadscxxsl : $(LIB_TH_CXX_SL)$(ver)
threadscxx : $(BUILD_TH_CXX)
@SL_OFF@ @echo "Enter 'make threadscxxsl' to build the threaded C++ shared-library"
@@ -302,7 +298,7 @@ threads : $(BUILD_THREADS)
@CXX_OFF@ @echo "Enter 'make threadscxx' to build the threaded C++ library"
@SL_OFF@ @echo "Enter 'make threadssl' to build the threaded shared library"
-cxxsl : $(LIB_CXX_SL)
+cxxsl : $(LIB_CXX_SL)$(ver)
cxx : $(BUILD_CXX)
@SL_OFF@ @echo "Enter 'make cxxsl' to build the cxx shared library"
@@ -371,6 +367,11 @@ dmallocc.o : $(srcdir)/dmallocc.cc
$(CXX) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
-o ./$@
+dmallocc_sl.o : $(srcdir)/dmallocc.cc
+ rm -f $@
+ $(CXX) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
+ -o ./$@
+
#
# auto configure settings - uncomment if you are doing configure
# development on the library
@@ -395,38 +396,109 @@ dmallocc.o : $(srcdir)/dmallocc.cc
arg_check.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \
dmalloc_loc.h error.h arg_check.h
+arg_check_sl.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \
+ dmalloc_loc.h error.h arg_check.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
chunk.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
error_val.h heap.h
+chunk_sl.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
+ dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
+ error_val.h heap.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
compat.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h
+compat_sl.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
dmalloc.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h compat.h \
debug_tok.h dmalloc_loc.h env.h error_val.h version.h
+dmalloc_sl.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h compat.h \
+ debug_tok.h dmalloc_loc.h env.h error_val.h version.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
dmalloc_argv.o: dmalloc_argv.c conf.h settings.h dmalloc_argv.h \
dmalloc_argv_loc.h compat.h
+dmalloc_argv_sl.o: dmalloc_argv.c conf.h settings.h dmalloc_argv.h \
+ dmalloc_argv_loc.h compat.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
dmalloc_fc_t.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \
dmalloc_rand.h debug_tok.h dmalloc_loc.h error_val.h
+dmalloc_fc_t_sl.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \
+ dmalloc_rand.h debug_tok.h dmalloc_loc.h error_val.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
dmalloc_rand.o: dmalloc_rand.c dmalloc_rand.h
+dmalloc_rand_sl.o: dmalloc_rand.c dmalloc_rand.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
dmalloc_t.o: dmalloc_t.c conf.h settings.h compat.h dmalloc.h \
dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \
error_val.h heap.h
+dmalloc_t_sl.o: dmalloc_t.c conf.h settings.h compat.h dmalloc.h \
+ dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \
+ error_val.h heap.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
dmalloc_tab.o: dmalloc_tab.c conf.h settings.h chunk.h compat.h dmalloc.h \
dmalloc_loc.h error.h error_val.h dmalloc_tab.h dmalloc_tab_loc.h
+dmalloc_tab_sl.o: dmalloc_tab.c conf.h settings.h chunk.h compat.h dmalloc.h \
+ dmalloc_loc.h error.h error_val.h dmalloc_tab.h dmalloc_tab_loc.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
env.o: env.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h \
debug_tok.h env.h error.h
+env_sl.o: env.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h \
+ debug_tok.h env.h error.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
error.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
dmalloc_loc.h env.h error.h error_val.h version.h
+error_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
+ dmalloc_loc.h env.h error.h error_val.h version.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
heap.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
dmalloc_loc.h error.h error_val.h heap.h
+heap_sl.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
+ dmalloc_loc.h error.h error_val.h heap.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
malloc.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
malloc_funcs.h return.h
+malloc_sl.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
+ debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
+ malloc_funcs.h return.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
protect.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \
heap.h protect.h
+protect_sl.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \
+ heap.h protect.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
chunk_th.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
error_val.h heap.h
+chunk_th_sl.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
+ dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
+ error_val.h heap.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
error_th.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
dmalloc_loc.h env.h error.h error_val.h version.h
+error_th_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
+ dmalloc_loc.h env.h error.h error_val.h version.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
malloc_th.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
malloc_funcs.h return.h
+malloc_th_sl.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
+ debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
+ malloc_funcs.h return.h
+ rm -f $@
+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@

View File

@@ -0,0 +1,18 @@
Description: Fix LOCK_THREADS in settings.dist
This patch takes into account that if --enable-threads is used, LOCK_THREADS
doesn't get updated
Author: Markus Stenberg <markus.stenberg@conformiq.com>
Author: Daniel Rus Morales <danirus@tol-project.org>
Bug-Debian: http://bugs.debian.org/276457
--- dmalloc-5.5.1.orig/settings.dist 2007-03-25 21:16:43.000000000 +0200
+++ dmalloc-5.5.1/settings.dist 2007-04-27 20:56:49.000000000 +0200
@@ -409,7 +409,7 @@
*/
#ifndef LOCK_THREADS
-#define LOCK_THREADS 0
+#define LOCK_THREADS 1
#endif
#if LOCK_THREADS

View File

@@ -0,0 +1,109 @@
This patch makes configure use the cross ld and ar rather than the native tools.
It was build up by Yann E. MORIN <yann.morin.1998@anciens.enib.fr> from some
bits gathered from buildroot, which is LGPL v2.1
License for dmalloc is:
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies, and that the name of Gray Watson not be used in advertising
* or publicity pertaining to distribution of the document or software
* without specific, written prior permission.
*
* Gray Watson makes no representations about the suitability of the
* software described herein for any purpose. It is provided "as is"
* without express or implied warranty.
I personnaly believe that the resulting code should therefore be
LGPL v2.1, but don't believe me, ask your lawyers!
Index: dmalloc-5.5.2/configure.ac
===================================================================
--- dmalloc-5.5.2.orig/configure.ac
+++ dmalloc-5.5.2/configure.ac
@@ -69,6 +69,15 @@ if test "$ac_cv_prog_cc_stdc" = "no" ; t
fi
AC_PROG_INSTALL
AC_PROG_RANLIB
+AN_MAKEVAR([AR], [AC_PROG_AR])
+AN_PROGRAM([ar], [AC_PROG_AR])
+AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
+AC_PROG_AR
+AN_MAKEVAR([LD], [AC_PROG_LD])
+AN_PROGRAM([ld], [AC_PROG_LD])
+AC_DEFUN([AC_PROG_LD], [AC_CHECK_TOOL(LD, ld, :)])
+AC_PROG_LD
+
AC_C_CONST
# we need this for various settings
@@ -131,14 +140,14 @@ AC_SUBST(shlibdir)
AC_MSG_CHECKING([shared library link args])
AC_COMPILE_IFELSE([ int foo(int val) { return val + 1; } ],[
# so now we try to create an archive from the compiled .o file
- (ar cr conftest.a conftest.o) 2>&5
+ (${ac_cv_prog_AR} cr conftest.a conftest.o) 2>&5
# see which shared-library ld commands work
#
# Darwin/Mac OS X - Terry Teague
# username terry_teague at domain users.sourceforge.net
ac_cv_shared_lib_link_objs=no
if test `uname` = "Darwin"; then
- if (ld -dylib -o conftest.so.t -lc conftest.a) 2>&5; then
+ if (${ac_cv_prog_LD} -dylib -o conftest.so.t -lc conftest.a) 2>&5; then
# By convention on some platforms
# libLLL.so, libLLL.X.so are symlinks to libLLL.X.Y.Z.so
# where X.Y.Z is version # (major.minor.increment) of the library
@@ -156,12 +165,12 @@ AC_COMPILE_IFELSE([ int foo(int val) { r
ac_cv_shared_link_args='# Could not configure shlib linking'
enable_shlib=no
fi
- elif (ld -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
- ac_cv_shared_link_args='ld -shared --whole-archive -soname $@ -o $@.t'
- elif (ld -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
- ac_cv_shared_link_args='ld -shared -o $@.t -all -soname $@ -none -lc -all'
- elif (ld -G -o conftest.so.t conftest.a) 2>&5; then
- ac_cv_shared_link_args='ld -G -o $@.t'
+ elif (${ac_cv_prog_LD} -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
+ ac_cv_shared_link_args='${CC} -Wl,-shared -Wl,--whole-archive -Wl,-soname,$@ -o $@.t -Wl,--no-whole-archive'
+ elif (${ac_cv_prog_LD} -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
+ ac_cv_shared_link_args='${CC} -Wl,-shared -o $@.t -Wl,-all -Wl,-soname,$@ -Wl,-none -lc -Wl,-all'
+ elif (${ac_cv_prog_LD} -G -o conftest.so.t conftest.a) 2>&5; then
+ ac_cv_shared_link_args='${CC} -Wl,-G -o $@.t'
else
# oh well, toss an error
ac_cv_shared_link_args='# Could not configure shlib linking'
Index: dmalloc-5.5.2/Makefile.in
===================================================================
--- dmalloc-5.5.2.orig/Makefile.in
+++ dmalloc-5.5.2/Makefile.in
@@ -263,25 +263,25 @@ $(LIB_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL)
$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
$(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
- ar cr $@ $?
+ @AR@ cr $@ $?
@RANLIB@ $@
$(LIB_TH) : $(OBJS) $(THREAD_OBJS)
- ar cr $@ $?
+ @AR@ cr $@ $?
@RANLIB@ $@
$(LIB_TH_SL) : $(OBJS_SL) $(THREAD_OBJS_SL)
$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
$(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
- ar cr $@ $?
+ @AR@ cr $@ $?
@RANLIB@ $@
$(LIB_CXX_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
$(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
- ar cr $@ $?
+ @AR@ cr $@ $?
@RANLIB@ $@
$(LIB_TH_CXX_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)

View File

@@ -0,0 +1,38 @@
Index: dmalloc-5.5.2/Makefile.in
===================================================================
--- dmalloc-5.5.2.orig/Makefile.in
+++ dmalloc-5.5.2/Makefile.in
@@ -260,7 +260,7 @@ shlib : $(BUILD_SL)
# work on your operating system. Please send feedback to the author
# via: http://256.com/gray/email.html
$(LIB_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL)
- $(CC) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
+ $(CC) $(LDFLAGS) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
$(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
ar cr $@ $?
@@ -271,21 +271,21 @@ $(LIB_TH) : $(OBJS) $(THREAD_OBJS)
@RANLIB@ $@
$(LIB_TH_SL) : $(OBJS_SL) $(THREAD_OBJS_SL)
- $(CC) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
+ $(CC) $(LDFLAGS) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
$(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
ar cr $@ $?
@RANLIB@ $@
$(LIB_CXX_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
- $(CC) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
+ $(CC) $(LDFLAGS) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
$(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
ar cr $@ $?
@RANLIB@ $@
$(LIB_TH_CXX_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
- $(CC) -shared -Wl,-soname,libdmallocthcxx.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
+ $(CC) $(LDFLAGS) -shared -Wl,-soname,libdmallocthcxx.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
threadssl : $(LIB_TH_SL)$(ver)

View File

@@ -0,0 +1,90 @@
Patch to correctly handle the MIPS case.
It was build up by Yann E. MORIN <yann.morin.1998@anciens.enib.fr> from some
bits gathered from buildroot, which is LGPL v2.1
License for dmalloc is:
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies, and that the name of Gray Watson not be used in advertising
* or publicity pertaining to distribution of the document or software
* without specific, written prior permission.
*
* Gray Watson makes no representations about the suitability of the
* software described herein for any purpose. It is provided "as is"
* without express or implied warranty.
I personnaly believe that the resulting code should therefore be
LGPL v2.1, but don't believe me, ask your lawyers!
Index: dmalloc-5.5.2/return.h
===================================================================
--- dmalloc-5.5.2.orig/return.h
+++ dmalloc-5.5.2/return.h
@@ -106,26 +106,16 @@
/*************************************/
/*
- * For DEC Mips machines running Ultrix
+ * For Mips machines running Linux
*/
#if __mips
/*
- * I have no idea how to get inline assembly with the default cc.
- * Anyone know how?
- */
-
-#if 0
-
-/*
* NOTE: we assume here that file is global.
*
- * $31 is the frame pointer. $2 looks to be the return address but maybe
- * not consistently.
+ * $31 is the return address.
*/
-#define GET_RET_ADDR(file) asm("sw $2, file")
-
-#endif
+#define GET_RET_ADDR(file) asm("sw $31, %0" : "=m" (file))
#endif /* __mips */
Index: dmalloc-5.5.2/configure.ac
===================================================================
--- dmalloc-5.5.2.orig/configure.ac
+++ dmalloc-5.5.2/configure.ac
@@ -585,31 +585,7 @@ int main() { return 1; }
# check if the return.h macros work
#
AC_MSG_CHECKING([return.h macros work])
-AC_RUN_IFELSE([
-
-#define __CONF_H__
-#define USE_RETURN_MACROS 1
-#define RETURN_MACROS_WORK 1
-
-#include "return.h"
-
-static void foo (void)
-{
- char *ret_addr;
- GET_RET_ADDR(ret_addr);
-}
-
-main()
-{
- foo();
- exit(0);
-}
-],
-[ AC_DEFINE(RETURN_MACROS_WORK, 1) AC_MSG_RESULT([yes]) ],
-[ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ],
-[ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ]
-)
-
+AC_DEFINE(RETURN_MACROS_WORK, 1)
##############################################################################
#

View File

@@ -0,0 +1,104 @@
Make install rules use DESTDIR.
Split installation of the utilitity from the global install.
Copyright 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Licensed to you as dmalloc-5.5.2 is.
Index: dmalloc-5.5.2/Makefile.in
===================================================================
--- dmalloc-5.5.2.orig/Makefile.in
+++ dmalloc-5.5.2/Makefile.in
@@ -178,66 +178,66 @@ distclean : clean
# rm -f configure
installdirs :
- $(srcdir)/mkinstalldirs $(includedir) $(libdir) $(bindir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(includedir) $(DESTDIR)/$(libdir) $(DESTDIR)/$(bindir)
installincs : $(HFLS)
- $(srcdir)/mkinstalldirs $(includedir)
- $(INSTALL_DATA) $(HFLS) $(includedir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(includedir)
+ $(INSTALL_DATA) $(HFLS) $(DESTDIR)/$(includedir)
installthsl : $(LIB_TH_SL)
- $(srcdir)/mkinstalldirs $(shlibdir)
- $(INSTALL) $(LIB_TH_SL) $(shlibdir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
+ $(INSTALL) $(LIB_TH_SL) $(DESTDIR)/$(shlibdir)
installth : $(INSTALL_THREADS)
- $(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL) $(LIB_TH) $(libdir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
+ $(INSTALL) $(LIB_TH) $(DESTDIR)/$(libdir)
@CXX_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
@SL_OFF@ @echo "Enter 'make installthsl' to install the threaded shared-library"
installthcxxsl : $(LIB_TH_CXX_SL)
- $(srcdir)/mkinstalldirs $(shlibdir)
- $(INSTALL) $(LIB_TH_CXX_SL) $(shlibdir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
+ $(INSTALL) $(LIB_TH_CXX_SL) $(DESTDIR)/$(shlibdir)
installthcxx : $(INSTALL_TH_CXX)
- $(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL) $(LIB_TH_CXX) $(libdir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
+ $(INSTALL) $(LIB_TH_CXX) $(DESTDIR)/$(libdir)
@SL_OFF@ @echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library"
installcxxsl : $(LIB_CXX_SL)
- $(srcdir)/mkinstalldirs $(shlibdir)
- $(INSTALL) $(LIB_CXX_SL) $(shlibdir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
+ $(INSTALL) $(LIB_CXX_SL) $(DESTDIR)/$(shlibdir)
installcxx : $(INSTALL_CXX)
- $(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL) $(LIB_CXX) $(libdir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
+ $(INSTALL) $(LIB_CXX) $(DESTDIR)/$(libdir)
@TH_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
@SL_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
installsl : $(LIB_SL)
- $(srcdir)/mkinstalldirs $(shlibdir)
- $(INSTALL) $(LIB_SL) $(shlibdir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
+ $(INSTALL) $(LIB_SL) $(DESTDIR)/$(shlibdir)
@CXX_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
@TH_OFF@ @echo "Enter 'make installthsl' to install thread shared-library"
installlib : $(INSTALL_LIB)
- $(srcdir)/mkinstalldirs $(libdir)
- $(INSTALL) $(LIBRARY) $(libdir)
- @RANLIB@ $(libdir)/$(LIBRARY)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
+ $(INSTALL) $(LIBRARY) $(DESTDIR)/$(libdir)
+ @RANLIB@ $(DESTDIR)/$(libdir)/$(LIBRARY)
@SL_OFF@ @echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)"
@CXX_OFF@ @echo "Enter 'make installcxx' to install the C++ library"
@TH_OFF@ @echo "Enter 'make installth' to install thread library"
installdocs : $(srcdir)/docs/$(HTMLFILE) $(srcdir)/docs/$(TEXIFILE) \
$(srcdir)/docs/$(PDFFILE)
- $(srcdir)/mkinstalldirs $(docdir)
- $(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(docdir)
- $(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(docdir)
- $(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(docdir)
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(docdir)
+ $(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(DESTDIR)/$(docdir)
+ $(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(DESTDIR)/$(docdir)
+ $(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(DESTDIR)/$(docdir)
install : installincs installlib $(UTIL)
- $(srcdir)/mkinstalldirs $(bindir)
- $(INSTALL_PROGRAM) $(UTIL) $(bindir)
- @echo "Enter 'make installdocs' to install $(DOCFILES) in $(docdir)"
+ $(srcdir)/mkinstalldirs $(DESTDIR)/$(bindir)
+ $(INSTALL_PROGRAM) $(UTIL) $(DESTDIR)/$(bindir)
+ @echo "Enter 'make installdocs' to install $(DOCFILES) in $(DESTDIR)/$(docdir)"
dmalloc.h.2 : $(srcdir)/configure
$(SHELL) $(srcdir)/configure

View File

@@ -0,0 +1,37 @@
We cant run tests during cross compile therefore pin to 4k pages
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: dmalloc-5.5.2/configure.ac
===================================================================
--- dmalloc-5.5.2.orig/configure.ac
+++ dmalloc-5.5.2/configure.ac
@@ -348,26 +348,8 @@ AC_MSG_RESULT([$ac_cv_use_mmap])
#
AC_CHECK_FUNCS(getpagesize)
AC_MSG_CHECKING([basic-block size])
-ac_cv_page_size=0
-if test $ac_cv_page_size = 0; then
- AC_RUN_IFELSE([main() { if (getpagesize()<=2048) exit(0); else exit(1); }],
- [ ac_cv_page_size=11 ] )
-fi
-if test $ac_cv_page_size = 0; then
- AC_RUN_IFELSE([main() { if (getpagesize()<=4096) exit(0); else exit(1); }],
- [ ac_cv_page_size=12 ] )
-fi
-if test $ac_cv_page_size = 0; then
- AC_RUN_IFELSE([main() { if (getpagesize()<=8192) exit(0); else exit(1); }],
- [ ac_cv_page_size=13 ] )
-fi
-if test $ac_cv_page_size = 0; then
- AC_RUN_IFELSE([main() { if (getpagesize()<=16384) exit(0); else exit(1); }],
- [ ac_cv_page_size=14 ] )
-fi
-if test $ac_cv_page_size = 0; then
- ac_cv_page_size=15
-fi
+# fix to 4K for now
+ac_cv_page_size=12
AC_DEFINE_UNQUOTED([BASIC_BLOCK],[$ac_cv_page_size])
AC_MSG_RESULT([$ac_cv_page_size])

View File

@@ -0,0 +1,39 @@
# Copyright (C) 2016 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "Debug Malloc Library"
DESCRIPTION = "The debug memory allocation or dmalloc library has been \
designed as a drop in replacement for the system's malloc, realloc, \
calloc, free and other memory management routines while providing \
powerful debugging facilities configurable at runtime. These facilities \
include such things as memory-leak tracking, fence-post write detection, \
file/line number reporting, and general logging of statistics."
HOMEPAGE = "http://dmalloc.com/"
LICENSE = "CC-BY-SA-3.0"
LIC_FILES_CHKSUM = "file://dmalloc.c;beginline=4;endline=17;md5=83d13664f87f1f1a3b6b2b6f6eba85aa"
SECTION = "libs"
SRC_URI = "http://dmalloc.com/releases/dmalloc-${PV}.tgz \
file://02-Makefile.in.patch \
file://03-threads.patch \
file://13-fix-ldflags-in-makefile.patch \
file://configure-pagesize-HACK.patch \
file://100-use-xtools.patch \
file://130-mips.patch \
file://150-use_DESTDIR.patch \
file://0001-undefined-strdup-macro.patch \
"
SRC_URI[md5sum] = "f92e5606c23a8092f3d5694e8d1c932e"
SRC_URI[sha256sum] = "d3be5c6eec24950cb3bd67dbfbcdf036f1278fae5fd78655ef8cdf9e911e428a"
ARM_INSTRUCTION_SET = "arm"
inherit autotools
EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
EXTRA_OECONF += "--enable-threads --enable-cxx --enable-shlib"

View File

@@ -0,0 +1,47 @@
SUMMARY = "A text-based user interface plugin of dnf for user to manage packages. "
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "git://github.com/ubinux/dnf-plugin-tui.git;branch=master;protocol=https"
SRCREV = "8d21f52577aa03958732a5a346a678c699e98cb6"
PV = "1.3"
SRC_URI:append:class-target = " file://oe-remote.repo.sample"
inherit setuptools3-base
S = "${WORKDIR}/git"
do_install:append() {
install -d ${D}${datadir}/dnf
install -m 0755 ${S}/samples/* ${D}${datadir}/dnf
install -d ${D}${PYTHON_SITEPACKAGES_DIR}/dnf-plugins/mkimg
install -m 0755 ${S}/dnf-plugins/mkimg/* ${D}${PYTHON_SITEPACKAGES_DIR}/dnf-plugins/mkimg
for file in $(ls ${S}/dnf-plugins/ | grep -v mkimg); do
install -m 0755 ${S}/dnf-plugins/$file ${D}${PYTHON_SITEPACKAGES_DIR}/dnf-plugins
done
}
do_install:append:class-target() {
install -d ${D}${sysconfdir}/yum.repos.d
install -m 0644 ${WORKDIR}/oe-remote.repo.sample ${D}${sysconfdir}/yum.repos.d
}
do_install:append:class-nativesdk() {
install -d -p ${D}/${SDKPATH}/postinst-intercepts
cp -r ${COREBASE}/scripts/postinst-intercepts/* ${D}/${SDKPATH}/postinst-intercepts/
sed -i -e 's/STAGING_DIR_NATIVE/NATIVE_ROOT/g' ${D}/${SDKPATH}/postinst-intercepts/*
}
FILES:${PN} += "${datadir}/dnf"
FILES:${PN} += "${SDKPATH}/postinst-intercepts"
RDEPENDS:${PN} += " \
bash \
dnf \
libnewt-python \
"
DEPENDS:append:class-nativesdk = " file-replacement-nativesdk"
BBCLASSEXTEND = "nativesdk"
SKIP_RECIPE[dnf-plugin-tui] ?= "${@bb.utils.contains('PACKAGE_CLASSES', 'package_rpm', '', 'does not build correctly without package_rpm in PACKAGE_CLASSES', d)}"

View File

@@ -0,0 +1,5 @@
[base]
name=myrepo
baseurl=http://127.0.0.1/oe_repo/
enabled=1
gpgcheck=0

View File

@@ -0,0 +1,37 @@
From 24650b0c7db6b213a2eaa5061b75b9f1b43f1ce9 Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <brgl@bgdev.pl>
Date: Fri, 23 Nov 2018 11:44:56 +0100
Subject: [PATCH] build: don't look for Iconv
Drop the find_package() for Iconv. CMake is unable to find iconv.h in
native build but all modern systems supply it as part of the standard
C library. We don't need this check in meta-openembedded.
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Upstream-Status: Inappropriate
- upstream doxygen must build on many architectures, this change is
too intrusive for upstream
---
CMakeLists.txt | 4 ----
1 file changed, 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06b9696f..f30b46b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -117,10 +117,6 @@ if (sqlite3)
endif()
endif()
-find_package(Iconv REQUIRED)
-include_directories(${ICONV_INCLUDE_DIR})
-
-
#set(DOXYDOCS ${PROJECT_SOURCE_DIR}/doc CACHE INTERNAL "Path to doxygen docs")
set(DOXYDOCS ${PROJECT_BINARY_DIR}/doc)
set(ENV{DOXYGEN_DOCDIR} ${DOXYDOCS})
--
2.27.0

View File

@@ -0,0 +1,232 @@
From daf686508f2ee4711d93e96e5b100e50bf161656 Mon Sep 17 00:00:00 2001
From: Leon Anavi <leon.anavi@konsulko.com>
Date: Wed, 26 Aug 2020 10:52:10 +0300
Subject: [PATCH] doxygen: Fix Python issues for doxygen-native
It fails to compile doxygen-native when /usr/bin/python is a link
to python3 on build host:
| Failed to import the site module
| Traceback (most recent call last):
| File "/usr/lib64/python3.6/site.py", line 564, in <module>
| main()
| File "/usr/lib64/python3.6/site.py", line 550, in main
| known_paths = addusersitepackages(known_paths)
| File "/usr/lib64/python3.6/site.py", line 282, in addusersitepackages
| user_site = getusersitepackages()
| File "/usr/lib64/python3.6/site.py", line 258, in getusersitepackages
| user_base = getuserbase() # this will also set USER_BASE
| File "/usr/lib64/python3.6/site.py", line 248, in getuserbase
| USER_BASE = get_config_var('userbase')
| File "/usr/lib64/python3.6/sysconfig.py", line 604, in get_config_var
| return get_config_vars().get(name)
| File "/usr/lib64/python3.6/sysconfig.py", line 553, in get_config_vars
| _init_posix(_CONFIG_VARS)
| File "/usr/lib64/python3.6/sysconfig.py", line 424, in _init_posix
| _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
| ModuleNotFoundError: No module named '_sysconfigdata'
Replace find_package PythonInterp with Python3 to fix this issue
that it uses python3 from python3-native. And it also replaces the
result variable PYTHON_EXECUTABLE with Python3_EXECUTABLE.
This patch is only needded by doxygen-native.
Updated to apply to release 1.9.1.
Upstream-Status: Inappropriate [oe specific]
Co-Authored-By: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
---
CMakeLists.txt | 2 +-
addon/doxywizard/CMakeLists.txt | 6 +++---
doc/CMakeLists.txt | 6 +++---
examples/CMakeLists.txt | 4 ++--
libmscgen/CMakeLists.txt | 2 +-
src/CMakeLists.txt | 10 +++++-----
testing/CMakeLists.txt | 4 ++--
7 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2455793..28f0d83 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -105,7 +105,7 @@ else ()
endif ()
find_program(DOT NAMES dot)
-find_package(PythonInterp REQUIRED)
+find_package(Python3 REQUIRED)
find_package(FLEX REQUIRED)
find_package(BISON REQUIRED)
if (BISON_VERSION VERSION_LESS 2.7)
diff --git a/addon/doxywizard/CMakeLists.txt b/addon/doxywizard/CMakeLists.txt
index 63ac8e3..d37d1d0 100644
--- a/addon/doxywizard/CMakeLists.txt
+++ b/addon/doxywizard/CMakeLists.txt
@@ -57,7 +57,7 @@ set_source_files_properties(${GENERATED_SRC_WIZARD}/settings.h PROPERTIES GENERA
# generate version.cpp
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/version.py ${VERSION} > ${GENERATED_SRC_WIZARD}/version.cpp
+ COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/version.py ${VERSION} > ${GENERATED_SRC_WIZARD}/version.cpp
DEPENDS ${PROJECT_SOURCE_DIR}/VERSION ${PROJECT_SOURCE_DIR}/src/version.py
OUTPUT ${GENERATED_SRC_WIZARD}/version.cpp
)
@@ -65,7 +65,7 @@ set_source_files_properties(${GENERATED_SRC_WIZARD}/version.cpp PROPERTIES GENER
# generate configdoc.cpp
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/configgen.py -wiz ${PROJECT_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC_WIZARD}/configdoc.cpp
+ COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/configgen.py -wiz ${PROJECT_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC_WIZARD}/configdoc.cpp
DEPENDS ${PROJECT_SOURCE_DIR}/src/configgen.py ${PROJECT_SOURCE_DIR}/src/config.xml
OUTPUT ${GENERATED_SRC_WIZARD}/configdoc.cpp
)
@@ -74,7 +74,7 @@ set_source_files_properties(${GENERATED_SRC_WIZARD}/configdoc.cpp PROPERTIES GEN
set(LEX_FILES config_doxyw)
foreach(lex_file ${LEX_FILES})
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/addon/doxywizard/${lex_file}.l > ${GENERATED_SRC_WIZARD}/${lex_file}.l.h
+ COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/addon/doxywizard/${lex_file}.l > ${GENERATED_SRC_WIZARD}/${lex_file}.l.h
DEPENDS ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/addon/doxywizard/${lex_file}.l
OUTPUT ${GENERATED_SRC_WIZARD}/${lex_file}.l.h
)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index ec63ceb..49a2bda 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -168,7 +168,7 @@ configure_file(${PROJECT_SOURCE_DIR}/doc/doxyindexer.1 ${PROJECT_BINARY_DIR
# doc/language.doc (see tag Doxyfile:INPUT)
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} translator.py ${PROJECT_SOURCE_DIR}
+ COMMAND ${Python3_EXECUTABLE} translator.py ${PROJECT_SOURCE_DIR}
DEPENDS ${PROJECT_SOURCE_DIR}/doc/maintainers.txt ${PROJECT_SOURCE_DIR}/doc/language.tpl ${PROJECT_BINARY_DIR}/doc/translator.py ${LANG_FILES}
OUTPUT language.doc
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc
@@ -177,7 +177,7 @@ set_source_files_properties(language.doc PROPERTIES GENERATED 1)
# doc/config.doc (see tag Doxyfile:INPUT)
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} ${TOP}/src/configgen.py -doc ${TOP}/src/config.xml > config.doc
+ COMMAND ${Python3_EXECUTABLE} ${TOP}/src/configgen.py -doc ${TOP}/src/config.xml > config.doc
DEPENDS ${TOP}/src/config.xml ${TOP}/src/configgen.py
OUTPUT config.doc
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc/
@@ -228,7 +228,7 @@ add_custom_target(docs_chm
COMMAND ${CMAKE_COMMAND} -E echo " for file in files:" >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py
COMMAND ${CMAKE_COMMAND} -E echo " if file.endswith('.html') or file.endswith('.png') or file.endswith('.css') or file.endswith('.gif'):" >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py
COMMAND ${CMAKE_COMMAND} -E echo " print(os.path.join(root, file))" >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py
- COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_BINARY_DIR}/chm ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual.hhp
+ COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_BINARY_DIR}/chm ${Python3_EXECUTABLE} ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual.hhp
COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_BINARY_DIR}/chm "${HTML_HELP_COMPILER}" doxygen_manual.hhp || echo > nul
COMMAND ${CMAKE_COMMAND} -E rename ${PROJECT_BINARY_DIR}/chm/index.chm ${PROJECT_BINARY_DIR}/chm/doxygen_manual.chm
DEPENDS ${PROJECT_BINARY_DIR}/doc/language.doc ${PROJECT_BINARY_DIR}/doc/config.doc
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 194b427..248b807 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -54,7 +54,7 @@ foreach (f_inp ${BASIC_EXAMPLES})
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/html/examples/${f}
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/latex/examples/${f}
COMMAND ${EXECUTABLE_OUTPUT_PATH}/doxygen ${f}.cfg
- COMMAND ${PYTHON_EXECUTABLE} ${TOP}/examples/strip_example.py < ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman.tex > ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman_doc.tex
+ COMMAND ${Python3_EXECUTABLE} ${TOP}/examples/strip_example.py < ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman.tex > ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman_doc.tex
DEPENDS doxygen ${f}.${f_ext} ${f}.cfg ${TOP}/examples/strip_example.py
OUTPUT ${PROJECT_BINARY_DIR}/html/examples/${f}/html/index.html ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman_doc.tex
)
@@ -73,7 +73,7 @@ if (DOT)
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/html/examples/diagrams
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/latex/examples/diagrams
COMMAND ${EXECUTABLE_OUTPUT_PATH}/doxygen diagrams.cfg
- COMMAND ${PYTHON_EXECUTABLE} ${TOP}/examples/strip_example.py < ${PROJECT_BINARY_DIR}/latex/examples/diagrams/latex/refman.tex > ${PROJECT_BINARY_DIR}/latex/examples/diagrams/latex/refman_doc.tex
+ COMMAND ${Python3_EXECUTABLE} ${TOP}/examples/strip_example.py < ${PROJECT_BINARY_DIR}/html/examples/diagrams/latex/refman.tex > ${PROJECT_BINARY_DIR}/html/examples/diagrams/latex/refman_doc.tex
DEPENDS doxygen diagrams_a.h diagrams_b.h diagrams_c.h diagrams_d.h diagrams_e.h diagrams.cfg ${TOP}/examples/strip_example.py
OUTPUT ${PROJECT_BINARY_DIR}/html/examples/diagrams/html/index.html ${PROJECT_BINARY_DIR}/latex/examples/diagrams/latex/refman_doc.tex
)
diff --git a/libmscgen/CMakeLists.txt b/libmscgen/CMakeLists.txt
index 34cf4d8..f015afc 100644
--- a/libmscgen/CMakeLists.txt
+++ b/libmscgen/CMakeLists.txt
@@ -7,7 +7,7 @@ include_directories(
set(LEX_FILES mscgen_lexer)
foreach(lex_file ${LEX_FILES})
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/libmscgen/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h
+ COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/libmscgen/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h
DEPENDS ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/libmscgen/${lex_file}.l
OUTPUT ${GENERATED_SRC}/${lex_file}.l.h
)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0e0c5f7..c1d3ca5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -40,7 +40,7 @@ set_source_files_properties(${GENERATED_SRC}/settings.h PROPERTIES GENERATED 1)
# configvalues.h
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/configgen.py -maph ${CMAKE_CURRENT_LIST_DIR}/config.xml > ${GENERATED_SRC}/configvalues.h
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/configgen.py -maph ${CMAKE_CURRENT_LIST_DIR}/config.xml > ${GENERATED_SRC}/configvalues.h
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/config.xml ${CMAKE_CURRENT_LIST_DIR}/configgen.py
OUTPUT ${GENERATED_SRC}/configvalues.h
)
@@ -52,7 +52,7 @@ add_custom_target(
# configvalues.cpp
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/configgen.py -maps ${CMAKE_CURRENT_LIST_DIR}/config.xml > ${GENERATED_SRC}/configvalues.cpp
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/configgen.py -maps ${CMAKE_CURRENT_LIST_DIR}/config.xml > ${GENERATED_SRC}/configvalues.cpp
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/config.xml ${CMAKE_CURRENT_LIST_DIR}/configgen.py
OUTPUT ${GENERATED_SRC}/configvalues.cpp
)
@@ -60,7 +60,7 @@ set_source_files_properties(${GENERATED_SRC}/configvalues.cpp PROPERTIES GENERAT
# configoptions.cpp
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/configgen.py -cpp ${CMAKE_CURRENT_LIST_DIR}/config.xml > ${GENERATED_SRC}/configoptions.cpp
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/configgen.py -cpp ${CMAKE_CURRENT_LIST_DIR}/config.xml > ${GENERATED_SRC}/configoptions.cpp
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/config.xml ${CMAKE_CURRENT_LIST_DIR}/configgen.py
OUTPUT ${GENERATED_SRC}/configoptions.cpp
)
@@ -95,7 +95,7 @@ endif()
# resources.cpp
add_custom_command(
COMMENT "Generating ${GENERATED_SRC}/resources.cpp"
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/res2cc_cmd.py ${PROJECT_SOURCE_DIR}/templates ${GENERATED_SRC}/resources.cpp
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/res2cc_cmd.py ${PROJECT_SOURCE_DIR}/templates ${GENERATED_SRC}/resources.cpp
DEPENDS ${RESOURCES} ${CMAKE_CURRENT_LIST_DIR}/res2cc_cmd.py
OUTPUT ${GENERATED_SRC}/resources.cpp
)
@@ -126,7 +126,7 @@ foreach(lex_file ${LEX_FILES})
set(LEX_FILES_H ${LEX_FILES_H} " " ${GENERATED_SRC}/${lex_file}.l.h CACHE INTERNAL "Stores generated files")
set(LEX_FILES_CPP ${LEX_FILES_CPP} " " ${GENERATED_SRC}/${lex_file}.cpp CACHE INTERNAL "Stores generated files")
add_custom_command(
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/scan_states.py ${CMAKE_CURRENT_LIST_DIR}/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/scan_states.py ${CMAKE_CURRENT_LIST_DIR}/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/scan_states.py ${CMAKE_CURRENT_LIST_DIR}/${lex_file}.l
OUTPUT ${GENERATED_SRC}/${lex_file}.l.h
)
diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt
index fd6912e..0af1865 100644
--- a/testing/CMakeLists.txt
+++ b/testing/CMakeLists.txt
@@ -1,7 +1,7 @@
# run all tests sequentially (keep for backward compatibility)
add_custom_target(tests
COMMENT "Running doxygen tests..."
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --doxygen ${PROJECT_BINARY_DIR}/bin/doxygen --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
+ COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --doxygen ${PROJECT_BINARY_DIR}/bin/doxygen --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
DEPENDS doxygen
)
@@ -19,6 +19,6 @@ foreach(TEST_FILE ${TEST_FILES})
string(REGEX REPLACE "^.*/([0-9][0-9][0-9]*).*$" "\\1" TEST_ID "${TEST_FILE}")
# add a test target for each test
add_test(NAME ${TEST_NAME}
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --id ${TEST_ID} --doxygen $<TARGET_FILE:doxygen> --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
+ COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --id ${TEST_ID} --doxygen $<TARGET_FILE:doxygen> --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
)
endforeach()

View File

@@ -0,0 +1,17 @@
DESCRIPTION = "Doxygen is the de facto standard tool for generating documentation from annotated C++ sources."
HOMEPAGE = "http://www.doxygen.org/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
DEPENDS = "flex-native bison-native"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.src.tar.gz \
file://0001-build-don-t-look-for-Iconv.patch \
"
SRC_URI:append:class-native = " file://doxygen-native-only-check-python3.patch"
SRC_URI[sha256sum] = "f352dbc3221af7012b7b00935f2dfdc9fb67a97d43287d2f6c81c50449d254e0"
inherit cmake python3native
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,15 @@
SUMMARY = "EditorConfig helps maintain consistent coding styles across various editors and IDEs."
HOMEPAGE = "https://https://editorconfig.org"
SECTION = "libs"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f515fff3ea0a2b9797eda60d83c0e5ca"
SRC_URI = "git://github.com/editorconfig/editorconfig-core-c.git;protocol=https;branch=master"
S = "${WORKDIR}/git"
SRCREV = "b7837029494c03af5ea70ed9d265e8c2123bff53"
inherit cmake
DEPENDS = "pcre2"

View File

@@ -0,0 +1,22 @@
SUMMARY = "Expression parser"
HOMEPAGE = "https://github.com/ArashPartow/exprtk"
SECTION = "libs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRCREV = "f46bffcd6966d38a09023fb37ba9335214c9b959"
SRC_URI = "git://github.com/ArashPartow/exprtk.git;branch=release;protocol=https"
S = "${WORKDIR}/git"
# other packages commonly reference the file directly as "exprtk.hpp"
# create symlink to allow this usage
do_install() {
install -d ${D}/${includedir}
install -m 0644 ${S}/exprtk.hpp ${D}/${includedir}/exprtk.hpp
}
# exprtk is a header only C++ library, so the main package will be empty.
RDEPENDS:${PN}-dev = ""
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,14 @@
SUMMARY = "small helper program to extract X.509 certificates from PKCS#11 tokens"
LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
DEPENDS = "openssl"
SRC_URI = "git://git.pengutronix.de/git/extract-cert;protocol=https;branch=master;"
SRCREV = "d652b4e8279aef2a85f58676ab472744bafeafc9"
S = "${WORKDIR}/git"
inherit meson pkgconfig
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,30 @@
SUMMARY = "Memory Efficient Serialization Library"
HOMEPAGE = "https://github.com/google/flatbuffers"
SECTION = "console/tools"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
require flatbuffers.inc
PACKAGE_BEFORE_PN = "${PN}-compiler"
DEPENDS = "flatbuffers-native"
RDEPENDS:${PN}-compiler = "${PN}"
RDEPENDS:${PN}-dev += "${PN}-compiler"
S = "${WORKDIR}/git"
CVE_CHECK_IGNORE += "CVE-2020-35864"
EXTRA_OECMAKE += " \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DFLATBUFFERS_BUILD_SHAREDLIB=ON \
"
EXTRA_OECMAKE:append:class-target = " -DFLATBUFFERS_FLATC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/flatc"
inherit cmake python3native
FILES:${PN}-compiler = "${bindir}"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,3 @@
PV = "23.1.4"
SRCREV = "af9ceabeef1a10c1004e2741f8c0c090ca59e5af"
SRC_URI = "git://github.com/google/flatbuffers.git;branch=master;protocol=https"

View File

@@ -0,0 +1,15 @@
SUMMARY = "Memory Efficient Serialization Library - Python3 Modules"
HOMEPAGE = "https://github.com/google/flatbuffers"
SECTION = "console/tools"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://../LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
require flatbuffers.inc
S = "${WORKDIR}/git/python"
RDEPENDS:${PN} = "flatbuffers"
inherit setuptools3
BBCLASSEXTEND = "native"

View File

@@ -0,0 +1,31 @@
From 0c24f99ca4d4f64ea8584347ca6ae0d638d625a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Mon, 18 Feb 2019 16:13:17 +0100
Subject: [PATCH] Use pkg-config to find gpgme
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
build/bundled/gpgme.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build/bundled/gpgme.m4 b/build/bundled/gpgme.m4
index 44bf43c..c9a8ae6 100644
--- a/build/bundled/gpgme.m4
+++ b/build/bundled/gpgme.m4
@@ -18,7 +18,7 @@ AC_DEFUN([_AM_PATH_GPGME_CONFIG],
if test "x$gpgme_config_prefix" != x ; then
GPGME_CONFIG="$gpgme_config_prefix/bin/gpgme-config"
fi
- AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
+ GPGME_CONFIG="pkg-config gpgme"
if test "$GPGME_CONFIG" != "no" ; then
gpgme_version=`$GPGME_CONFIG --version`
--
2.20.1

View File

@@ -0,0 +1,32 @@
From b2187b45f61ce362a9d58d9081d66daddb4e577f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 20 Mar 2022 15:54:14 -0700
Subject: [PATCH] geany.m4: Do not tinker with pkg-config paths
OE sets up these paths correctly w.r.t. target sysroot
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
build/geany.m4 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/build/geany.m4
+++ b/build/geany.m4
@@ -32,7 +32,8 @@ AC_DEFUN([GP_CHECK_GEANY],
[
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
- GP_GEANY_PKG_CONFIG_PATH_PUSH
+ dnl GP_GEANY_PKG_CONFIG_PATH_PUSH
+ AC_REQUIRE([_GP_GEANY_LIBDIR])
PKG_CHECK_MODULES([GEANY], [geany >= $1])
geanypluginsdir=$geany_libdir/geany
@@ -40,5 +41,5 @@ AC_DEFUN([GP_CHECK_GEANY],
AC_SUBST([geanypluginsdir])
AC_SUBST([GEANY_VERSION])
- GP_GEANY_PKG_CONFIG_PATH_POP
+ dnl GP_GEANY_PKG_CONFIG_PATH_POP
])

View File

@@ -0,0 +1,36 @@
From 90c46235ad69a411d83a5e978492421e8e378934 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 18 Feb 2022 23:35:58 -0800
Subject: [PATCH] git-changebar: Adjust structs for libgit2 1.4.x
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
git-changebar/src/gcb-plugin.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-changebar/src/gcb-plugin.c b/git-changebar/src/gcb-plugin.c
index f8ce20c..4488b22 100644
--- a/git-changebar/src/gcb-plugin.c
+++ b/git-changebar/src/gcb-plugin.c
@@ -216,7 +216,7 @@ static int
gcb_git_buf_grow (git_buf *buf,
size_t target_size)
{
- if (buf->asize == 0) {
+ if (buf->reserved == 0) {
if (target_size == 0) {
target_size = buf->size;
}
@@ -234,7 +234,7 @@ buf_zero (git_buf *buf)
if (buf) {
buf->ptr = NULL;
buf->size = 0;
- buf->asize = 0;
+ buf->reserved = 0;
}
}
--
2.35.1

Some files were not shown because too many files have changed in this diff Show More