diff options
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-devtools')
232 files changed, 14594 insertions, 0 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools-conf/android-gadget-setup b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools-conf/android-gadget-setup new file mode 100644 index 00000000..f7d99737 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools-conf/android-gadget-setup @@ -0,0 +1,25 @@ +#!/bin/sh + +# 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) + +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_usbid_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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools-conf_1.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools-conf_1.0.bb new file mode 100644 index 00000000..af98f92f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools-conf_1.0.bb @@ -0,0 +1,13 @@ +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} +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/adb.mk b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/adb.mk new file mode 100644 index 00000000..0687c22c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/adb.mk @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/adbd.mk b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/adbd.mk new file mode 100644 index 00000000..31452ae1 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/adbd.mk @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service new file mode 100644 index 00000000..ddf8d7f7 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0001-adb-remove-selinux-extensions.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0001-adb-remove-selinux-extensions.patch new file mode 100644 index 00000000..7d20c506 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0001-adb-remove-selinux-extensions.patch @@ -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); diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0002-adb-Use-local-sockets-where-appropriate.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0002-adb-Use-local-sockets-where-appropriate.patch new file mode 100644 index 00000000..3627110a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0002-adb-Use-local-sockets-where-appropriate.patch @@ -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) { diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0003-adb-define-shell-command.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0003-adb-define-shell-command.patch new file mode 100644 index 00000000..cf1d9cbc --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0003-adb-define-shell-command.patch @@ -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) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0004-adb-Fix-build-on-big-endian-systems.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0004-adb-Fix-build-on-big-endian-systems.patch new file mode 100644 index 00000000..79e9d4d3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0004-adb-Fix-build-on-big-endian-systems.patch @@ -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 + { diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0005-adb-add-base64-implementation.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0005-adb-add-base64-implementation.patch new file mode 100644 index 00000000..fcd4ae23 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0005-adb-add-base64-implementation.patch @@ -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); ++} ++ diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0006-adb-Musl-fixes.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0006-adb-Musl-fixes.patch new file mode 100644 index 00000000..b5d383f3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0006-adb-Musl-fixes.patch @@ -0,0 +1,131 @@ +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(-) + +diff --git a/adb/adb.h b/adb/adb.h +index 44e5981bdc..bcdc49f63c 100644 +--- 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() */ + +diff --git a/adb/disable_verity_service.c b/adb/disable_verity_service.c +index ed3da52108..29fa3d65a9 100644 +--- a/adb/disable_verity_service.c ++++ b/adb/disable_verity_service.c +@@ -14,25 +14,28 @@ + * 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 <unistd.h> ++#include <errno.h> ++#include <stdbool.h> + +-#include "cutils/properties.h" +-#include "ext4_sb.h" +-#include <fs_mgr.h> + + #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]; +diff --git a/adb/framebuffer_service.c b/adb/framebuffer_service.c +index 8cbe8403cc..8f0ccfb7aa 100644 +--- 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> +diff --git a/adb/sysdeps.h b/adb/sysdeps.h +index cc1f839e9f..ea39ac39cc 100644 +--- 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 fd, int pos, int where) + { + 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) + { diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0007-adb-usb_linux.c-fix-build-with-glibc-2.28.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0007-adb-usb_linux.c-fix-build-with-glibc-2.28.patch new file mode 100644 index 00000000..e02a9568 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0007-adb-usb_linux.c-fix-build-with-glibc-2.28.patch @@ -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> diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0008-adb-Allow-adbd-to-be-ran-as-root.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0008-adb-Allow-adbd-to-be-ran-as-root.patch new file mode 100644 index 00000000..7d223e05 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0008-adb-Allow-adbd-to-be-ran-as-root.patch @@ -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 + */ diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0009-mkbootimg-Add-dt-parameter-to-specify-DT-image.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0009-mkbootimg-Add-dt-parameter-to-specify-DT-image.patch new file mode 100644 index 00000000..a4dc6e1e --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0009-mkbootimg-Add-dt-parameter-to-specify-DT-image.patch @@ -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: diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0010-Use-linux-capability.h-on-linux-systems-too.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0010-Use-linux-capability.h-on-linux-systems-too.patch new file mode 100644 index 00000000..2c607ff6 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0010-Use-linux-capability.h-on-linux-systems-too.patch @@ -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" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0011-Remove-bionic-specific-calls.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0011-Remove-bionic-specific-calls.patch new file mode 100644 index 00000000..5b18f461 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0011-Remove-bionic-specific-calls.patch @@ -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; diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0012-Fix-implicit-declaration-of-stlcat-strlcopy-function.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0012-Fix-implicit-declaration-of-stlcat-strlcopy-function.patch new file mode 100644 index 00000000..b0feb659 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/core/0012-Fix-implicit-declaration-of-stlcat-strlcopy-function.patch @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/ext4_utils.mk b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/ext4_utils.mk new file mode 100644 index 00000000..c18aa9c4 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/ext4_utils.mk @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/extras/0001-ext4_utils-remove-selinux-extensions.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/extras/0001-ext4_utils-remove-selinux-extensions.patch new file mode 100644 index 00000000..4a19a5d6 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/extras/0001-ext4_utils-remove-selinux-extensions.patch @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/extras/0002-ext4_utils-add-o-argument-to-preserve-ownership.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/extras/0002-ext4_utils-add-o-argument-to-preserve-ownership.patch new file mode 100644 index 00000000..3b50ffbf --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/extras/0002-ext4_utils-add-o-argument-to-preserve-ownership.patch @@ -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; diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/fastboot.mk b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/fastboot.mk new file mode 100644 index 00000000..b9ba95f3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/fastboot.mk @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/gitignore b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/gitignore new file mode 100644 index 00000000..b034c10a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/gitignore @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-Remove-bionic-specific-calls.patch b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-Remove-bionic-specific-calls.patch new file mode 100644 index 00000000..9de2593d --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-Remove-bionic-specific-calls.patch @@ -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); diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/mkbootimg.mk b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/mkbootimg.mk new file mode 100644 index 00000000..519f609f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/mkbootimg.mk @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb new file mode 100644 index 00000000..2604f65e --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb @@ -0,0 +1,161 @@ +DESCRIPTION = "Different utilities from Android" +SECTION = "console/utils" +LICENSE = "Apache-2.0 & GPL-2.0 & 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;md5=801f80980d171dd6425610833a22dbe6 \ + file://${COMMON_LICENSE_DIR}/BSD-2-Clause;md5=8bef8e6712b1be5aa76af1ebde9d6378 \ + file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \ +" +DEPENDS = "libbsd libpcre zlib libcap" +DEPENDS_append_class-target = " openssl10" + +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" + +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://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://android-tools-adbd.service \ + 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" + +inherit systemd + +SYSTEMD_SERVICE_${PN} = "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 + ;; + mips|mipsel) + export android_arch=linux-mips + ;; + powerpc|powerpc64) + export android_arch=linux-ppc + ;; + i586|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" + +RDEPENDS_${BPN} = "${BPN}-conf bash" + +FILES_${PN}-fstools = "\ + ${bindir}/ext2simg \ + ${bindir}/ext4fixup \ + ${bindir}/img2simg \ + ${bindir}/make_ext4fs \ + ${bindir}/simg2img \ + ${bindir}/simg2simg \ + ${bindir}/simg_dump \ + ${bindir}/mkuserimg \ +" + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/bootchart/bootchart/0001-svg-add-rudimentary-support-for-ARM-cpuinfo.patch b/external/meta-openembedded/meta-oe/recipes-devtools/bootchart/bootchart/0001-svg-add-rudimentary-support-for-ARM-cpuinfo.patch new file mode 100644 index 00000000..4581ef25 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/bootchart/bootchart/0001-svg-add-rudimentary-support-for-ARM-cpuinfo.patch @@ -0,0 +1,49 @@ +From 8d40b4c286e005e82fa50b66fbbbde22b7e65e15 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Sun, 20 May 2012 21:35:34 +0200 +Subject: [PATCH 1/2] svg: add rudimentary support for ARM cpuinfo + +On ARM /proc/cpuinfo looks like this: + +root@beagleboneA3-0428:~# cat /proc/cpuinfo +Processor : ARMv7 Processor rev 2 (v7l) +BogoMIPS : 498.89 +Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls +CPU implementer : 0x41 +CPU architecture: 7 +CPU variant : 0x3 +CPU part : 0xc08 +CPU revision : 2 + +Hardware : am335xevm +Revision : 0000 +Serial : 0000000000000000 + +So no real way to get the actual SoC name, TI AM3359, but a lot better than 'Unknown' + +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> +--- + +Upstream-Status: submitted + + svg.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/svg.c b/svg.c +index 80e0292..53724b2 100644 +--- a/svg.c ++++ b/svg.c +@@ -178,6 +178,10 @@ void svg_title(void) + strncpy(cpu, &buf[13], 255); + break; + } ++ if (strstr(buf, "Processor")) { ++ strncpy(cpu, &buf[12], 255); ++ break; ++ } + } + fclose(f); + } +-- +1.7.10 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/bootchart/bootchart/0002-svg-open-etc-os-release-and-use-PRETTY_NAME-for-the-.patch b/external/meta-openembedded/meta-oe/recipes-devtools/bootchart/bootchart/0002-svg-open-etc-os-release-and-use-PRETTY_NAME-for-the-.patch new file mode 100644 index 00000000..f63d98ae --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/bootchart/bootchart/0002-svg-open-etc-os-release-and-use-PRETTY_NAME-for-the-.patch @@ -0,0 +1,39 @@ +From e3adb4c312c6ba3491b7c173559efac7a53e5abc Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Sun, 20 May 2012 22:12:29 +0200 +Subject: [PATCH 2/2] svg: open /etc/os-release and use PRETTY_NAME for the + 'Build' name + +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> +--- + +Upstream-Status: Submitted + + svg.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/svg.c b/svg.c +index 53724b2..c675d84 100644 +--- a/svg.c ++++ b/svg.c +@@ -194,6 +194,17 @@ void svg_title(void) + fclose(f); + } + ++ f = fopen("/etc/os-release", "r"); ++ if(f) { ++ while (fgets(buf, 255, f)) { ++ if (strstr(buf, "PRETTY_NAME=")) { ++ strncpy(build, &buf[12], 255); ++ break; ++ } ++ } ++ fclose(f); ++ } ++ + svg("<text class=\"t1\" x=\"0\" y=\"30\">Bootchart for %s - %s</text>\n", + uts.nodename, date); + svg("<text class=\"t2\" x=\"20\" y=\"50\">System: %s %s %s %s</text>\n", +-- +1.7.10 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/bootchart/bootchart_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/bootchart/bootchart_git.bb new file mode 100644 index 00000000..2b75eaac --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/bootchart/bootchart_git.bb @@ -0,0 +1,21 @@ +DESCRIPTION = "Monitors where the system spends its time at start, creating a graph of all processes, disk utilization, and wait time." +HOMEPAGE = "http://meego.gitorious.org/meego-developer-tools/bootchart" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=fcb02dc552a041dee27e4b85c7396067" + +PV = "1.17" +PR = "r1" +PE = "1" + +SRC_URI = "git://gitorious.org/meego-developer-tools/bootchart.git;protocol=https \ + file://0001-svg-add-rudimentary-support-for-ARM-cpuinfo.patch \ + file://0002-svg-open-etc-os-release-and-use-PRETTY_NAME-for-the-.patch \ +" + +SRCREV = "a2c7561d4060a9f075339bda89e793c76f2ff6dd" + +S = "${WORKDIR}/git" + +inherit autotools + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch new file mode 100644 index 00000000..07cb8a36 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch @@ -0,0 +1,242 @@ +From b90c8f3b60bfe5dbed2823620242e9d30b9eb28f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 28 Jun 2017 19:01:18 -0700 +Subject: [PATCH] Replace use of struct ucontext with ucontext_t + +glibc 2.26 would not expose struct ucontext anymore + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + .../linux/dump_writer_common/ucontext_reader.cc | 32 +++++++++++----------- + .../linux/dump_writer_common/ucontext_reader.h | 14 +++++----- + src/client/linux/handler/exception_handler.cc | 10 +++---- + src/client/linux/handler/exception_handler.h | 4 +-- + .../linux/microdump_writer/microdump_writer.cc | 2 +- + .../linux/minidump_writer/minidump_writer.cc | 2 +- + 6 files changed, 32 insertions(+), 32 deletions(-) + +diff --git a/src/client/linux/dump_writer_common/ucontext_reader.cc b/src/client/linux/dump_writer_common/ucontext_reader.cc +index c80724dd..052ce37c 100644 +--- a/src/client/linux/dump_writer_common/ucontext_reader.cc ++++ b/src/client/linux/dump_writer_common/ucontext_reader.cc +@@ -36,19 +36,19 @@ namespace google_breakpad { + + // Minidump defines register structures which are different from the raw + // structures which we get from the kernel. These are platform specific +-// functions to juggle the ucontext and user structures into minidump format. ++// functions to juggle the ucontext_t and user structures into minidump format. + + #if defined(__i386__) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[REG_ESP]; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[REG_EIP]; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct _libc_fpstate* fp) { + const greg_t* regs = uc->uc_mcontext.gregs; + +@@ -88,15 +88,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, + + #elif defined(__x86_64) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[REG_RSP]; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[REG_RIP]; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct _libc_fpstate* fpregs) { + const greg_t* regs = uc->uc_mcontext.gregs; + +@@ -145,15 +145,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, + + #elif defined(__ARM_EABI__) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.arm_sp; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.arm_pc; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { + out->context_flags = MD_CONTEXT_ARM_FULL; + + out->iregs[0] = uc->uc_mcontext.arm_r0; +@@ -184,15 +184,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { + + #elif defined(__aarch64__) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.sp; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.pc; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct fpsimd_context* fpregs) { + out->context_flags = MD_CONTEXT_ARM64_FULL; + +@@ -210,15 +210,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, + + #elif defined(__mips__) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.pc; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { + #if _MIPS_SIM == _ABI64 + out->context_flags = MD_CONTEXT_MIPS64_FULL; + #elif _MIPS_SIM == _ABIO32 +diff --git a/src/client/linux/dump_writer_common/ucontext_reader.h b/src/client/linux/dump_writer_common/ucontext_reader.h +index b6e77b4b..2de80b70 100644 +--- a/src/client/linux/dump_writer_common/ucontext_reader.h ++++ b/src/client/linux/dump_writer_common/ucontext_reader.h +@@ -39,23 +39,23 @@ + + namespace google_breakpad { + +-// Wraps platform-dependent implementations of accessors to ucontext structs. ++// Wraps platform-dependent implementations of accessors to ucontext_t structs. + struct UContextReader { +- static uintptr_t GetStackPointer(const struct ucontext* uc); ++ static uintptr_t GetStackPointer(const ucontext_t* uc); + +- static uintptr_t GetInstructionPointer(const struct ucontext* uc); ++ static uintptr_t GetInstructionPointer(const ucontext_t* uc); + +- // Juggle a arch-specific ucontext into a minidump format ++ // Juggle a arch-specific ucontext_t into a minidump format + // out: the minidump structure + // info: the collection of register structures. + #if defined(__i386__) || defined(__x86_64) +- static void FillCPUContext(RawContextCPU *out, const ucontext *uc, ++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct _libc_fpstate* fp); + #elif defined(__aarch64__) +- static void FillCPUContext(RawContextCPU *out, const ucontext *uc, ++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct fpsimd_context* fpregs); + #else +- static void FillCPUContext(RawContextCPU *out, const ucontext *uc); ++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc); + #endif + }; + +diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc +index 586d84e9..05936d28 100644 +--- a/src/client/linux/handler/exception_handler.cc ++++ b/src/client/linux/handler/exception_handler.cc +@@ -457,9 +457,9 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) { + // Fill in all the holes in the struct to make Valgrind happy. + memset(&g_crash_context_, 0, sizeof(g_crash_context_)); + memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t)); +- memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext)); ++ memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t)); + #if defined(__aarch64__) +- struct ucontext* uc_ptr = (struct ucontext*)uc; ++ ucontext_t* uc_ptr = (ucontext_t*)uc; + struct fpsimd_context* fp_ptr = + (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved; + if (fp_ptr->head.magic == FPSIMD_MAGIC) { +@@ -468,9 +468,9 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) { + } + #elif !defined(__ARM_EABI__) && !defined(__mips__) + // FP state is not part of user ABI on ARM Linux. +- // In case of MIPS Linux FP state is already part of struct ucontext ++ // In case of MIPS Linux FP state is already part of ucontext_t + // and 'float_state' is not a member of CrashContext. +- struct ucontext* uc_ptr = (struct ucontext*)uc; ++ ucontext_t* uc_ptr = (ucontext_t*)uc; + if (uc_ptr->uc_mcontext.fpregs) { + memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs, + sizeof(g_crash_context_.float_state)); +@@ -494,7 +494,7 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) { + // ExceptionHandler::HandleSignal(). + siginfo.si_code = SI_USER; + siginfo.si_pid = getpid(); +- struct ucontext context; ++ ucontext_t context; + getcontext(&context); + return HandleSignal(sig, &siginfo, &context); + } +diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h +index daba57e0..25598a29 100644 +--- a/src/client/linux/handler/exception_handler.h ++++ b/src/client/linux/handler/exception_handler.h +@@ -191,11 +191,11 @@ class ExceptionHandler { + struct CrashContext { + siginfo_t siginfo; + pid_t tid; // the crashing thread. +- struct ucontext context; ++ ucontext_t context; + #if !defined(__ARM_EABI__) && !defined(__mips__) + // #ifdef this out because FP state is not part of user ABI for Linux ARM. + // In case of MIPS Linux FP state is already part of struct +- // ucontext so 'float_state' is not required. ++ // ucontext_t so 'float_state' is not required. + fpstate_t float_state; + #endif + }; +diff --git a/src/client/linux/microdump_writer/microdump_writer.cc b/src/client/linux/microdump_writer/microdump_writer.cc +index 3764eec2..80ad5c46 100644 +--- a/src/client/linux/microdump_writer/microdump_writer.cc ++++ b/src/client/linux/microdump_writer/microdump_writer.cc +@@ -593,7 +593,7 @@ class MicrodumpWriter { + + void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); } + +- const struct ucontext* const ucontext_; ++ const ucontext_t* const ucontext_; + #if !defined(__ARM_EABI__) && !defined(__mips__) + const google_breakpad::fpstate_t* const float_state_; + #endif +diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc +index d11ba6e5..c7161434 100644 +--- a/src/client/linux/minidump_writer/minidump_writer.cc ++++ b/src/client/linux/minidump_writer/minidump_writer.cc +@@ -1323,7 +1323,7 @@ class MinidumpWriter { + const int fd_; // File descriptor where the minidum should be written. + const char* path_; // Path to the file where the minidum should be written. + +- const struct ucontext* const ucontext_; // also from the signal handler ++ const ucontext_t* const ucontext_; // also from the signal handler + #if !defined(__ARM_EABI__) && !defined(__mips__) + const google_breakpad::fpstate_t* const float_state_; // ditto + #endif +-- +2.13.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-Turn-off-sign-compare-for-musl-libc.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-Turn-off-sign-compare-for-musl-libc.patch new file mode 100644 index 00000000..33bae1a3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-Turn-off-sign-compare-for-musl-libc.patch @@ -0,0 +1,41 @@ +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(+) + +diff --git a/src/client/linux/crash_generation/crash_generation_server.cc b/src/client/linux/crash_generation/crash_generation_server.cc +index 2596afde..2faeb9e5 100644 +--- 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 revents) + // 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) { +-- +2.14.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-disable-calls-to-getcontext-with-musl.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-disable-calls-to-getcontext-with-musl.patch new file mode 100644 index 00000000..bc79727e --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-disable-calls-to-getcontext-with-musl.patch @@ -0,0 +1,49 @@ +From 57ecf7205feedd23f901e1bb9d193787e559e433 Mon Sep 17 00:00:00 2001 +From: Andre McCurdy <armccurdy@gmail.com> +Date: Tue, 23 Jan 2018 15:13:26 -0800 +Subject: [PATCH] disable calls to getcontext() with musl + +Signed-off-by: Andre McCurdy <armccurdy@gmail.com> +--- + src/client/linux/handler/exception_handler.cc | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +Index: git/src/client/linux/handler/exception_handler.cc +=================================================================== +--- git.orig/src/client/linux/handler/exception_handler.cc ++++ git/src/client/linux/handler/exception_handler.cc +@@ -495,7 +495,19 @@ bool ExceptionHandler::SimulateSignalDel + siginfo.si_code = SI_USER; + siginfo.si_pid = getpid(); + ucontext_t context; ++#if defined(__GLIBC__) + getcontext(&context); ++#else ++ // Extreme hack: Allow musl builds to compile - but don't expect them to work. ++ // Although musl provides a definition for getcontext() in ucontext.h (which ++ // enough to build libbreakpad_client) musl does not provide a corresponding ++ // getcontext() function, so builds will fail when attempting to link anything ++ // with libbreakpad_client. Disabling calls to getcontext() is a temporary ++ // hack. The real fix is probably to enable Breakpad's own implementation of ++ // getcontext() when building for musl (it's currently only enabled when ++ // building for Android). ++ memset (&context, 0, sizeof(context)); ++#endif + return HandleSignal(sig, &siginfo, &context); + } + +@@ -680,9 +692,14 @@ bool ExceptionHandler::WriteMinidump() { + sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); + + CrashContext context; ++#if defined(__GLIBC__) + int getcontext_result = getcontext(&context.context); + if (getcontext_result) + return false; ++#else ++ // Extreme hack - see comments above. ++ memset (&context.context, 0, sizeof(context.context)); ++#endif + + #if defined(__i386__) + // In CPUFillFromUContext in minidumpwriter.cc the stack pointer is retrieved diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch new file mode 100644 index 00000000..4583d601 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch @@ -0,0 +1,28 @@ +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(+) + +Index: git/src/common/linux/elf_core_dump.h +=================================================================== +--- git.orig/src/common/linux/elf_core_dump.h ++++ git/src/common/linux/elf_core_dump.h +@@ -33,10 +33,13 @@ + #ifndef COMMON_LINUX_ELF_CORE_DUMP_H_ + #define COMMON_LINUX_ELF_CORE_DUMP_H_ + ++#include <config.h> + #include <elf.h> + #include <link.h> + #include <stddef.h> +- ++#ifdef HAVE_SYS_REG_H ++#include <sys/reg.h> ++#endif + #include "common/memory_range.h" + + namespace google_breakpad { diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-lss-Match-syscalls-to-match-musl.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-lss-Match-syscalls-to-match-musl.patch new file mode 100644 index 00000000..2b892ad6 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0001-lss-Match-syscalls-to-match-musl.patch @@ -0,0 +1,45 @@ +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(+) + +Index: lss/linux_syscall_support.h +=================================================================== +--- lss.orig/linux_syscall_support.h ++++ lss/linux_syscall_support.h +@@ -793,6 +793,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 +@@ -924,6 +927,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 +@@ -1211,6 +1215,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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0002-Avoid-using-basename.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0002-Avoid-using-basename.patch new file mode 100644 index 00000000..bc628298 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0002-Avoid-using-basename.patch @@ -0,0 +1,29 @@ +From 806964f852773e427fea82a7716d44ce3be4498c Mon Sep 17 00:00:00 2001 +From: Felix Janda <felix.janda@posteo.de> +Date: Sun, 1 Feb 2015 14:27:32 +0100 +Subject: [PATCH 2/3] Avoid using basename + +--- + src/common/linux/dump_symbols.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc +index d029ca14..6ac4a17b 100644 +--- a/src/common/linux/dump_symbols.cc ++++ b/src/common/linux/dump_symbols.cc +@@ -881,9 +881,9 @@ const char* ElfArchitecture(const typename ElfClass::Ehdr* elf_header) { + // last slash, or the whole filename if there are no slashes. + string BaseFileName(const string &filename) { + // Lots of copies! basename's behavior is less than ideal. +- char* c_filename = strdup(filename.c_str()); +- string base = basename(c_filename); +- free(c_filename); ++ const char *c_filename = filename.c_str(); ++ const char *p = strrchr(c_filename, '/'); ++ string base = p ? p+1 : c_filename; + return base; + } + +-- +2.14.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch new file mode 100644 index 00000000..6c097cd2 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch @@ -0,0 +1,60 @@ +From 0ba1b3e35e7c743b670bedc3e90001dfb868df10 Mon Sep 17 00:00:00 2001 +From: Felix Janda <felix.janda@posteo.de> +Date: Sun, 1 Feb 2015 13:45:51 +0100 +Subject: [PATCH 2/6] Use _fpstate instead of _libc_fpstate on linux + +glibc defines both. musl libc only the former. +--- + src/client/linux/dump_writer_common/ucontext_reader.cc | 4 ++-- + src/client/linux/dump_writer_common/ucontext_reader.h | 2 +- + src/client/linux/minidump_writer/minidump_writer.h | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +Index: git/src/client/linux/dump_writer_common/ucontext_reader.cc +=================================================================== +--- git.orig/src/client/linux/dump_writer_common/ucontext_reader.cc ++++ git/src/client/linux/dump_writer_common/ucontext_reader.cc +@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstruction + } + + void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, +- const struct _libc_fpstate* fp) { ++ const struct _fpstate* fp) { + const greg_t* regs = uc->uc_mcontext.gregs; + + out->context_flags = MD_CONTEXT_X86_FULL | +@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstruction + } + + void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, +- const struct _libc_fpstate* fpregs) { ++ const struct _fpstate* fpregs) { + const greg_t* regs = uc->uc_mcontext.gregs; + + out->context_flags = MD_CONTEXT_AMD64_FULL; +Index: git/src/client/linux/dump_writer_common/ucontext_reader.h +=================================================================== +--- git.orig/src/client/linux/dump_writer_common/ucontext_reader.h ++++ git/src/client/linux/dump_writer_common/ucontext_reader.h +@@ -50,7 +50,7 @@ struct UContextReader { + // info: the collection of register structures. + #if defined(__i386__) || defined(__x86_64) + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, +- const struct _libc_fpstate* fp); ++ const struct _fpstate* fp); + #elif defined(__aarch64__) + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct fpsimd_context* fpregs); +Index: git/src/client/linux/minidump_writer/minidump_writer.h +=================================================================== +--- git.orig/src/client/linux/minidump_writer/minidump_writer.h ++++ git/src/client/linux/minidump_writer/minidump_writer.h +@@ -48,7 +48,7 @@ class ExceptionHandler; + #if defined(__aarch64__) + typedef struct fpsimd_context fpstate_t; + #elif !defined(__ARM_EABI__) && !defined(__mips__) +-typedef struct _libc_fpstate fpstate_t; ++typedef struct _fpstate fpstate_t; + #endif + + // These entries store a list of memory regions that the client wants included diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0002-sys-signal.h-is-a-nonportable-alias-for-signal.h.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0002-sys-signal.h-is-a-nonportable-alias-for-signal.h.patch new file mode 100644 index 00000000..cfd9a9b3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0002-sys-signal.h-is-a-nonportable-alias-for-signal.h.patch @@ -0,0 +1,26 @@ +From 15582e19c2545d5ffe8ff07f957d0ed602aeca74 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 14 Sep 2017 23:15:09 -0700 +Subject: [PATCH 2/5] <sys/signal.h> is a nonportable alias for <signal.h> + +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 05936d28..cca023fd 100644 +--- a/src/client/linux/handler/exception_handler.cc ++++ b/src/client/linux/handler/exception_handler.cc +@@ -78,7 +78,7 @@ + #include <sys/wait.h> + #include <unistd.h> + +-#include <sys/signal.h> ++#include <signal.h> + #include <sys/ucontext.h> + #include <sys/user.h> + #include <ucontext.h> +-- +2.14.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0003-Dont-include-stab.h.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0003-Dont-include-stab.h.patch new file mode 100644 index 00000000..2593ea93 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0003-Dont-include-stab.h.patch @@ -0,0 +1,88 @@ +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(-) + +Index: git/src/common/stabs_reader.cc +=================================================================== +--- git.orig/src/common/stabs_reader.cc ++++ git/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> +Index: git/src/common/stabs_reader.h +=================================================================== +--- git.orig/src/common/stabs_reader.h ++++ git/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> +Index: git/src/common/stabs_reader_unittest.cc +=================================================================== +--- git.orig/src/common/stabs_reader_unittest.cc ++++ git/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> +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac ++++ git/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/random.h]) ++AC_CHECK_HEADERS([a.out.h stab.h sys/random.h]) + AC_CHECK_FUNCS([arc4random getrandom]) + + AX_CXX_COMPILE_STDCXX(11, noext, mandatory) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch new file mode 100644 index 00000000..85100470 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch @@ -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 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch new file mode 100644 index 00000000..525a1555 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch @@ -0,0 +1,43 @@ +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(+) + +Index: git/src/common/dwarf/elf_reader.cc +=================================================================== +--- git.orig/src/common/dwarf/elf_reader.cc ++++ git/src/common/dwarf/elf_reader.cc +@@ -29,10 +29,13 @@ + #ifndef _GNU_SOURCE + #define _GNU_SOURCE // needed for pread() + #endif +- ++#include <config.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/mman.h> ++#ifdef HAVE_SYS_REG_H ++#include <sys/reg.h> ++#endif + #include <unistd.h> + #include <fcntl.h> + #include <string.h> +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac ++++ git/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/random.h]) ++AC_CHECK_HEADERS([a.out.h stab.h sys/random.h sys/reg.h]) + AC_CHECK_FUNCS([arc4random getrandom]) + + AX_CXX_COMPILE_STDCXX(11, noext, mandatory) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0005-md2core-Replace-basename.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0005-md2core-Replace-basename.patch new file mode 100644 index 00000000..852c1ed2 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/0005-md2core-Replace-basename.patch @@ -0,0 +1,38 @@ +From bbf2b5ed5d93b227df8aea5726727b48e29f6790 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 14 Sep 2017 23:35:40 -0700 +Subject: [PATCH 5/5] md2core: Replace basename() + +musl does not provide it + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/tools/linux/md2core/minidump-2-core.cc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc +index 6a9e28eb..52b81c22 100644 +--- a/src/tools/linux/md2core/minidump-2-core.cc ++++ b/src/tools/linux/md2core/minidump-2-core.cc +@@ -107,6 +107,9 @@ struct Options { + + static void + Usage(int argc, const char* argv[]) { ++ const char *c_filename = argv[0];; ++ const char *p = strrchr(c_filename, '/'); ++ const char *base = p ? p+1 : c_filename; + fprintf(stderr, + "Usage: %s [options] <minidump file>\n" + "\n" +@@ -133,7 +136,7 @@ Usage(int argc, const char* argv[]) { + " lookups to be done in this directory rather than the filesystem\n" + " layout as it exists in the crashing image. This path should end\n" + " with a slash if it's a directory. e.g. /var/lib/breakpad/\n" +- "", basename(argv[0])); ++ "", base); + } + + static void +-- +2.14.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/mcontext.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/mcontext.patch new file mode 100644 index 00000000..42e073b9 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/mcontext.patch @@ -0,0 +1,77 @@ +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/dump_writer_common/thread_info.cc +=================================================================== +--- git.orig/src/client/linux/dump_writer_common/thread_info.cc ++++ git/src/client/linux/dump_writer_common/thread_info.cc +@@ -229,7 +229,6 @@ void ThreadInfo::FillCPUContext(RawConte + } + + #elif defined(__mips__) +- + uintptr_t ThreadInfo::GetInstructionPointer() const { + return mcontext.pc; + } +@@ -263,8 +262,11 @@ void ThreadInfo::FillCPUContext(RawConte + out->cause = 0; // Not stored in mcontext + + for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) ++#ifdef __GLIBC__ + out->float_save.regs[i] = mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs; +- ++#else ++ out->float_save.regs[i] = mcontext.fpregs[i]; ++#endif + out->float_save.fpcsr = mcontext.fpc_csr; + #if _MIPS_SIM == _ABIO32 + out->float_save.fir = mcontext.fpc_eir; +Index: git/src/client/linux/dump_writer_common/ucontext_reader.cc +=================================================================== +--- git.orig/src/client/linux/dump_writer_common/ucontext_reader.cc ++++ git/src/client/linux/dump_writer_common/ucontext_reader.cc +@@ -247,8 +247,11 @@ void UContextReader::FillCPUContext(RawC + out->cause = 0; // Not reported in signal context. + + for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) ++#ifdef __GLIBC__ + out->float_save.regs[i] = uc->uc_mcontext.fpregs.fp_r.fp_dregs[i]; +- ++#else ++ out->float_save.regs[i] = uc->uc_mcontext.fpregs[i]; ++#endif + out->float_save.fpcsr = uc->uc_mcontext.fpc_csr; + #if _MIPS_SIM == _ABIO32 + out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused. +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__ +Index: git/src/tools/linux/md2core/minidump-2-core.cc +=================================================================== +--- git.orig/src/tools/linux/md2core/minidump-2-core.cc ++++ git/src/tools/linux/md2core/minidump-2-core.cc +@@ -516,8 +516,12 @@ ParseThreadRegisters(CrashedProcess::Thr + thread->mcontext.lo3 = rawregs->lo[2]; + + for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) { ++#ifdef __GLIBC__ + thread->mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs = + rawregs->float_save.regs[i]; ++#else ++ thread->mcontext.fpregs[i] = rawregs->float_save.regs[i]; ++#endif + } + + thread->mcontext.fpc_csr = rawregs->float_save.fpcsr; diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/mips_asm_sgidefs.patch b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/mips_asm_sgidefs.patch new file mode 100644 index 00000000..19bb5604 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad/mips_asm_sgidefs.patch @@ -0,0 +1,27 @@ +Index: lss/linux_syscall_support.h +=================================================================== +--- lss.orig/linux_syscall_support.h ++++ lss/linux_syscall_support.h +@@ -118,21 +118,13 @@ extern "C" { + #include <endian.h> + + #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 + + /* The Android NDK's <sys/stat.h> #defines these macros as aliases + * to their non-64 counterparts. To avoid naming conflict, remove them. */ +-#ifdef __ANDROID__ ++#if defined(__ANDROID__) || (defined(__linux__) && !defined(__glibc__)) + /* These are restored by the corresponding #pragma pop_macro near + * the end of this file. */ + # pragma push_macro("stat64") diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_git.bb new file mode 100644 index 00000000..d9773c9a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_git.bb @@ -0,0 +1,123 @@ +# 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=56c24a43c81c3af6fcf590851931489e" +SECTION = "libs" + +inherit autotools + +BBCLASSEXTEND = "native" + +PE = "1" + +PV = "1.0+git${SRCPV}" + +SRCREV_FORMAT = "breakpad_gtest_protobuf_lss_gyp" + +SRCREV_breakpad = "dea867e76f24e4a68395684b9d1cf24bcef82f20" +SRCREV_gtest = "ec44c6c1675c25b9827aacd08c02433cccde7780" +SRCREV_protobuf = "cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac" +SRCREV_lss = "a91633d172407f6c83dd69af11510b37afebb7f9" +SRCREV_gyp = "324dd166b7c0b39d513026fa52d6280ac6d56770" + +SRC_URI = "git://github.com/google/breakpad;name=breakpad \ + git://github.com/google/googletest.git;destsuffix=git/src/testing/gtest;name=gtest \ + git://github.com/google/protobuf.git;destsuffix=git/src/third_party/protobuf/protobuf;name=protobuf \ + git://chromium.googlesource.com/linux-syscall-support;protocol=https;destsuffix=git/src/third_party/lss;name=lss \ + git://chromium.googlesource.com/external/gyp;protocol=https;destsuffix=git/src/tools/gyp;name=gyp \ + file://0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch \ + file://0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch \ + file://0002-Avoid-using-basename.patch \ + file://0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch \ + file://0001-Turn-off-sign-compare-for-musl-libc.patch \ + file://0002-sys-signal.h-is-a-nonportable-alias-for-signal.h.patch \ + file://0003-Dont-include-stab.h.patch \ + file://0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch \ + file://0005-md2core-Replace-basename.patch \ + file://0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch \ + file://mcontext.patch \ + file://0001-disable-calls-to-getcontext-with-musl.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 \ +" +S = "${WORKDIR}/git" + +CXXFLAGS += "-D_GNU_SOURCE" + +COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*" + +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.h ${D}${includedir}/breakpad/common/memory.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 = "arm" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/capnproto/capnproto_0.6.1.bb b/external/meta-openembedded/meta-oe/recipes-devtools/capnproto/capnproto_0.6.1.bb new file mode 100644 index 00000000..6ca3613d --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/capnproto/capnproto_0.6.1.bb @@ -0,0 +1,24 @@ +SUMMARY = "Cap'n Proto serialization/RPC system" +DESCRIPTION = "Cap’n 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=0a5b5b742baf10cc1c158579eba7fb1d" + +SRC_URI = "git://github.com/sandstorm-io/capnproto.git;branch=release-${PV}" +SRCREV = "c949a18da5f041a36cc218c5c4b79c7705999b4f" + +S = "${WORKDIR}/git/c++" + +inherit cmake + +EXTRA_OECMAKE += "\ + -DBUILD_TESTING=OFF \ +" + +FILES_${PN}-compiler = "${bindir}" + +PACKAGE_BEFORE_PN = "${PN}-compiler" +RDEPENDS_${PN}-dev += "${PN}-compiler" + +BBCLASSEXTEND = "native nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/cgdb/cgdb/remove-help2man.patch b/external/meta-openembedded/meta-oe/recipes-devtools/cgdb/cgdb/remove-help2man.patch new file mode 100644 index 00000000..4358629b --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/cgdb/cgdb/remove-help2man.patch @@ -0,0 +1,47 @@ +Disable building manpages so that make install doesn't fail due to lack of help2man + +Upstream-Status: Inappropriate [config] + +Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com> +--- + configure.ac | 3 --- + doc/Makefile.am | 5 ----- + 2 files changed, 8 deletions(-) + +diff --git a/configure.ac b/configure.ac +index ee7eca0..1f0d924 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -134,9 +134,6 @@ dnl check that the required tools are available to generate documentation + if test "$HAS_MAKEINFO" != "yes" ; then + AC_MSG_ERROR([Please install makeinfo before installing]) + fi +-if test "$HAS_HELP2MAN" != "yes" ; then +- AC_MSG_ERROR([Please install help2man]) +-fi + + dnl Checking for log10 function in math - I would like to remove this + AC_CHECK_LIB(m, log10) +diff --git a/doc/Makefile.am b/doc/Makefile.am +index 60662f6..0ae0013 100644 +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -1,15 +1,10 @@ + info_TEXINFOS = cgdb.texi + cgdb_TEXINFOS = gpl.texi + +-dist_man_MANS = cgdb.1 + EXTRA_DIST = cgdb.txt + + dist_pkgdata_DATA = cgdb.txt + +-# generate the man page using help2man. +-cgdb.1: +- help2man --output=$(top_srcdir)/doc/cgdb.1 $(top_builddir)/cgdb/cgdb$(EXEEXT) +- + cgdb.txt: cgdb.texi $(srcdir)/version.texi $(cgdb_TEXINFOS) + TEXTS = cgdb.txt + text-am: $(TEXTS) +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/cgdb/cgdb_0.6.8.bb b/external/meta-openembedded/meta-oe/recipes-devtools/cgdb/cgdb_0.6.8.bb new file mode 100644 index 00000000..74019fb6 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/cgdb/cgdb_0.6.8.bb @@ -0,0 +1,21 @@ +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 = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +DEPENDS = "flex-native readline ncurses" + +inherit autotools + +SRC_URI = "http://cgdb.me/files/${BP}.tar.gz \ + file://remove-help2man.patch" +SRC_URI[md5sum] = "7bd38c79bf4d794d239928fef401fca3" +SRC_URI[sha256sum] = "be203e29be295097439ab67efe3dc8261f742c55ff3647718d67d52891f4cf41" + +CACHED_CONFIGUREVARS = "ac_cv_file__dev_ptmx=yes ac_cv_rl_version=6.2" +EXTRA_OECONF = "--with-readline=${STAGING_LIBDIR} \ + --with-ncurses=${STAGING_LIBDIR}" + +RDEPENDS_${PN} = "gdb" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9/cloud9-avahi.service b/external/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9/cloud9-avahi.service new file mode 100644 index 00000000..cb9b6e2d --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9/cloud9-avahi.service @@ -0,0 +1,10 @@ +<?xml version="1.0" standalone='no'?><!--*-nxml-*--> +<!DOCTYPE service-group SYSTEM "avahi-service.dtd"> + +<service-group> + <name replace-wildcards="yes">Cloud9 IDE on %h</name> + <service> + <type>_http._tcp</type> + <port>3000</port> + </service> +</service-group> diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9/cloud9.service b/external/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9/cloud9.service new file mode 100644 index 00000000..495b131f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9/cloud9.service @@ -0,0 +1,11 @@ +[Unit] +Description=Cloud9 IDE +ConditionPathExists=|/var/lib/cloud9 + +[Service] +Restart=always +EnvironmentFile=-/etc/default/node +ExecStart=/usr/bin/node4 /usr/share/cloud9/bin/cloud9.js -l 0.0.0.0 -w /var/lib/cloud9 -p 3000 + +[Install] +WantedBy=multi-user.target diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9/index.js b/external/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9/index.js new file mode 100644 index 00000000..88c9a19f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9/index.js @@ -0,0 +1,2 @@ +var o3 = require('./o3.js') +module.exports = o3.xml; diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/concurrencykit/concurrencykit/cross.patch b/external/meta-openembedded/meta-oe/recipes-devtools/concurrencykit/concurrencykit/cross.patch new file mode 100644 index 00000000..9e5058f2 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/concurrencykit/concurrencykit/cross.patch @@ -0,0 +1,62 @@ +From ab0eec78382bd00ce533aec2c84fd50c1733033d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 5 Jan 2013 19:42:51 -0800 + +--- + configure | 32 ++++++++++++++++++-------------- + 1 file changed, 18 insertions(+), 14 deletions(-) + +diff --git a/configure b/configure +index 76c2812..78ce2ff 100755 +--- a/configure ++++ b/configure +@@ -535,14 +535,18 @@ else + GZIP_SUFFIX=".gz" + fi + +-printf "Finding suitable compiler........" +-CC=`pathsearch "${CC:-cc}"` +-if test -z "$CC" -o ! -x "$CC"; then +- CC=`pathsearch "${CC:-gcc}"` ++if test -z "$CC"; then ++ printf "Finding suitable compiler........" ++ CC=`pathsearch "${CC:-cc}"` ++ if test -z "$CC" -o ! -x "$CC"; then ++ CC=`pathsearch "${CC:-gcc}"` ++ fi + fi + assert "$CC" "not found" + +-cat << EOF > .1.c ++if test -z "$COMPILER"; then ++ ++ cat << EOF > .1.c + #include <stdio.h> + int main(void) { + #if defined(_WIN32) +@@ -569,16 +573,16 @@ int main(void) { + #endif + } + EOF ++ $CC -o .1 .1.c ++ COMPILER=`./.1` ++ r=$? ++ rm -f .1.c .1 + +-$CC -o .1 .1.c +-COMPILER=`./.1` +-r=$? +-rm -f .1.c .1 +- +-if test "$r" -ne 0; then +- assert "" "update compiler" +-else +- echo "success [$CC]" ++ if test "$r" -ne 0; then ++ assert "" "update compiler" ++ else ++ echo "success [$CC]" ++ fi + fi + + if test "$COMPILER" = "suncc"; then diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/concurrencykit/concurrencykit_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/concurrencykit/concurrencykit_git.bb new file mode 100644 index 00000000..19767c31 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/concurrencykit/concurrencykit_git.bb @@ -0,0 +1,41 @@ +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 & Apache-2.0" +HOMEPAGE = "http://concurrencykit.org" +SECTION = "base" + +PV = "0.5.1+git${SRCPV}" +SRCREV = "f97d3da5c375ac2fc5a9173cdd36cb828915a2e1" +LIC_FILES_CHKSUM = "file://LICENSE;md5=a0b24c1a8f9ad516a297d055b0294231" +SRC_URI = "git://github.com/concurrencykit/ck.git \ + file://cross.patch \ +" + +S = "${WORKDIR}/git" + +COMPATIBLE_HOST = "(i.86|x86_64|powerpc|powerpc64).*-linux*" + +inherit autotools-brokensep + +PLAT_powerpc64 = "ppc64" +PLAT ?= "${HOST_ARCH}" + +do_configure () { + export PLATFORM=${PLAT} + export COMPILER='gcc' + ${S}/configure \ + --prefix=${prefix} \ + --includedir=${includedir} \ + --libdir=${libdir} +} + +do_compile () { + oe_runmake +} + +do_install () { + oe_runmake 'DESTDIR=${D}' install +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/cpuid/cpuid_20180519.bb b/external/meta-openembedded/meta-oe/recipes-devtools/cpuid/cpuid_20180519.bb new file mode 100644 index 00000000..533a0002 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/cpuid/cpuid_20180519.bb @@ -0,0 +1,21 @@ +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" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI = "http://www.etallen.com/${BPN}/${BP}.src.tar.gz \ + " +SRC_URI[md5sum] = "b3b4e44ef49575043a91def0207dcc76" +SRC_URI[sha256sum] = "967823be36f23cbc972eb0aa882d069c1d155a5978990ac3bcf425e6a2e7ff9a" + +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" + +# 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} +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/cscope/cscope_15.8b.bb b/external/meta-openembedded/meta-oe/recipes-devtools/cscope/cscope_15.8b.bb new file mode 100644 index 00000000..8aa5947d --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/cscope/cscope_15.8b.bb @@ -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" +LIC_FILES_CHKSUM = "file://COPYING;md5=d4667b67b483823043fcffa489ea343b" + +inherit autotools + +DEPENDS += "ncurses" + +SRC_URI = "http://downloads.sourceforge.net/project/cscope/cscope/${PV}/${BP}.tar.gz" + +SRC_URI[md5sum] = "8f9409a238ee313a96f9f87fe0f3b176" +SRC_URI[sha256sum] = "4889d091f05aa0845384b1e4965aa31d2b20911fb2c001b2cdcffbcb7212d3af" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ctags/ctags_5.8.bb b/external/meta-openembedded/meta-oe/recipes-devtools/ctags/ctags_5.8.bb new file mode 100644 index 00000000..d006d83a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ctags/ctags_5.8.bb @@ -0,0 +1,25 @@ +# Copyright (C) 2015 Igor Santos <igor.santos@aker.com.br> +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "Exuberant Ctags" +DESCRIPTION = "Exuberant 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 = "http://ctags.sourceforge.net/" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" + +inherit autotools-brokensep + +SRC_URI = "http://prdownloads.sourceforge.net/${BPN}/${BP}.tar.gz" + +SRC_URI[md5sum] = "c00f82ecdcc357434731913e5b48630d" +SRC_URI[sha256sum] = "0e44b45dcabe969e0bbbb11e30c246f81abe5d32012db37395eb57d66e9e99c7" + +do_install() { + install -Dm 755 ${B}/ctags ${D}${bindir}/ctags + install -Dm 644 ${B}/ctags.1 ${D}${mandir}/man1/ctags.1 +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/debootstrap/debootstrap/devices.tar.gz b/external/meta-openembedded/meta-oe/recipes-devtools/debootstrap/debootstrap/devices.tar.gz Binary files differnew file mode 100644 index 00000000..20eaba3a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/debootstrap/debootstrap/devices.tar.gz diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/debootstrap/debootstrap_1.0.67.bb b/external/meta-openembedded/meta-oe/recipes-devtools/debootstrap/debootstrap_1.0.67.bb new file mode 100644 index 00000000..8472aca6 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/debootstrap/debootstrap_1.0.67.bb @@ -0,0 +1,35 @@ +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" + +inherit pkgconfig + +SRC_URI = "\ + http://http.debian.net/debian/pool/main/d/debootstrap/debootstrap_1.0.67.tar.gz \ + file://devices.tar.gz;unpack=0 \ +" + +SRC_URI[md5sum] = "eacabfe2e45415af60b1d74c3a23418a" +SRC_URI[sha256sum] = "0a12e0a2bbff185d47711a716b1f2734856100e8784361203e834fed0cffa51b" + +S = "${WORKDIR}/${BP}" + +# All Makefile does is creation of devices.tar.gz, which fails in OE build, we use +# static devices.tar.gz as work around +# | NOTE: make -j 8 -e MAKEFLAGS= +# | rm -rf dev +# | mkdir -p dev +# | chown 0:0 dev +# | chown: changing ownership of `dev': Operation not permitted +# | make: *** [devices.tar.gz] Error 1 +# | WARNING: exit code 1 from a shell command. +do_compile_prepend() { + cp ${WORKDIR}/devices.tar.gz ${B} +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install + chown -R root:root ${D}${datadir}/debootstrap +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dejagnu/dejagnu/configure.patch b/external/meta-openembedded/meta-oe/recipes-devtools/dejagnu/dejagnu/configure.patch new file mode 100644 index 00000000..2eb8af71 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dejagnu/dejagnu/configure.patch @@ -0,0 +1,45 @@ +Index: dejagnu-1.4.4/configure.in +=================================================================== +--- dejagnu-1.4.4.orig/configure.in 2014-07-18 07:05:49.997481207 +0000 ++++ dejagnu-1.4.4/configure.in 2014-07-18 07:05:50.085481210 +0000 +@@ -1,10 +1,10 @@ + dnl Process this file with autoconf to produce a configure script. + AC_PREREQ(2.13) +-AC_INIT(runtest.exp) ++AC_INIT(dejagnu, 1.4.4) + dnl AC_CONFIG_AUX_DIR(..) + + dnl These are required by automake +-AM_INIT_AUTOMAKE(dejagnu, 1.4.4) ++AM_INIT_AUTOMAKE([foreign]) + AM_MAINTAINER_MODE + AC_PROG_MAKE_SET + +Index: dejagnu-1.4.4/example/calc/configure.in +=================================================================== +--- dejagnu-1.4.4.orig/example/calc/configure.in 2002-04-26 03:32:40.000000000 +0000 ++++ dejagnu-1.4.4/example/calc/configure.in 2014-07-18 07:11:59.085491266 +0000 +@@ -1,8 +1,8 @@ + dnl Process this file with autoconf to produce a configure script. + AC_PREREQ(2.5) +-AC_INIT(calc.c) ++AC_INIT(calc, 1.1) + AM_CONFIG_HEADER(calc.h) +-AM_INIT_AUTOMAKE(calc, 1.1) ++AM_INIT_AUTOMAKE([foreign]) + + AC_PROG_CC + AC_PROG_INSTALL +Index: dejagnu-1.4.4/example/hello/configure.in +=================================================================== +--- dejagnu-1.4.4.orig/example/hello/configure.in 2002-08-31 05:46:16.000000000 +0000 ++++ dejagnu-1.4.4/example/hello/configure.in 2014-07-18 07:12:23.721491937 +0000 +@@ -25,7 +25,7 @@ + # ------------------------------------------------------------------------ + + AC_INIT(helloworld, demo-version, philip.wilsey@ieee.org) +-AM_INIT_AUTOMAKE(helloworld, demo-version) ++AM_INIT_AUTOMAKE([foreign]) + + #AC_CONFIG_SRCDIR([hello.cc]) + #AC_CONFIG_HEADER([config.h]) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dejagnu/dejagnu_1.4.4.bb b/external/meta-openembedded/meta-oe/recipes-devtools/dejagnu/dejagnu_1.4.4.bb new file mode 100644 index 00000000..63726b23 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dejagnu/dejagnu_1.4.4.bb @@ -0,0 +1,14 @@ +SUMMARY = "GNU unit testing framework, written in Expect and Tcl" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b" +SECTION = "devel" + +inherit autotools + +SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \ + file://configure.patch" + +SRC_URI[md5sum] = "053f18fd5d00873de365413cab17a666" +SRC_URI[sha256sum] = "d0fbedef20fb0843318d60551023631176b27ceb1e11de7468a971770d0e048d" + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/0001-undefined-strdup-macro.patch b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/0001-undefined-strdup-macro.patch new file mode 100644 index 00000000..ea940e99 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/0001-undefined-strdup-macro.patch @@ -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 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/02-Makefile.in.patch b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/02-Makefile.in.patch new file mode 100644 index 00000000..967643ba --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/02-Makefile.in.patch @@ -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 ./$@ diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/03-threads.patch b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/03-threads.patch new file mode 100644 index 00000000..be094525 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/03-threads.patch @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/100-use-xtools.patch b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/100-use-xtools.patch new file mode 100644 index 00000000..e1db6905 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/100-use-xtools.patch @@ -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) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/13-fix-ldflags-in-makefile.patch b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/13-fix-ldflags-in-makefile.patch new file mode 100644 index 00000000..2581e548 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/13-fix-ldflags-in-makefile.patch @@ -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) + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/130-mips.patch b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/130-mips.patch new file mode 100644 index 00000000..935ac983 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/130-mips.patch @@ -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) + ############################################################################## + + # diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/150-use_DESTDIR.patch b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/150-use_DESTDIR.patch new file mode 100644 index 00000000..7edd4641 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/150-use_DESTDIR.patch @@ -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 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/configure-pagesize-HACK.patch b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/configure-pagesize-HACK.patch new file mode 100644 index 00000000..a5bd7366 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/configure-pagesize-HACK.patch @@ -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]) + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc_5.5.2.bb b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc_5.5.2.bb new file mode 100644 index 00000000..2f0d8a34 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc_5.5.2.bb @@ -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" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-correct-version-for-so-lib.patch b/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-correct-version-for-so-lib.patch new file mode 100644 index 00000000..a7a42f98 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-correct-version-for-so-lib.patch @@ -0,0 +1,26 @@ +From 8b44dc65d98d50b462843ac9dab6fe3fc25abe36 Mon Sep 17 00:00:00 2001 +From: Pascal Bach <pascal.bach@siemens.com> +Date: Fri, 12 May 2017 13:54:49 +0200 +Subject: [PATCH] correct version for so lib + +Upstream-Status: Pending + +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3670afe..f4fcd2c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -172,6 +172,7 @@ endif() + if(FLATBUFFERS_BUILD_SHAREDLIB) + add_library(flatbuffers_shared SHARED ${FlatBuffers_Library_SRCS}) + set_target_properties(flatbuffers_shared PROPERTIES OUTPUT_NAME flatbuffers) ++ set_target_properties(flatbuffers_shared PROPERTIES VERSION "${PV}") + endif() + + function(compile_flatbuffers_schema_to_cpp SRC_FBS) +-- +2.1.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-flatbuffers-Move-EndianSwap-template-to-flatbuffers-.patch b/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-flatbuffers-Move-EndianSwap-template-to-flatbuffers-.patch new file mode 100644 index 00000000..d736f012 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0001-flatbuffers-Move-EndianSwap-template-to-flatbuffers-.patch @@ -0,0 +1,113 @@ +From a614d8e20fa9e4fd16b699d581ddac2956c120f5 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 19 Sep 2017 10:04:02 -0700 +Subject: [PATCH 1/2] flatbuffers: Move EndianSwap template to + flatbuffers/base.h + +Clang complains +call to function 'EndianSwap' that is neither visible in the template definition nor found by argument-dependent lookup + return EndianSwap(t); + +This seems to be due to limitation of two-phase lookup of dependent names in template definitions + +Its not being found using associated namespaces therefore +it has to be made visible at the template definition site as well + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + include/flatbuffers/base.h | 33 +++++++++++++++++++++++++++++++++ + include/flatbuffers/flatbuffers.h | 32 -------------------------------- + 2 files changed, 33 insertions(+), 32 deletions(-) + +diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h +index f051755..c73fb2d 100644 +--- a/include/flatbuffers/base.h ++++ b/include/flatbuffers/base.h +@@ -150,6 +150,39 @@ typedef uintmax_t largest_scalar_t; + // We support aligning the contents of buffers up to this size. + #define FLATBUFFERS_MAX_ALIGNMENT 16 + ++template<typename T> T EndianSwap(T t) { ++ #if defined(_MSC_VER) ++ #define FLATBUFFERS_BYTESWAP16 _byteswap_ushort ++ #define FLATBUFFERS_BYTESWAP32 _byteswap_ulong ++ #define FLATBUFFERS_BYTESWAP64 _byteswap_uint64 ++ #else ++ #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 ++ // __builtin_bswap16 was missing prior to GCC 4.8. ++ #define FLATBUFFERS_BYTESWAP16(x) \ ++ static_cast<uint16_t>(__builtin_bswap32(static_cast<uint32_t>(x) << 16)) ++ #else ++ #define FLATBUFFERS_BYTESWAP16 __builtin_bswap16 ++ #endif ++ #define FLATBUFFERS_BYTESWAP32 __builtin_bswap32 ++ #define FLATBUFFERS_BYTESWAP64 __builtin_bswap64 ++ #endif ++ if (sizeof(T) == 1) { // Compile-time if-then's. ++ return t; ++ } else if (sizeof(T) == 2) { ++ auto r = FLATBUFFERS_BYTESWAP16(*reinterpret_cast<uint16_t *>(&t)); ++ return *reinterpret_cast<T *>(&r); ++ } else if (sizeof(T) == 4) { ++ auto r = FLATBUFFERS_BYTESWAP32(*reinterpret_cast<uint32_t *>(&t)); ++ return *reinterpret_cast<T *>(&r); ++ } else if (sizeof(T) == 8) { ++ auto r = FLATBUFFERS_BYTESWAP64(*reinterpret_cast<uint64_t *>(&t)); ++ return *reinterpret_cast<T *>(&r); ++ } else { ++ assert(0); ++ } ++} ++ ++ + template<typename T> T EndianScalar(T t) { + #if FLATBUFFERS_LITTLEENDIAN + return t; +diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h +index 9216cf4..f749dcb 100644 +--- a/include/flatbuffers/flatbuffers.h ++++ b/include/flatbuffers/flatbuffers.h +@@ -37,38 +37,6 @@ inline void EndianCheck() { + (void)endiantest; + } + +-template<typename T> T EndianSwap(T t) { +- #if defined(_MSC_VER) +- #define FLATBUFFERS_BYTESWAP16 _byteswap_ushort +- #define FLATBUFFERS_BYTESWAP32 _byteswap_ulong +- #define FLATBUFFERS_BYTESWAP64 _byteswap_uint64 +- #else +- #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 +- // __builtin_bswap16 was missing prior to GCC 4.8. +- #define FLATBUFFERS_BYTESWAP16(x) \ +- static_cast<uint16_t>(__builtin_bswap32(static_cast<uint32_t>(x) << 16)) +- #else +- #define FLATBUFFERS_BYTESWAP16 __builtin_bswap16 +- #endif +- #define FLATBUFFERS_BYTESWAP32 __builtin_bswap32 +- #define FLATBUFFERS_BYTESWAP64 __builtin_bswap64 +- #endif +- if (sizeof(T) == 1) { // Compile-time if-then's. +- return t; +- } else if (sizeof(T) == 2) { +- auto r = FLATBUFFERS_BYTESWAP16(*reinterpret_cast<uint16_t *>(&t)); +- return *reinterpret_cast<T *>(&r); +- } else if (sizeof(T) == 4) { +- auto r = FLATBUFFERS_BYTESWAP32(*reinterpret_cast<uint32_t *>(&t)); +- return *reinterpret_cast<T *>(&r); +- } else if (sizeof(T) == 8) { +- auto r = FLATBUFFERS_BYTESWAP64(*reinterpret_cast<uint64_t *>(&t)); +- return *reinterpret_cast<T *>(&r); +- } else { +- assert(0); +- } +-} +- + template<typename T> FLATBUFFERS_CONSTEXPR size_t AlignOf() { + #ifdef _MSC_VER + return __alignof(T); +-- +2.14.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0002-use-__builtin_bswap16-when-building-with-clang.patch b/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0002-use-__builtin_bswap16-when-building-with-clang.patch new file mode 100644 index 00000000..460159f2 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/files/0002-use-__builtin_bswap16-when-building-with-clang.patch @@ -0,0 +1,30 @@ +From 626fe5e043de25e970ebdf061b88c646fa689113 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 19 Sep 2017 10:09:31 -0700 +Subject: [PATCH 2/2] use __builtin_bswap16 when building with clang + +clang pretends to be gcc 4.2.0 and therefore the code does +not use __builtin_bswap16 but tries to synthesize it + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + include/flatbuffers/base.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h +index c73fb2d..13e8fac 100644 +--- a/include/flatbuffers/base.h ++++ b/include/flatbuffers/base.h +@@ -156,7 +156,7 @@ template<typename T> T EndianSwap(T t) { + #define FLATBUFFERS_BYTESWAP32 _byteswap_ulong + #define FLATBUFFERS_BYTESWAP64 _byteswap_uint64 + #else +- #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 ++ #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 && !defined(__clang__) + // __builtin_bswap16 was missing prior to GCC 4.8. + #define FLATBUFFERS_BYTESWAP16(x) \ + static_cast<uint16_t>(__builtin_bswap32(static_cast<uint32_t>(x) << 16)) +-- +2.14.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/flatbuffers_1.9.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/flatbuffers_1.9.0.bb new file mode 100644 index 00000000..a8df4448 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/flatbuffers/flatbuffers_1.9.0.bb @@ -0,0 +1,37 @@ +SUMMARY = "Memory Efficient Serialization Library" +HOMEPAGE = "https://github.com/google/flatbuffers" +SECTION = "console/tools" +LICENSE = "Apache-2.0" + +PACKAGE_BEFORE_PN = "${PN}-compiler" + +RDEPENDS_${PN}-compiler = "${PN}" +RDEPENDS_${PN}-dev += "${PN}-compiler" + +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a873c5645c184d51e0f9b34e1d7cf559" + +SRCREV = "25a15950f5a24d7217689739ed8f6dac64912d62" + +SRC_URI = "git://github.com/google/flatbuffers.git \ + file://0001-correct-version-for-so-lib.patch \ + file://0001-flatbuffers-Move-EndianSwap-template-to-flatbuffers-.patch \ + file://0002-use-__builtin_bswap16-when-building-with-clang.patch \ + " + +# Make sure C++11 is used, required for example for GCC 4.9 +CXXFLAGS += "-std=c++11" +BUILD_CXXFLAGS += "-std=c++11" + +EXTRA_OECMAKE += "\ + -DFLATBUFFERS_BUILD_TESTS=OFF \ + -DFLATBUFFERS_BUILD_SHAREDLIB=ON \ + -DPV=${PV} \ +" + +inherit cmake + +S = "${WORKDIR}/git" + +FILES_${PN}-compiler = "${bindir}" + +BBCLASSEXTEND = "native nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/geany/geany-plugins_1.31.bb b/external/meta-openembedded/meta-oe/recipes-devtools/geany/geany-plugins_1.31.bb new file mode 100644 index 00000000..d8f2f894 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/geany/geany-plugins_1.31.bb @@ -0,0 +1,271 @@ +DESCRIPTION = "A fast and lightweight IDE" +HOMEPAGE = "http://plugins.geany.org/" + +LICENSE_DEFAULT = "GPLv2" +LICENSE = "${LICENSE_DEFAULT} & BSD-2-Clause & GPLv3" + +python () { + for plugin in d.getVar('PLUGINS').split(): + if 'LICENSE_%s' % plugin not in d: + d.setVar('LICENSE_' + plugin, '${LICENSE_DEFAULT}') +} + +DEPENDS = " \ + fribidi \ + geany \ + libxml2 \ + libsoup-2.4 \ + enchant \ + intltool-native \ + libassuan \ + gpgme \ + vte9 \ + libgit2 \ +" + +inherit distro_features_check autotools pkgconfig gtk-icon-cache + +REQUIRED_DISTRO_FEATURES = "x11" + +SRC_URI = "http://plugins.geany.org/${PN}/${PN}-${PV}.tar.bz2" +SRC_URI[md5sum] = "808f9048b77fd9704569ed2ba12a56e9" +SRC_URI[sha256sum] = "76bd9e803db5a626b86669f08330cf95b8cc35057a1cdf65759bc00aef120e25" + +do_configure_prepend() { + rm -f ${S}/build/cache/glib-gettext.m4 +} + +FILES_${PN} += "${datadir}/icons" +FILES_${PN}-dev += "${libdir}/geany/*.la ${libdir}/${PN}/*/*.la" + +PLUGINS += "${PN}-addons" +LIC_FILES_CHKSUM += "file://addons/COPYING;md5=4325afd396febcb659c36b49533135d4" +FILES_${PN}-addons = "${libdir}/geany/addons.so" +RDEPENDS_${PN}-addons = "${PN}" + +PLUGINS += "${PN}-autoclose" +LIC_FILES_CHKSUM += "file://autoclose/COPYING;md5=751419260aa954499f7abaabaa882bbe" +FILES_${PN}-autoclose = "${libdir}/geany/autoclose.so" +RDEPENDS_${PN}-autoclose = "${PN}" + +PLUGINS += "${PN}-automark" +LIC_FILES_CHKSUM += "file://automark/COPYING;md5=751419260aa954499f7abaabaa882bbe" +FILES_${PN}-automark = "${libdir}/geany/automark.so" +RDEPENDS_${PN}-automark = "${PN}" + +PLUGINS += "${PN}-codenav" +LIC_FILES_CHKSUM += "file://codenav/COPYING;md5=751419260aa954499f7abaabaa882bbe" +FILES_${PN}-codenav = "${libdir}/geany/codenav.so" +RDEPENDS_${PN}-codenav = "${PN}" + +PLUGINS += "${PN}-commander" +LIC_FILES_CHKSUM += "file://commander/COPYING;md5=d32239bcb673463ab874e80d47fae504" +LICENSE_${PN}-commander = "GPLv3" +FILES_${PN}-commander = "${libdir}/geany/commander.so" +RDEPENDS_${PN}-commander = "${PN}" + +PLUGINS += "${PN}-debugger" +LIC_FILES_CHKSUM += "file://debugger/COPYING;md5=4325afd396febcb659c36b49533135d4" +FILES_${PN}-debugger = "${libdir}/geany/debugger.so ${datadir}/${PN}/debugger" +RDEPENDS_${PN}-debugger = "${PN}" + +PLUGINS += "${PN}-defineformat" +LIC_FILES_CHKSUM += "file://defineformat/COPYING;md5=751419260aa954499f7abaabaa882bbe" +FILES_${PN}-defineformat = "${libdir}/geany/defineformat.so" +RDEPENDS_${PN}-defineformat = "${PN}" + +# no gnome devhelp in some common layer +EXTRA_OECONF += "--disable-devhelp" +#PLUGINS += "${PN}-devhelp" +#LIC_FILES_CHKSUM += "file://devhelp/COPYING;md5=d32239bcb673463ab874e80d47fae504" +#LICENSE_${PN}-devhelp = "GPLv3" +#FILES_${PN}-devhelp = "${libdir}/geany/devhelp.so" +#RDEPENDS_${PN}-devhelp = "${PN}" + +PLUGINS += "${PN}-geanyctags" +LIC_FILES_CHKSUM += "file://geanyctags/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-geanyctags = "${libdir}/geany/geanyctags.so" +RDEPENDS_${PN}-geanyctags = "${PN}" + +PLUGINS += "${PN}-geanydoc" +LIC_FILES_CHKSUM += "file://geanydoc/COPYING;md5=d32239bcb673463ab874e80d47fae504" +LICENSE_${PN}-geanydoc = "GPLv3" +FILES_${PN}-geanydoc = "${libdir}/geany/geanydoc.so" +RDEPENDS_${PN}-geanydoc = "${PN}" + +PLUGINS += "${PN}-geanyextrasel" +LIC_FILES_CHKSUM += "file://geanyextrasel/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-geanyextrasel = "${libdir}/geany/geanyextrasel.so" +RDEPENDS_${PN}-geanyextrasel = "${PN}" + +PLUGINS += "${PN}-geanyinsertnum" +LIC_FILES_CHKSUM += "file://geanyinsertnum/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-geanyinsertnum = "${libdir}/geany/geanyinsertnum.so" +RDEPENDS_${PN}-geanyinsertnum = "${PN}" + +PLUGINS += "${PN}-geanylatex" +LIC_FILES_CHKSUM += "file://geanylatex/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-geanylatex = "${libdir}/geany/geanylatex.so" +RDEPENDS_${PN}-geanylatex = "${PN}" + +PLUGINS += "${PN}-geanylipsum" +LIC_FILES_CHKSUM += "file://lipsum/COPYING;md5=4325afd396febcb659c36b49533135d4" +FILES_${PN}-geanylipsum = "${libdir}/geany/lipsum.so" +RDEPENDS_${PN}-geanylipsum = "${PN}" + +# no lua: max supported version is 5.2 +EXTRA_OECONF += "--disable-geanylua" +#PLUGINS += "${PN}-geanylua" +#LIC_FILES_CHKSUM += "file://geanylua/COPYING;md5=4325afd396febcb659c36b49533135d4" +#FILES_${PN}-geanylua = "${libdir}/geany/geanylua.so ${libdir}/${PN}/geanylua/*.so" +#RDEPENDS_${PN}-geanylua = "${PN}" + +PLUGINS += "${PN}-geanymacro" +LIC_FILES_CHKSUM += "file://geanymacro/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-geanymacro = "${libdir}/geany/geanymacro.so" +RDEPENDS_${PN}-geanymacro = "${PN}" + +PLUGINS += "${PN}-geanyminiscript" +LIC_FILES_CHKSUM += "file://geanyminiscript/COPYING;md5=4325afd396febcb659c36b49533135d4" +FILES_${PN}-geanyminiscript = "${libdir}/geany/geanyminiscript.so" +RDEPENDS_${PN}-geanyminiscript = "${PN}" + +PLUGINS += "${PN}-geanynumberedbookmarks" +LIC_FILES_CHKSUM += "file://geanynumberedbookmarks/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-geanynumberedbookmarks = "${libdir}/geany/geanynumberedbookmarks.so" +RDEPENDS_${PN}-geanynumberedbookmarks = "${PN}" + +PLUGINS += "${PN}-geanypg" +LIC_FILES_CHKSUM += "file://geanypg/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" +FILES_${PN}-geanypg = "${libdir}/geany/geanypg.so" +RDEPENDS_${PN}-geanypg = "${PN}" + +PLUGINS += "${PN}-geanyprj" +LIC_FILES_CHKSUM += "file://geanyprj/COPYING;md5=d32239bcb673463ab874e80d47fae504" +LICENSE_${PN}-geanyprj = "GPLv3" +FILES_${PN}-geanyprj = "${libdir}/geany/geanyprj.so" +RDEPENDS_${PN}-geanyprj = "${PN}" + +# no gnome pygtk +EXTRA_OECONF += "--disable-geanypy" +#PLUGINS += "${PN}-geanypy" +#LIC_FILES_CHKSUM += "file://geanypy/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" +#FILES_${PN}-geanypy = "${libdir}/geany/geanypy.so" +#RDEPENDS_${PN}-geanypy = "${PN}" + +PLUGINS += "${PN}-geanyvc" +LIC_FILES_CHKSUM += "file://geanyvc/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-geanyvc = "${libdir}/geany/geanyvc.so" +RDEPENDS_${PN}-geanyvc = "${PN}" + +PLUGINS += "${PN}-geniuspaste" +LIC_FILES_CHKSUM += "file://geniuspaste/COPYING;md5=bfc203269f8862ebfc1198cdc809a95a" +FILES_${PN}-geniuspaste = "${libdir}/geany/geniuspaste.so ${datadir}/${PN}/geniuspaste" +RDEPENDS_${PN}-geniuspaste = "${PN}" + +PLUGINS += "${PN}-git-changebar" +LIC_FILES_CHKSUM += "file://git-changebar/COPYING;md5=d32239bcb673463ab874e80d47fae504" +LICENSE_${PN}-git-changebar = "GPLv3" +FILES_${PN}-git-changebar = "${libdir}/geany/git-changebar.so" +RDEPENDS_${PN}-git-changebar = "${PN}" + +PLUGINS += "${PN}-keyrecord" +LIC_FILES_CHKSUM += "file://keyrecord/COPYING;md5=751419260aa954499f7abaabaa882bbe" +FILES_${PN}-keyrecord = "${libdir}/geany/keyrecord.so" +RDEPENDS_${PN}-keyrecord = "${PN}" + +PLUGINS += "${PN}-lineoperations" +LIC_FILES_CHKSUM += "file://lineoperations/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-lineoperations = "${libdir}/geany/lineoperations.so" +RDEPENDS_${PN}-lineoperations = "${PN}" + +# no markdown - avoid floating dependencies +EXTRA_OECONF += " --disable-peg-markdown" +#PLUGINS += "${PN}-markdown" +#LIC_FILES_CHKSUM += "file://markdown/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" +#FILES_${PN}-markdown = "${libdir}/geany/markdown.so" +#RDEPENDS_${PN}-markdown = "${PN}" + +PLUGINS += "${PN}-multiterm" +LIC_FILES_CHKSUM += "file://multiterm/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" +FILES_${PN}-multiterm = "${libdir}/geany/multiterm.so" +RDEPENDS_${PN}-multiterm = "${PN}" + +PLUGINS += "${PN}-overview" +LIC_FILES_CHKSUM += "file://overview/overview/overviewplugin.c;beginline=4;endline=20;md5=1aa33522916cdeb46cccac0c629da0d0" +FILES_${PN}-overview = "${libdir}/geany/overview.so ${datadir}/${PN}/overview" +RDEPENDS_${PN}-overview = "${PN}" + +PLUGINS += "${PN}-pairtaghighlighter" +LICENSE_${PN}-pairtaghighlighter = "BSD-2-Clause" +LIC_FILES_CHKSUM += "file://pairtaghighlighter/COPYING;md5=d6d927525a612b3a8dbebc4b2e9b47c1" +FILES_${PN}-pairtaghighlighter = "${libdir}/geany/pairtaghighlighter.so" +RDEPENDS_${PN}-pairtaghighlighter = "${PN}" + +PLUGINS += "${PN}-pohelper" +LICENSE_${PN}-pohelper = "GPLv3" +LIC_FILES_CHKSUM += "file://pohelper/COPYING;md5=d32239bcb673463ab874e80d47fae504" +FILES_${PN}-pohelper = "${libdir}/geany/pohelper.so" +RDEPENDS_${PN}-pohelper = "${PN}" + +PLUGINS += "${PN}-pretty-printer" +LIC_FILES_CHKSUM += "file://pretty-printer/src/PrettyPrinter.c;beginline=1;endline=17;md5=1665115c2fadb17c1b53cdb4e43b2440" +FILES_${PN}-pretty-printer = "${libdir}/geany/pretty-printer.so" +RDEPENDS_${PN}-pretty-printer = "${PN}" + +PLUGINS += "${PN}-projectorganizer" +LIC_FILES_CHKSUM += "file://projectorganizer/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-projectorganizer = "${libdir}/geany/projectorganizer.so" +RDEPENDS_${PN}-projectorganizer = "${PN}" + +PLUGINS += "${PN}-scope" +LIC_FILES_CHKSUM += "file://scope/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-scope = "${libdir}/geany/scope.so" +RDEPENDS_${PN}-scope = "${PN}" + +PLUGINS += "${PN}-sendmail" +LIC_FILES_CHKSUM += "file://sendmail/COPYING;md5=c107cf754550e65755c42985a5d4e9c9" +FILES_${PN}-sendmail = "${libdir}/geany/sendmail.so" +RDEPENDS_${PN}-sendmail = "${PN}" + +PLUGINS += "${PN}-shiftcolumn" +LIC_FILES_CHKSUM += "file://shiftcolumn/COPYING;md5=751419260aa954499f7abaabaa882bbe" +FILES_${PN}-shiftcolumn = "${libdir}/geany/shiftcolumn.so" +RDEPENDS_${PN}-shiftcolumn = "${PN}" + +PLUGINS += "${PN}-spellcheck" +LIC_FILES_CHKSUM += "file://spellcheck/COPYING;md5=4325afd396febcb659c36b49533135d4" +FILES_${PN}-spellcheck = "${libdir}/geany/spellcheck.so" +RDEPENDS_${PN}-spellcheck = "${PN}" + +PLUGINS += "${PN}-tableconvert" +LIC_FILES_CHKSUM += "file://tableconvert/COPYING;md5=6753686878d090a1f3f9445661d3dfbc" +FILES_${PN}-tableconvert = "${libdir}/geany/tableconvert.so" +RDEPENDS_${PN}-tableconvert = "${PN}" + +PLUGINS += "${PN}-treebrowser" +LIC_FILES_CHKSUM += "file://treebrowser/README;beginline=67;endline=67;md5=52f90857fd1a9672111e472dd056a0d8" +FILES_${PN}-treebrowser = "${libdir}/geany/treebrowser.so" +RDEPENDS_${PN}-treebrowser = "${PN}" + +PLUGINS += "${PN}-updatechecker" +LIC_FILES_CHKSUM += "file://updatechecker/COPYING;md5=4325afd396febcb659c36b49533135d4" +FILES_${PN}-updatechecker = "${libdir}/geany/updatechecker.so" +RDEPENDS_${PN}-updatechecker = "${PN}" + +# no webkit - lasts ages and is not properly detected +EXTRA_OECONF += " --disable-webhelper" +#PLUGINS += "${PN}-webhelper" +#LIC_FILES_CHKSUM += "file://webhelper/COPYING;md5=d32239bcb673463ab874e80d47fae504" +#LICENSE_${PN}-webhelper = "GPLv3" +#FILES_${PN}-webhelper = "${libdir}/geany/webhelper.so" +#RDEPENDS_${PN}-webhelper = "${PN}" + +PLUGINS += "${PN}-xmlsnippets" +LIC_FILES_CHKSUM += "file://xmlsnippets/COPYING;md5=4325afd396febcb659c36b49533135d4" +FILES_${PN}-xmlsnippets = "${libdir}/geany/xmlsnippets.so" +RDEPENDS_${PN}-xmlsnippets = "${PN}" + +PACKAGES =+ "${PLUGINS}" +RDEPENDS_${PN} = "${PLUGINS}" +ALLOW_EMPTY_${PN} = "1" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/geany/geany_1.31.bb b/external/meta-openembedded/meta-oe/recipes-devtools/geany/geany_1.31.bb new file mode 100644 index 00000000..bb9d8bc2 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/geany/geany_1.31.bb @@ -0,0 +1,18 @@ +SUMMARY = "A fast and lightweight IDE" +HOMEPAGE = "http://www.geany.org/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=bd7b2c994af21d318bd2cd3b3f80c2d5" + +DEPENDS = "gtk+ libxml-parser-perl-native python3-docutils-native intltool-native" + +inherit distro_features_check autotools pkgconfig perlnative pythonnative gettext + +REQUIRED_DISTRO_FEATURES = "x11" + +SRC_URI = "http://download.geany.org/${BP}.tar.bz2" +SRC_URI[md5sum] = "386000be6b26972c6a699939c37cda34" +SRC_URI[sha256sum] = "30fdb906bb76c4251a8bcf83ee267db28c26ef6ab867668a782cec1164a3aba5" + +FILES_${PN} += "${datadir}/icons" + +EXTRA_OECONF = "--disable-html-docs" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/giflib/giflib_5.1.4.bb b/external/meta-openembedded/meta-oe/recipes-devtools/giflib/giflib_5.1.4.bb new file mode 100644 index 00000000..21fa352c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/giflib/giflib_5.1.4.bb @@ -0,0 +1,19 @@ +SUMMARY = "shared library for GIF images" +SECTION = "libs" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=ae11c61b04b2917be39b11f78d71519a" + +SRC_URI = "${SOURCEFORGE_MIRROR}/giflib/${BP}.tar.bz2" + +inherit autotools + +PACKAGES += "${PN}-utils" +FILES_${PN} = "${libdir}/libgif.so.*" +FILES_${PN}-utils = "${bindir}" + +BBCLASSEXTEND = "native" + +RDEPENDS_${PN}-utils = "perl" + +SRC_URI[md5sum] = "2c171ced93c0e83bb09e6ccad8e3ba2b" +SRC_URI[sha256sum] = "df27ec3ff24671f80b29e6ab1c4971059c14ac3db95406884fc26574631ba8d5" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/glade/glade/remove-yelp-help-rules-var.patch b/external/meta-openembedded/meta-oe/recipes-devtools/glade/glade/remove-yelp-help-rules-var.patch new file mode 100644 index 00000000..78a8719f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/glade/glade/remove-yelp-help-rules-var.patch @@ -0,0 +1,39 @@ +From 42efc94c11d510b41d8cf3407e1c3900eb52b600 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Thu, 4 Jun 2015 16:28:02 +0800 +Subject: [PATCH] Remove unused variable (YELP_HELP_RULES) + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + help/Makefile.am | 2 -- + help/Makefile.in | 2 -- + 2 files changed, 4 deletions(-) + +diff --git a/help/Makefile.am b/help/Makefile.am +index 50c0e84..5c5d2e9 100644 +--- a/help/Makefile.am ++++ b/help/Makefile.am +@@ -1,5 +1,3 @@ +-@YELP_HELP_RULES@ +- + HELP_ID = glade + + HELP_FILES = \ +diff --git a/help/Makefile.in b/help/Makefile.in +index 6978ea5..e1c7d3b 100644 +--- a/help/Makefile.in ++++ b/help/Makefile.in +@@ -521,8 +521,6 @@ uninstall-am: + + .PRECIOUS: Makefile + +-@YELP_HELP_RULES@ +- + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/glade/glade_3.22.1.bb b/external/meta-openembedded/meta-oe/recipes-devtools/glade/glade_3.22.1.bb new file mode 100644 index 00000000..bd4b586f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/glade/glade_3.22.1.bb @@ -0,0 +1,27 @@ +SUMMARY = "Glade - A User Interface Designer" +HOMEPAGE = "http://www.gnu.org/software/gnash" +LICENSE = "GPLv2 & LGPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=aabe87591cb8ae0f3c68be6977bb5522 \ + file://COPYING.GPL;md5=9ac2e7cff1ddaf48b6eab6028f23ef88 \ + file://COPYING.LGPL;md5=252890d9eee26aab7b432e8b8a616475" +DEPENDS = "gtk+ gtk+3 glib-2.0 libxml2 intltool-native \ + gnome-common-native \ +" + + +inherit distro_features_check autotools pkgconfig gnomebase gobject-introspection + +REQUIRED_DISTRO_FEATURES = "x11" + +SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/glade/3.22/glade-${PV}.tar.xz \ + file://remove-yelp-help-rules-var.patch \ + " +SRC_URI[md5sum] = "226802cf3b06861240524805aa6fe6ff" +SRC_URI[sha256sum] = "dff89a2ef2eaf000ff2a46979978d03cb9202cb04668e01d0ea5c5bb5547e39a" + +EXTRA_OECONF += "--disable-man-pages" + +FILES_${PN} += "${datadir}/* ${libdir}/glade/modules/libgladegtk.so" +FILES_${PN}-dev += "${libdir}/glade/modules/libgladegtk.la" +FILES_${PN}-dbg += "${libdir}/glade/modules/.debug/libgladegtk.so" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/icon-slicer/files/0001-Makefile.am-no-examples.patch b/external/meta-openembedded/meta-oe/recipes-devtools/icon-slicer/files/0001-Makefile.am-no-examples.patch new file mode 100644 index 00000000..5d83818c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/icon-slicer/files/0001-Makefile.am-no-examples.patch @@ -0,0 +1,27 @@ +From e6d53086524a94d27920614e38966020e0b2b3ef Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> +Date: Mon, 5 Nov 2012 11:25:02 +0100 +Subject: [PATCH] Makefile.am: no examples +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@googlemail.com> + +--- + Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 28ee7eb..af437a6 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1 +1 @@ +-SUBDIRS = src examples +\ No newline at end of file ++SUBDIRS = src +-- +1.7.6.5 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/icon-slicer/icon-slicer_0.3.bb b/external/meta-openembedded/meta-oe/recipes-devtools/icon-slicer/icon-slicer_0.3.bb new file mode 100644 index 00000000..9768a6e7 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/icon-slicer/icon-slicer_0.3.bb @@ -0,0 +1,13 @@ +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +DEPENDS = "gdk-pixbuf popt" + +SRC_URI = "http://freedesktop.org/software/${BPN}/releases/${BPN}-${PV}.tar.gz \ + file://0001-Makefile.am-no-examples.patch" +SRC_URI[md5sum] = "5c5374d4f265b0abe4daef1d03f87104" +SRC_URI[sha256sum] = "05f0216dd0c25a17859de66357f64da5033375b6fbf5f31ca54867311160b64d" + +inherit autotools pkgconfig + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-Fix-printd-formatting-strings.patch b/external/meta-openembedded/meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-Fix-printd-formatting-strings.patch new file mode 100644 index 00000000..5b9afd96 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-Fix-printd-formatting-strings.patch @@ -0,0 +1,54 @@ +From 86b4d398dbb95e2437b70eba3b30e995ec9be505 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 31 Aug 2017 20:47:50 -0700 +Subject: [PATCH] Fix printd formatting strings + +Fixes +error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/ipfilter.c | 2 +- + src/othptab.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/ipfilter.c b/src/ipfilter.c +index eb17ec7..8c76e4c 100644 +--- a/src/ipfilter.c ++++ b/src/ipfilter.c +@@ -146,7 +146,7 @@ void gethostparams(struct hostparams *data, char *init_saddr, char *init_smask, + snprintf(msgstr, 60, + "Invalid protocol input at or near token \"%s\"", + bptr); +- tui_error(ANYKEY_MSG, msgstr); ++ tui_error(ANYKEY_MSG, "%s", msgstr); + doagain = 1; + } else + doagain = 0; +diff --git a/src/othptab.c b/src/othptab.c +index 142c9c2..fe395c2 100644 +--- a/src/othptab.c ++++ b/src/othptab.c +@@ -410,7 +410,7 @@ void printothpentry(struct othptable *table, struct othptabent *entry, + break; + } + +- sprintf(scratchpad, rarp_mac_addr); ++ sprintf(scratchpad, "%s", rarp_mac_addr); + strcat(msgstring, scratchpad); + wattrset(table->othpwin, ARPATTR); + break; +@@ -485,7 +485,7 @@ void printothpentry(struct othptable *table, struct othptabent *entry, + wattrset(table->othpwin, UNKNIPATTR); + protptr = getprotobynumber(entry->protocol); + if (protptr != NULL) { +- sprintf(protname, protptr->p_aliases[0]); ++ sprintf(protname, "%s", protptr->p_aliases[0]); + } else { + sprintf(protname, "IP protocol"); + unknown = 1; +-- +2.14.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/iptraf/iptraf-ng/ncurses-config.patch b/external/meta-openembedded/meta-oe/recipes-devtools/iptraf/iptraf-ng/ncurses-config.patch new file mode 100644 index 00000000..65b92dad --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/iptraf/iptraf-ng/ncurses-config.patch @@ -0,0 +1,81 @@ +Use pkg-config to search for ncurses libraries + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending +Index: iptraf-ng-1.1.4/Makefile +=================================================================== +--- iptraf-ng-1.1.4.orig/Makefile ++++ iptraf-ng-1.1.4/Makefile +@@ -205,8 +205,8 @@ endif + + ifndef NCURSES_LDFLAGS + ifdef NEEDS_NCURSES5 +- NCURSES_CFLAGS := $(shell ncurses5-config --cflags 2>/dev/null) +- NCURSES_LDFLAGS := $(shell ncurses5-config --libs 2>/dev/null) ++ NCURSES_CFLAGS := $(shell pkg-config ncurses --cflags 2>/dev/null) ++ NCURSES_LDFLAGS := $(shell pkg-config ncurses --libs 2>/dev/null) + ifndef NO_PANEL + NCURSES_LDFLAGS += -lpanel + endif +@@ -215,8 +215,8 @@ endif + + ifndef NCURSES_LDFLAGS + ifdef NEEDS_NCURSESW5 +- NCURSES_CFLAGS := $(shell ncursesw5-config --cflags 2>/dev/null) +- NCURSES_LDFLAGS := $(shell ncursesw5-config --libs 2>/dev/null) ++ NCURSES_CFLAGS := $(shell p[k-config ncursesw --cflags 2>/dev/null) ++ NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) + ifndef NO_PANEL + NCURSES_LDFLAGS += -lpanel + endif +@@ -225,8 +225,8 @@ endif + + ifndef NCURSES_LDFLAGS + ifdef NEEDS_NCURSES6 +- NCURSES_CFLAGS := $(shell ncurses6-config --cflags 2>/dev/null) +- NCURSES_LDFLAGS := $(shell ncurses6-config --libs 2>/dev/null) ++ NCURSES_CFLAGS := $(shell pkg-config ncurses6 --cflags 2>/dev/null) ++ NCURSES_LDFLAGS := $(shell pkg-config ncurses6 --libs 2>/dev/null) + ifndef NO_PANEL + NCURSES_LDFLAGS += -lpanel + endif +@@ -235,8 +235,8 @@ endif + + ifndef NCURSES_LDFLAGS + ifdef NEEDS_NCURSESW6 +- NCURSES_CFLAGS := $(shell ncursesw6-config --cflags 2>/dev/null) +- NCURSES_LDFLAGS := $(shell ncursesw6-config --libs 2>/dev/null) ++ NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 2>/dev/null) ++ NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) + ifndef NO_PANEL + NCURSES_LDFLAGS += -lpanel + endif +@@ -246,17 +246,17 @@ endif + # try find ncuses by autodetect + ifndef NCURSES_LDFLAGS + ifneq ($(shell ncursesw6-config --libs 2>/dev/null),) +- NCURSES_CFLAGS := $(shell ncursesw6-config --cflags 2>/dev/null) +- NCURSES_LDFLAGS := $(shell ncursesw6-config --libs 2>/dev/null) +- else ifneq ($(shell ncurses6-config --libs 2>/dev/null),) +- NCURSES_CFLAGS := $(shell ncurses6-config --cflags 2>/dev/null) +- NCURSES_LDFLAGS := $(shell ncurses6-config --libs 2>/dev/null) +- else ifneq ($(shell ncursesw5-config --libs 2>/dev/null),) +- NCURSES_CFLAGS := $(shell ncursesw5-config --cflags 2>/dev/null) +- NCURSES_LDFLAGS := $(shell ncursesw5-config --libs 2>/dev/null) +- else ifneq ($(shell ncurses5-config --libs 2>/dev/null),) +- NCURSES_CFLAGS := $(shell ncurses5-config --cflags 2>/dev/null) +- NCURSES_LDFLAGS := $(shell ncurses5-config --libs 2>/dev/null) ++ NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 2>/dev/null) ++ NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) ++ else ifneq ($(shell pkg-config ncurses --libs 2>/dev/null),) ++ NCURSES_CFLAGS := $(shell pkg-config ncurses --cflags 2>/dev/null) ++ NCURSES_LDFLAGS := $(shell pkg-config ncurses --libs 2>/dev/null) ++ else ifneq ($(shell pkg-config ncursesw --libs 2>/dev/null),) ++ NCURSES_CFLAGS := $(shell pkg-config ncursesw --cflags 2>/dev/null) ++ NCURSES_LDFLAGS := $(shell pkg-config ncursesw --libs 2>/dev/null) ++ else ifneq ($(shell pkg-config ncurses --libs 2>/dev/null),) ++ NCURSES_CFLAGS := $(shell pkg-config ncurses --cflags 2>/dev/null) ++ NCURSES_LDFLAGS := $(shell pkg-config ncurses --libs 2>/dev/null) + endif + + ifneq ($(NCURSES_LDFLAGS),) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/iptraf/iptraf-ng_1.1.4.bb b/external/meta-openembedded/meta-oe/recipes-devtools/iptraf/iptraf-ng_1.1.4.bb new file mode 100644 index 00000000..c53e6630 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/iptraf/iptraf-ng_1.1.4.bb @@ -0,0 +1,42 @@ +# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com> +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "A console-based network monitoring utility" +DESCRIPTION = "IPTraf-ng is a console-based network monitoring utility. IPTraf gathers \ +data like TCP connection packet and byte counts, interface statistics \ +and activity indicators, TCP/UDP traffic breakdowns, and LAN station \ +packet and byte counts. IPTraf-ng features include an IP traffic monitor \ +which shows TCP flag information, packet and byte counts, ICMP \ +details, OSPF packet types, and oversized IP packet warnings; \ +interface statistics showing IP, TCP, UDP, ICMP, non-IP and other IP \ +packet counts, IP checksum errors, interface activity and packet size \ +counts; a TCP and UDP service monitor showing counts of incoming and \ +outgoing packets for common TCP and UDP application ports, a LAN \ +statistics module that discovers active hosts and displays statistics \ +about their activity; TCP, UDP and other protocol display filters so \ +you can view just the traffic you want; logging; support for Ethernet, \ +FDDI, ISDN, SLIP, PPP, and loopback interfaces; and utilization of the \ +built-in raw socket interface of the Linux kernel, so it can be used \ +on a wide variety of supported network cards." + +HOMEPAGE = "https://fedorahosted.org/iptraf-ng/" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e2b3850593b899b1a17594ed4cc4c731" +DEPENDS = "ncurses" + +SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/iptraf-ng/iptraf-ng-1.1.4.tar.gz/e0f8df3b7baf2b5106709abc4f8c029a/${BP}.tar.gz \ + file://ncurses-config.patch \ + file://0001-Fix-printd-formatting-strings.patch \ + " +SRC_URI[md5sum] = "e0f8df3b7baf2b5106709abc4f8c029a" +SRC_URI[sha256sum] = "16b9b05bf5d3725d86409b901696639ad46944d02de6def87b1ceae5310dd35c" + +inherit autotools-brokensep pkgconfig + +CFLAGS += "-D_GNU_SOURCE" + +PROVIDES = "iptraf" +RPROVIDES_${PN} += "iptraf" +RREPLACES_${PN} += "iptraf" +RCONFLICTS_${PN} += "iptraf" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/jq/jq/Support-without-oniguruma.patch b/external/meta-openembedded/meta-oe/recipes-devtools/jq/jq/Support-without-oniguruma.patch new file mode 100644 index 00000000..1dfd955f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/jq/jq/Support-without-oniguruma.patch @@ -0,0 +1,68 @@ +From 18b4b18b41f5ed396d73449ce8d6ec408d95d6b2 Mon Sep 17 00:00:00 2001 +From: David Tolnay <dtolnay@gmail.com> +Date: Sat, 21 Nov 2015 10:05:37 -0800 +Subject: [PATCH] Support --without-oniguruma + +Upstream-Status: Backport + +Signed-off-by: Andre McCurdy <armccurdy@gmail.com> + +--- + configure.ac | 41 ++++++++++++++++++++--------------------- + 1 file changed, 20 insertions(+), 21 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 9e2c8cf..7f6be34 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -52,27 +52,26 @@ fi + AC_ARG_WITH([oniguruma], + [AS_HELP_STRING([--with-oniguruma=prefix], + [try this for a non-standard install prefix of the oniguruma library])], +- [ONIGURUMAPATHSET=1], +- [ONIGURUMAPATHSET=0]) +- +-if test $ONIGURUMAPATHSET = 1; then +- CFLAGS="$CFLAGS -I${with_oniguruma}/include" +- LDFLAGS="$LDFLAGS -L${with_oniguruma}/lib" +-fi +- +-# check for ONIGURUMA library +-HAVE_ONIGURUMA=0 +-AC_CHECK_HEADER("oniguruma.h", +- AC_CHECK_LIB([onig],[onig_version],[LIBS="$LIBS -lonig"; HAVE_ONIGURUMA=1;])) +- +-# handle check results +-if test $HAVE_ONIGURUMA != 1; then +- AC_MSG_NOTICE([Oniguruma was not found.]) +- AC_MSG_NOTICE([ Try setting the location using '--with-oniguruma=PREFIX' ]) +-else +- AC_DEFINE([HAVE_ONIGURUMA],1,[Define to 1 if Oniguruma is installed]) +-fi +- ++ [], ++ [with_oniguruma=yes]) ++ ++AS_IF([test "x$with_oniguruma" != xno], [ ++ AS_IF([test "x$with_oniguruma" != xyes], [ ++ CFLAGS="$CFLAGS -I${with_oniguruma}/include" ++ LDFLAGS="$LDFLAGS -L${with_oniguruma}/lib" ++ ]) ++ # check for ONIGURUMA library ++ have_oniguruma=0 ++ AC_CHECK_HEADER("oniguruma.h", ++ AC_CHECK_LIB([onig],[onig_version],[LIBS="$LIBS -lonig"; have_oniguruma=1;])) ++ # handle check results ++ AS_IF([test $have_oniguruma = 1], [ ++ AC_DEFINE([HAVE_ONIGURUMA], 1, [Define to 1 if Oniguruma is installed]) ++ ], [ ++ AC_MSG_NOTICE([Oniguruma was not found.]) ++ AC_MSG_NOTICE([Try setting the location using '--with-oniguruma=PREFIX']) ++ ]) ++]) + + dnl Check for valgrind + AC_CHECK_PROGS(valgrind_cmd, valgrind) +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/jq/jq_1.5.bb b/external/meta-openembedded/meta-oe/recipes-devtools/jq/jq_1.5.bb new file mode 100644 index 00000000..0f40815c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/jq/jq_1.5.bb @@ -0,0 +1,30 @@ +SUMMARY = "Lightweight and flexible command-line JSON processor" +DESCRIPTION = "jq is like sed for JSON data, you can use it to slice and \ + filter and map and transform structured data with the same \ + ease that sed, awk, grep and friends let you play with text." +HOMEPAGE = "https://stedolan.github.io/jq/" +BUGTRACKER = "https://github.com/stedolan/jq/issues" +SECTION = "utils" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=29dd0c35d7e391bb8d515eacf7592e00" + +SRC_URI = "https://github.com/stedolan/${BPN}/releases/download/${BP}/${BP}.tar.gz \ + file://Support-without-oniguruma.patch \ +" + +SRC_URI[md5sum] = "0933532b086bd8b6a41c1b162b1731f9" +SRC_URI[sha256sum] = "c4d2bfec6436341113419debf479d833692cc5cdab7eb0326b5a4d4fbe9f493c" + +inherit autotools + +PACKAGECONFIG ?= "oniguruma" + +PACKAGECONFIG[docs] = "--enable-docs,--disable-docs,ruby-native" +PACKAGECONFIG[maintainer-mode] = "--enable-maintainer-mode,--disable-maintainer-mode,flex-native bison-native" +PACKAGECONFIG[oniguruma] = "--with-oniguruma,--without-oniguruma,onig" + +OE_EXTRACONF += " \ + --disable-valgrind \ +" + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch b/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch new file mode 100644 index 00000000..f7030c55 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch @@ -0,0 +1,145 @@ +From d8986cb065e770017ee1622fb7324387ead60203 Mon Sep 17 00:00:00 2001 +From: Ming Liu <peter.x.liu@external.atlascopco.com> +Date: Tue, 7 Mar 2017 11:46:52 +0100 +Subject: [PATCH] Adjust the cmake files + +- Remove json_test which can not build with boost 1.61.0. +- Build shared library as well with the original static library. +- Add FindLibJsonSpirit.cmake to be able to be found by the dependers. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> +--- + CMakeLists.txt | 8 +++--- + FindLibJsonSpirit.cmake | 64 ++++++++++++++++++++++++++++++++++++++++++++++ + json_spirit/CMakeLists.txt | 16 +++++++++++- + 3 files changed, 83 insertions(+), 5 deletions(-) + create mode 100644 FindLibJsonSpirit.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4637a6c..b292f0f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + + PROJECT(json_spirit) +-SUBDIRS(json_spirit json_demo json_headers_only_demo json_map_demo json_test) ++SUBDIRS(json_spirit json_demo json_headers_only_demo json_map_demo) + INCLUDE_DIRECTORIES(json_spirit) + + INSTALL( +@@ -16,11 +16,11 @@ INSTALL( + ${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer.h + ${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer_template.h + ${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer_options.h +- DESTINATION include) ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + INSTALL( + FILES +- ${CMAKE_BINARY_DIR}/json_spirit/libjson_spirit.a +- DESTINATION lib) ++ ${CMAKE_SOURCE_DIR}/FindLibJsonSpirit.cmake ++ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules) + + INCLUDE(CPack) +diff --git a/FindLibJsonSpirit.cmake b/FindLibJsonSpirit.cmake +new file mode 100644 +index 0000000..7ee7687 +--- /dev/null ++++ b/FindLibJsonSpirit.cmake +@@ -0,0 +1,64 @@ ++# FindLibJsonSpirit - Find libjson_spirit headers and libraries. ++# ++# Sample: ++# ++# SET( LibJsonSpirit_USE_STATIC_LIBS OFF ) ++# FIND_PACKAGE( LibJsonSpirit REQUIRED ) ++# IF( LibJsonSpirit_FOUND ) ++# INCLUDE_DIRECTORIES( ${LibJsonSpirit_INCLUDE_DIRS} ) ++# TARGET_LINK_LIBRARIES( ... ${LibJsonSpirit_LIBRARIES} ) ++# ENDIF() ++# ++# Variables used by this module need to be set before calling find_package ++# ++# LibJsonSpirit_USE_STATIC_LIBS Can be set to ON to force the use of the static ++# libjson_spirit libraries. Defaults to OFF. ++# ++# Variables provided by this module: ++# ++# LibJsonSpirit_FOUND Include dir, libjson_spirit libraries. ++# ++# LibJsonSpirit_LIBRARIES Link to these to use all the libraries you specified. ++# ++# LibJsonSpirit_INCLUDE_DIRS Include directories. ++# ++# For each component you specify in find_package(), the following (UPPER-CASE) ++# variables are set to pick and choose components instead of just using ++# LibJsonSpirit_LIBRARIES: ++# ++# LIBJSONSPIRIT_FOUND TRUE if libjson_spirit was found ++# LIBJSONSPIRIT_LIBRARY libjson_spirit library ++# ++ ++# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES ++IF(LibJsonSpirit_USE_STATIC_LIBS) ++ SET( _ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) ++ SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ) ++ENDIF() ++ ++# Look for the header files ++UNSET(LibJsonSpirit_INCLUDE_DIRS CACHE) ++FIND_PATH(LibJsonSpirit_INCLUDE_DIRS NAMES json_spirit.h) ++ ++# Look for the core library ++UNSET(LIBJSONSPIRIT_LIBRARY CACHE) ++FIND_LIBRARY(LIBJSONSPIRIT_LIBRARY NAMES json_spirit) ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibJsonSpirit DEFAULT_MSG LIBJSONSPIRIT_LIBRARY LibJsonSpirit_INCLUDE_DIRS) ++MARK_AS_ADVANCED( ++ LIBJSONSPIRIT_FOUND ++ LIBJSONSPIRIT_LIBRARY ++) ++ ++# Prepare return values and collectiong more components ++SET(LibJsonSpirit_FOUND ${LIBJSONSPIRIT_FOUND}) ++SET(LibJsonSpirit_LIBRARIES ${LIBJSONSPIRIT_LIBRARY}) ++MARK_AS_ADVANCED( ++ LibJsonSpirit_FOUND ++ LibJsonSpirit_LIBRARIES ++ LibJsonSpirit_INCLUDE_DIRS ++) ++ ++# Restore CMAKE_FIND_LIBRARY_SUFFIXES ++IF(LibJsonSpirit_USE_STATIC_LIBS) ++ SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} ) ++ENDIF() +diff --git a/json_spirit/CMakeLists.txt b/json_spirit/CMakeLists.txt +index fb52818..c1613b2 100644 +--- a/json_spirit/CMakeLists.txt ++++ b/json_spirit/CMakeLists.txt +@@ -13,5 +13,19 @@ json_spirit_writer_template.h ) + FIND_PACKAGE(Boost 1.34 REQUIRED) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + +-ADD_LIBRARY(json_spirit STATIC ${JSON_SPIRIT_SRCS}) ++SET(JSONSPIRIT_SOVERSION_MAJOR "4") ++SET(JSONSPIRIT_SOVERSION_MINOR "0") ++SET(JSONSPIRIT_SOVERSION_PATCH "8") + ++ADD_LIBRARY(json_spirit SHARED ${JSON_SPIRIT_SRCS}) ++SET_TARGET_PROPERTIES(json_spirit PROPERTIES PROJECT_LABEL "Json Spirit Library") ++SET_TARGET_PROPERTIES(json_spirit PROPERTIES COMPILE_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) ++SET_TARGET_PROPERTIES(json_spirit PROPERTIES VERSION ${JSONSPIRIT_SOVERSION_MAJOR}.${JSONSPIRIT_SOVERSION_MINOR}.${JSONSPIRIT_SOVERSION_PATCH}) ++SET_TARGET_PROPERTIES(json_spirit PROPERTIES SOVERSION ${JSONSPIRIT_SOVERSION_MAJOR}) ++INSTALL(TARGETS json_spirit DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ ++ADD_LIBRARY(json_spirit_static STATIC ${JSON_SPIRIT_SRCS}) ++SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES PROJECT_LABEL "Json Spirit Static Library") ++SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES OUTPUT_NAME "json_spirit") ++SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES SOVERSION ${JSONSPIRIT_SOVERSION_MAJOR}) ++INSTALL(TARGETS json_spirit_static DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Link-to-libatomic.patch b/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Link-to-libatomic.patch new file mode 100644 index 00000000..4c8c7b98 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Link-to-libatomic.patch @@ -0,0 +1,64 @@ +From bbac9ac3e391253bc1f90cf0f70a2ce1aac9511f Mon Sep 17 00:00:00 2001 +From: Ming Liu <liu.ming50@gmail.com> +Date: Wed, 30 Aug 2017 16:50:56 +0200 +Subject: [PATCH] Link to libatomic + +This is needed for clang compiler. + +Upstream-Status: Pending + +Signed-off-by: Ming Liu <liu.ming50@gmail.com> +--- + json_demo/CMakeLists.txt | 2 +- + json_headers_only_demo/CMakeLists.txt | 2 +- + json_map_demo/CMakeLists.txt | 2 +- + json_test/CMakeLists.txt | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/json_demo/CMakeLists.txt b/json_demo/CMakeLists.txt +index b1d3c6a..0dfd308 100644 +--- a/json_demo/CMakeLists.txt ++++ b/json_demo/CMakeLists.txt +@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + + ADD_EXECUTABLE(json_demo ${JSON_DEMO_SRCS}) +-TARGET_LINK_LIBRARIES(json_demo json_spirit) ++TARGET_LINK_LIBRARIES(json_demo json_spirit -latomic) + +diff --git a/json_headers_only_demo/CMakeLists.txt b/json_headers_only_demo/CMakeLists.txt +index a3c787a..6eae11e 100644 +--- a/json_headers_only_demo/CMakeLists.txt ++++ b/json_headers_only_demo/CMakeLists.txt +@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + + ADD_EXECUTABLE(json_headers_only_demo ${JSON_HEADERS_ONLY_DEMO_SRCS}) +-TARGET_LINK_LIBRARIES(json_headers_only_demo json_spirit) ++TARGET_LINK_LIBRARIES(json_headers_only_demo json_spirit -latomic) + +diff --git a/json_map_demo/CMakeLists.txt b/json_map_demo/CMakeLists.txt +index 599006a..e3e45e8 100644 +--- a/json_map_demo/CMakeLists.txt ++++ b/json_map_demo/CMakeLists.txt +@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + + ADD_EXECUTABLE(json_map_demo ${JSON_MAP_DEMO_SRCS}) +-TARGET_LINK_LIBRARIES(json_map_demo json_spirit) ++TARGET_LINK_LIBRARIES(json_map_demo json_spirit -latomic) + +diff --git a/json_test/CMakeLists.txt b/json_test/CMakeLists.txt +index 38ffa7f..1ec1365 100644 +--- a/json_test/CMakeLists.txt ++++ b/json_test/CMakeLists.txt +@@ -11,5 +11,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + + ADD_EXECUTABLE(json_test ${JSON_TEST_SRCS}) +-TARGET_LINK_LIBRARIES(json_test json_spirit) ++TARGET_LINK_LIBRARIES(json_test json_spirit -latomic) + +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip b/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip Binary files differnew file mode 100644 index 00000000..27d46b15 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb b/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb new file mode 100644 index 00000000..d6e42c81 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb @@ -0,0 +1,23 @@ +SUMMARY = "A C++ JSON Parser/Generator Implemented with Boost Spirit." +DESCRIPTION = "JSON Spirit, a C++ library that reads and writes JSON files or streams. \ +It is written using the Boost Spirit parser generator. If you are \ +already using Boost, you can use JSON Spirit without any additional \ +dependencies." +HOMEPAGE = "https://www.codeproject.com/kb/recipes/json_spirit.aspx" +SECTION = "libs" +PRIORITY = "optional" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=278ef6183dec4aae1524fccc4b0113c9" + +DEPENDS = "boost" + +SRC_URI = "file://json_spirit_v${PV}.zip \ + file://0001-Adjust-the-cmake-files.patch \ + file://0001-Link-to-libatomic.patch \ +" + +S = "${WORKDIR}/json_spirit_v${PV}" + +inherit cmake + +BBCLASSEXTEND = "nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.8.4.bb b/external/meta-openembedded/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.8.4.bb new file mode 100644 index 00000000..88e33203 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.8.4.bb @@ -0,0 +1,21 @@ +SUMMARY = "JSON C++ lib used to read and write json file." +DESCRIPTION = "Jsoncpp is an implementation of a JSON (http://json.org) reader \ + and writer in C++. JSON (JavaScript Object Notation) is a \ + lightweight data-interchange format. It is easy for humans to \ + read and write. It is easy for machines to parse and generate." + +HOMEPAGE = "https://github.com/open-source-parsers/jsoncpp" + +SECTION = "libs" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=fa2a23dd1dc6c139f35105379d76df2b" + +SRCREV = "ddabf50f72cf369bf652a95c4d9fe31a1865a781" +SRC_URI = "git://github.com/open-source-parsers/jsoncpp" + +S = "${WORKDIR}/git" + +inherit cmake + +EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DJSONCPP_WITH_TESTS=OFF" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-cmake-replace-hardcoded-lib-CMAKE_LIBRARY_PATH-with-.patch b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-cmake-replace-hardcoded-lib-CMAKE_LIBRARY_PATH-with-.patch new file mode 100644 index 00000000..748e4da1 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-cmake-replace-hardcoded-lib-CMAKE_LIBRARY_PATH-with-.patch @@ -0,0 +1,77 @@ +From ac61124df17ab76527508bbb9a3115d4d6cc1af6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 21 Nov 2016 11:26:26 -0800 +Subject: [PATCH] cmake: replace hardcoded lib/${CMAKE_LIBRARY_PATH} with + {CMAKE_INSTALL_LIBDIR} + +Fixes +| CMake Error at src/jsonrpccpp/CMakeLists.txt:207 (install): +| install TARGETS given unknown argument "/lib". + +and + +Wrong install paths during cross compile + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/jsonrpccpp/CMakeLists.txt | 8 ++++---- + src/stubgenerator/CMakeLists.txt | 6 +++--- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/jsonrpccpp/CMakeLists.txt b/src/jsonrpccpp/CMakeLists.txt +index e4a1eb5..13f9056 100644 +--- a/src/jsonrpccpp/CMakeLists.txt ++++ b/src/jsonrpccpp/CMakeLists.txt +@@ -205,15 +205,15 @@ if (WIN32) + endif() + + install(TARGETS ${ALL_LIBS} +- LIBRARY DESTINATION lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH} +- ARCHIVE DESTINATION lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION bin + ) + + #set pkg-config + get_filename_component(FULL_PATH_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE) + set(FULL_PATH_INCLUDEDIR "${FULL_PATH_INSTALL_PREFIX}/include") +-set(FULL_PATH_LIBDIR "${FULL_PATH_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_PATH}") ++set(FULL_PATH_LIBDIR "${FULL_PATH_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/libjsonrpccpp-client.pc.cmake ${CMAKE_BINARY_DIR}/libjsonrpccpp-client.pc) + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/libjsonrpccpp-server.pc.cmake ${CMAKE_BINARY_DIR}/libjsonrpccpp-server.pc) +@@ -223,6 +223,6 @@ INSTALL(FILES + "${CMAKE_BINARY_DIR}/libjsonrpccpp-server.pc" + "${CMAKE_BINARY_DIR}/libjsonrpccpp-client.pc" + "${CMAKE_BINARY_DIR}/libjsonrpccpp-common.pc" +- DESTINATION "lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH}/pkgconfig") ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + + +diff --git a/src/stubgenerator/CMakeLists.txt b/src/stubgenerator/CMakeLists.txt +index f9dbe4c..b57b0fe 100644 +--- a/src/stubgenerator/CMakeLists.txt ++++ b/src/stubgenerator/CMakeLists.txt +@@ -58,15 +58,15 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/libjsonrpccpp-stub.pc.cmake ${CMAKE_BIN + + INSTALL(FILES + "${CMAKE_BINARY_DIR}/libjsonrpccpp-stub.pc" +- DESTINATION "lib/${CMAKE_LIBRARY_PATH}/pkgconfig") ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + + install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/stubgenerator/ + DESTINATION include/jsonrpccpp/stubgen + FILES_MATCHING PATTERN "*.h") + + install(TARGETS ${ALL_LIBS} jsonrpcstub +- LIBRARY DESTINATION lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH} +- ARCHIVE DESTINATION lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION bin + ) + +-- +2.10.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorclient-Typecast-min-arguments-correctl.patch b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorclient-Typecast-min-arguments-correctl.patch new file mode 100644 index 00000000..d21e9795 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorclient-Typecast-min-arguments-correctl.patch @@ -0,0 +1,33 @@ +From 9500f12f5d827840634311d6ca972d9551211e4d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 21 Nov 2016 01:00:51 -0800 +Subject: [PATCH] filedescriptorclient: Typecast min() arguments correctly + +Fixes + +| /mnt/a/build/tmp-glibc/work/cortexa7hf-neon-vfpv4-oe-linux-gnueabi/jsonrpc/0.7.0-r0/git/src/jsonrpccp +p/client/connectors/filedescriptorclient.cpp:47:92: note: deduced conflicting types for parameter 'co +nst _Tp' ('unsigned int' and 'long unsigned int') +| ssize_t byteWritten = write(outputfd, toSend.c_str(), min(toSend.size(), MAX_WRITE_SIZE)); + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/jsonrpccpp/client/connectors/filedescriptorclient.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp b/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp +index 77aac7e..6325b5c 100644 +--- a/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp ++++ b/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp +@@ -43,7 +43,7 @@ void FileDescriptorClient::SendRPCMessage(const std::string& message, + string toSend = message; + do + { +- ssize_t byteWritten = write(outputfd, toSend.c_str(), min(toSend.size(), MAX_WRITE_SIZE)); ++ ssize_t byteWritten = write(outputfd, toSend.c_str(), min((long unsigned int)toSend.size(), MAX_WRITE_SIZE)); + if (byteWritten < 1) + throw JsonRpcException(Errors::ERROR_CLIENT_CONNECTOR, + "Unknown error occured while writing to the output file descriptor"); +-- +2.10.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorserver-Include-sys-select.h-before-oth.patch b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorserver-Include-sys-select.h-before-oth.patch new file mode 100644 index 00000000..3b9068a7 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorserver-Include-sys-select.h-before-oth.patch @@ -0,0 +1,34 @@ +From c7aad10628949e126f50e3264b5bc7eb417347c6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 21 Nov 2016 01:25:10 -0800 +Subject: [PATCH] filedescriptorserver: Include sys/select.h before other + headers + +Fixes errors e.g. +| /mnt/a/build/tmp-glibc/work/cortexa7hf-neon-vfpv4-oe-linux-gnueabi/jsonrpc/0.7.0-r0/git/src/jsonrpccp +p/server/connectors/filedescriptorserver.h:63:7: error: unknown type name 'fd_set' +| fd_set read_fds; +| ^ + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/jsonrpccpp/server/connectors/filedescriptorserver.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp b/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp +index 9d74223..8e019ca 100644 +--- a/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp ++++ b/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp +@@ -7,8 +7,8 @@ + * @license See attached LICENSE.txt + ************************************************************************/ + +-#include "filedescriptorserver.h" + #include <sys/select.h> ++#include "filedescriptorserver.h" + #include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> +-- +2.10.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-memset-and-family-needs-to-include-string.h.patch b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-memset-and-family-needs-to-include-string.h.patch new file mode 100644 index 00000000..21ef98bf --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-memset-and-family-needs-to-include-string.h.patch @@ -0,0 +1,26 @@ +From f5416f1c2b2989f94163a2ae4b91c9b9fa13c620 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 31 Mar 2017 13:32:31 -0700 +Subject: [PATCH 1/2] memset() and family needs to include string.h + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp b/src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp +index 9fca57b..e63c49e 100644 +--- a/src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp ++++ b/src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp +@@ -16,7 +16,7 @@ + #include <cstdio> + #include <fcntl.h> + #include <unistd.h> +-#include <string> ++#include <cstring> + + using namespace jsonrpc; + using namespace std; +-- +2.12.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0002-Fix-build-problem-on-Mac.patch b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0002-Fix-build-problem-on-Mac.patch new file mode 100644 index 00000000..aece45b0 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0002-Fix-build-problem-on-Mac.patch @@ -0,0 +1,27 @@ +From 79050ef9607f242e0d509969b19e9390220c3411 Mon Sep 17 00:00:00 2001 +From: Yongwei Wu <wuyongwei@gmail.com> +Date: Sat, 31 Dec 2016 11:57:11 +0800 +Subject: [PATCH 2/2] Fix build problem on Mac. + +__suseconds_t is not defined on Mac/BSD; use the POSIX-conformant +suseconds_t. +--- + src/jsonrpccpp/server/connectors/filedescriptorserver.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp b/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp +index 8e019ca..68107f2 100644 +--- a/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp ++++ b/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp +@@ -122,7 +122,7 @@ int FileDescriptorServer::WaitForRead() { + FD_ZERO(&except_fds); + FD_SET(inputfd, &read_fds); + timeout.tv_sec = 0; +- timeout.tv_usec = (__suseconds_t) (READ_TIMEOUT * 1000000); ++ timeout.tv_usec = (suseconds_t) (READ_TIMEOUT * 1000000); + // Wait for something to read + return select(inputfd + 1, &read_fds, &write_fds, &except_fds, &timeout); + } +-- +2.12.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc_0.7.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc_0.7.0.bb new file mode 100644 index 00000000..eb1ff65b --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc_0.7.0.bb @@ -0,0 +1,32 @@ +SUMMARY = "C++ framework for json-rpc 1.0 and 2.0" +DESCRIPTION = "JsonRpc-Cpp is an OpenSource implementation of JSON-RPC \ + protocol in C++. JSON-RPC is a lightweight remote procedure \ + call protocol similar to XML-RPC." +HOMEPAGE = "https://github.com/cinemast/libjson-rpc-cpp" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=ee72d601854d5d2a065cf642883c489b" + +PV = "0.7.0+git${SRCPV}" + +SRC_URI = "git://github.com/cinemast/libjson-rpc-cpp \ + file://0001-cmake-replace-hardcoded-lib-CMAKE_LIBRARY_PATH-with-.patch \ + file://0001-filedescriptorclient-Typecast-min-arguments-correctl.patch \ + file://0001-filedescriptorserver-Include-sys-select.h-before-oth.patch \ + file://0001-memset-and-family-needs-to-include-string.h.patch \ + file://0002-Fix-build-problem-on-Mac.patch \ + " +SRCREV = "ccbdb41388bdd929828941652da816bf52a0580e" + +SECTION = "libs" + +DEPENDS = "curl jsoncpp libmicrohttpd" + +S = "${WORKDIR}/git" + +inherit cmake + +EXTRA_OECMAKE += "-DCOMPILE_TESTS=NO -DCOMPILE_STUBGEN=NO -DCOMPILE_EXAMPLES=NO \ + -DBUILD_SHARED_LIBS=YES -DBUILD_STATIC_LIBS=YES \ + -DCMAKE_LIBRARY_PATH=${libdir} \ +" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/kconfig-frontends/files/0001-Makefile-ensure-frontends-exits-before-writing-into-.patch b/external/meta-openembedded/meta-oe/recipes-devtools/kconfig-frontends/files/0001-Makefile-ensure-frontends-exits-before-writing-into-.patch new file mode 100644 index 00000000..a5263c6f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/kconfig-frontends/files/0001-Makefile-ensure-frontends-exits-before-writing-into-.patch @@ -0,0 +1,32 @@ +From 780b0b8e48551ba49b011caeeb09101a09c14a61 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Fri, 26 May 2017 17:11:32 +0100 +Subject: [PATCH] Makefile: ensure frontends/ exits before writing into it + +As previously, if GCC dependencies are not being written and the build is out of +tree then frontends/ won't exist so we need to create it. + +Upstream-Status: Backport +Signed-off-by: Ross Burton <ross.burton@intel.com> +Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> +(cherry picked from commit f7986375129d1ada7dc6abeeec5b9d00ef6f7149) +Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> +--- + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.am b/Makefile.am +index 1baa110..434db5d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -171,6 +171,7 @@ if COND_kconfig + bin_SCRIPTS += frontends/kconfig + + frontends/kconfig: frontends/kconfig.in ++ $(MKDIR_P) $(@D) + $(AM_V_GEN)$(SED) -e 's/@KCFG_LIST@/$(kcfg_list)/g' \ + $< >$@ + @chmod +x $@ +-- +2.12.0 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/kconfig-frontends/files/0001-Switch-utils-kconfig-diff-to-use-Python-3.patch b/external/meta-openembedded/meta-oe/recipes-devtools/kconfig-frontends/files/0001-Switch-utils-kconfig-diff-to-use-Python-3.patch new file mode 100644 index 00000000..b8f89048 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/kconfig-frontends/files/0001-Switch-utils-kconfig-diff-to-use-Python-3.patch @@ -0,0 +1,26 @@ +From 3b9b0f82c33f793a14d44bf06b6c8136bc3fc4bf Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Thu, 27 Apr 2017 16:48:42 +0300 +Subject: [PATCH] Switch utils/kconfig-diff to use Python 3 + +The script supports it, but continues to refer to 2.x in shebang. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + utils/kconfig-diff | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/utils/kconfig-diff b/utils/kconfig-diff +index 0db267d..19189f3 100755 +--- a/utils/kconfig-diff ++++ b/utils/kconfig-diff +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python3 + # + # diffconfig - a tool to compare .config files. + # +-- +2.11.0 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/kconfig-frontends/kconfig-frontends_4.11.0.1.bb b/external/meta-openembedded/meta-oe/recipes-devtools/kconfig-frontends/kconfig-frontends_4.11.0.1.bb new file mode 100644 index 00000000..de9a6eb9 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/kconfig-frontends/kconfig-frontends_4.11.0.1.bb @@ -0,0 +1,41 @@ +# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com> +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "Linux kernel style configuration framework for other projects" +DESCRIPTION = "The kconfig-frontends project aims at centralising \ +the effort of keeping an up-to-date, out-of-tree, packaging of the \ +kconfig infrastructure, ready for use by third-party projects. \ +The kconfig-frontends package provides the kconfig parser, as well as all \ +the frontends" +HOMEPAGE = "http://ymorin.is-a-geek.org/projects/kconfig-frontends" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=9b8cf60ff39767ff04b671fca8302408" +SECTION = "devel" +DEPENDS += "ncurses flex bison gperf-native bison-native" +RDEPENDS_${PN} += "python3 bash" +SRC_URI = "git://ymorin.is-a-geek.org/kconfig-frontends;branch=4.11.x \ + file://0001-Makefile-ensure-frontends-exits-before-writing-into-.patch \ + file://0001-Switch-utils-kconfig-diff-to-use-Python-3.patch" + +SRCREV = "f22fce3a308be1c7790ebefc6bbedb33c5f7c86a" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig +do_configure_prepend () { + mkdir -p ${S}/scripts/.autostuff/m4 +} + +do_install_append() { + ln -s kconfig-conf ${D}${bindir}/conf + ln -s kconfig-mconf ${D}${bindir}/mconf +} + +EXTRA_OECONF += "--disable-gconf --disable-qconf" + +# Some packages have the version preceeding the .so instead properly +# versioned .so.<version>, so we need to reorder and repackage. +SOLIBS = "-${@d.getVar('PV')[:-2]}.so" +FILES_SOLIBSDEV = "${libdir}/libkconfig-parser.so" + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lapack/lapack_3.8.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/lapack/lapack_3.8.0.bb new file mode 100644 index 00000000..7544744b --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lapack/lapack_3.8.0.bb @@ -0,0 +1,24 @@ +SUMMARY = "Linear Algebra PACKage" +URL = "http://www.netlib.org/lapack" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=930f8aa500a47c7dab0f8efb5a1c9a40" + +# Recipe needs FORTRAN support (copied from conf/local.conf.sample.extended) +# Enabling FORTRAN +# Note this is not officially supported and is just illustrated here to +# show an example of how it can be done +# You'll also need your fortran recipe to depend on libgfortran +#FORTRAN_forcevariable = ",fortran" +#RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath" + +DEPENDS = "libgfortran" + +SRC_URI = "http://www.netlib.org/lapack/lapack-${PV}.tar.gz" +SRC_URI[md5sum] = "96591affdbf58c450d45c1daa540dbd2" +SRC_URI[sha256sum] = "deb22cc4a6120bff72621155a9917f485f96ef8319ac074a7afbc68aab88bcf6" + +EXTRA_OECMAKE = " -DBUILD_SHARED_LIBS=ON " +OECMAKE_GENERATOR = "Unix Makefiles" + +inherit cmake pkgconfig +EXCLUDE_FROM_WORLD = "1" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lemon/files/lemon.1 b/external/meta-openembedded/meta-oe/recipes-devtools/lemon/files/lemon.1 new file mode 100644 index 00000000..914ee070 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lemon/files/lemon.1 @@ -0,0 +1,63 @@ +.Dd 2002-10-04 +.Dt LEMON 1 +.Os "Debian GNU/Linux" +.\" Manual page created by Guus Sliepen <guus@debian.org> +.Sh NAME +.Nm lemon +.Nd The Lemon Parser Generator +.Sh SYNOPSIS +.Nm +.Op Fl bcgmqsx +.Ar input +.Sh DESCRIPTION +.Nm +is an LALR(1) parser generator for C or C++. +It does the same job as bison and yacc. +But +.Nm +is not another bison or yacc clone. +It uses a different grammar syntax which is designed to reduce the number of coding errors. +.Nm +also uses a more sophisticated parsing engine that is faster than yacc and bison +and which is both reentrant and thread-safe. +Furthermore, +.Nm +implements features that can be used to eliminate resource leaks, +making is suitable for use in long-running programs such as graphical user interfaces or embedded controllers. +.Pp +.Nm +will read the grammer from +.Ar input +and write out a parser for that grammar in the C language. +.Sh OPTIONS +.Bl -tag -width indent +.It Fl b +Print only the basis in report. +.It Fl c +Don't compress the action table. +.It Fl g +Print grammar without actions. +.It Fl m +Output a makeheaders compatible file. +.It Fl q +(Quiet) Don't print the report file. +.It Fl s +Print parser stats to standard output. +.It Fl x +Print the version number. +.El +.Sh FILES +.Bl -tag -width indent +.It Pa /usr/share/lemon/lempar.c +Driver template for the +.Nm +parser generator. +.El +.Sh AUTHOR +.Nm +has been written by +.An D. Richard Hipp Aq drh@hwaci.com . +.Pp +This manual page was written by +.An Guus Sliepen Aq guus@debian.org +for the Debian GNU/Linux system. diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lemon/lemon.inc b/external/meta-openembedded/meta-oe/recipes-devtools/lemon/lemon.inc new file mode 100644 index 00000000..57b9fb71 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lemon/lemon.inc @@ -0,0 +1,25 @@ +DESCRIPTION = "The Lemon Parser Generator" +HOMEPAGE = "http://www.hwaci.com/sw/lemon/" +LICENSE = "PD" +SECTION = "devel" + +SRC_URI = "http://www.sqlite.org/sqlite-${PV}.tar.gz \ + file://lemon.1" + +S = "${WORKDIR}/sqlite-${PV}/tool" + +do_compile() { + ${CC} ${CFLAGS} lemon.c -c -o lemon.o + ${CCLD} ${LDFLAGS} lemon.o -o lemon +} + +do_install() { + install -d ${D}${bindir} + install -m 0755 lemon ${D}${bindir} + install -m 0644 lempar.c ${D}${bindir} + install -d ${D}${mandir}/man1 + install -m 0644 ${WORKDIR}/lemon.1 ${D}${mandir}/man1/ +} + +BBCLASSEXTEND = "native" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lemon/lemon_3.7.3.bb b/external/meta-openembedded/meta-oe/recipes-devtools/lemon/lemon_3.7.3.bb new file mode 100644 index 00000000..354db17e --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lemon/lemon_3.7.3.bb @@ -0,0 +1,7 @@ +require lemon.inc + +LIC_FILES_CHKSUM = "file://lemon.c;endline=8;md5=c7551a78fa3fdecd96d1ad6761d205ee" + +SRC_URI[md5sum] = "5437978aae90350cf984993091e0d695" +SRC_URI[sha256sum] = "dbf352e8fbb74829f5e7a88f9f6ceeb80a709537f668c36e4b6cdfb271309ef6" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit/stdc-predef.patch b/external/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit/stdc-predef.patch new file mode 100644 index 00000000..c95cdc9d --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit/stdc-predef.patch @@ -0,0 +1,17 @@ +__STDC_ISO_10646__ is defined in stdc-predef.h +therefore include it to see if its there on a platform + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Index: libedit-20160903-3.1/src/chartype.h +=================================================================== +--- libedit-20160903-3.1.orig/src/chartype.h ++++ libedit-20160903-3.1/src/chartype.h +@@ -29,6 +29,7 @@ + #ifndef _h_chartype_f + #define _h_chartype_f + ++#include <stdc-predef.h> + /* Ideally we should also test the value of the define to see if it + * supports non-BMP code points without requiring UTF-16, but nothing + * seems to actually advertise this properly, despite Unicode 3.1 having diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit_20180525-3.1.bb b/external/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit_20180525-3.1.bb new file mode 100644 index 00000000..8cc0e959 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit_20180525-3.1.bb @@ -0,0 +1,21 @@ +SUMMARY = "BSD replacement for libreadline" +DESCRIPTION = "Command line editor library providing generic line editing, \ +history, and tokenization functions" +HOMEPAGE = "http://www.thrysoee.dk/editline/" +SECTION = "libs" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=1e4228d0c5a9093b01aeaaeae6641533" + +DEPENDS = "ncurses" + +inherit autotools + +# upstream site does not allow wget's User-Agent +FETCHCMD_wget += "-U bitbake" +SRC_URI = "http://www.thrysoee.dk/editline/${BPN}-${PV}.tar.gz \ + file://stdc-predef.patch \ + " +SRC_URI[md5sum] = "97679319742f45d6cdcd6075511b14ac" +SRC_URI[sha256sum] = "c41bea8fd140fb57ba67a98ec1d8ae0b8ffa82f4aba9c35a87e5a9499e653116" + +S = "${WORKDIR}/${BPN}-${PV}" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/libgee/libgee_0.18.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/libgee/libgee_0.18.0.bb new file mode 100644 index 00000000..6386f1ff --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/libgee/libgee_0.18.0.bb @@ -0,0 +1,24 @@ +DESCRIPTION = "libgee is a collection library providing GObject-based interfaces \ +and classes for commonly used data structures." +HOMEPAGE = "http://live.gnome.org/Libgee" +SECTION = "libs" +DEPENDS = "glib-2.0" + +BBCLASSEXTEND = "native" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" + +PE = "1" + +inherit autotools vala pkgconfig gobject-introspection +do_configure_prepend() { + MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4" + for i in ${MACROS}; do + rm -f m4/$i + done +} + +SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" +SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/libgee/${SHRT_VER}/${BP}.tar.xz" +SRC_URI[md5sum] = "29ea6125e653d7e60b49a9a9544abc96" +SRC_URI[sha256sum] = "4ad99ef937d071b4883c061df40bfe233f7649d50c354cf81235f180b4244399" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-Add-CMake-build-files.patch b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-Add-CMake-build-files.patch new file mode 100644 index 00000000..560c3a6d --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-Add-CMake-build-files.patch @@ -0,0 +1,302 @@ +From 613297214d78ee10111e74e90e025166ebbcad9f Mon Sep 17 00:00:00 2001 +From: Peter Liu <peter.x.liu@external.atlascopco.com> +Date: Sun, 5 Mar 2017 16:15:40 +0100 +Subject: [PATCH] Add CMake build files + +Upstream-Status: Pending + +Signed-off-by: Peter Liu <peter.x.liu@external.atlascopco.com> +--- + CMakeLists.txt | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + FindLibRcf.cmake | 63 +++++++++++++++++++++++ + VERSION.cmake | 21 ++++++++ + src/CMakeLists.txt | 25 +++++++++ + 4 files changed, 256 insertions(+) + create mode 100644 CMakeLists.txt + create mode 100644 FindLibRcf.cmake + create mode 100644 VERSION.cmake + create mode 100755 src/CMakeLists.txt + +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..f6e24be +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,147 @@ ++PROJECT (librcf) ++ ++CMAKE_MINIMUM_REQUIRED (VERSION 2.6) ++ ++#################################################################### ++# OPTION # ++#################################################################### ++OPTION (LIBRCF_USE_OPENSSL "Build with OpenSSL support?" OFF) ++OPTION (LIBRCF_OPENSSL_STATIC "Enable static linking to OpenSSL?" OFF) ++OPTION (LIBRCF_USE_ZLIB "Build with zlib support?" OFF) ++OPTION (LIBRCF_ZLIB_STATIC "Enable static linking to zlib?" OFF) ++OPTION (LIBRCF_USE_SF_SERIALIZATION "Build with SF serialization support?" ON) ++OPTION (LIBRCF_USE_BOOST_SERIALIZATION "Build with Boost.Serialization support?" OFF) ++OPTION (LIBRCF_USE_BOOST_FILESYSTEM "Build with Boost.Filesystem support (required for file transfer support)?" OFF) ++OPTION (LIBRCF_USE_BOOST_ASIO "Build with Boost asio support?" ON) ++OPTION (LIBRCF_USE_PROTOBUF "Build with Protocol Buffer support?" OFF) ++OPTION (LIBRCF_USE_JSON "Build with JSON Spirit (required for JSON-RPC support)?" OFF) ++OPTION (LIBRCF_USE_IPV6 "Build with IPv6 support?" OFF) ++OPTION (LIBRCF_USE_CUSTOM_ALLOCATOR "Build with custom allocator support?" OFF) ++OPTION (LIBRCF_BUILD_DLL "Build a DLL exporting RCF?" OFF) ++OPTION (LIBRCF_AUTO_INIT_DEINIT "Enable automatic RCF initialization and deinitialization?" OFF) ++OPTION (LIBRCF_BUILD_STATIC_LIBS "Build the static library?" ON) ++OPTION (LIBRCF_BUILD_SHARED_LIBS "Build the shared library?" ON) ++OPTION (LIBRCF_BUILD_DEMOS "Build demo programs?" ON) ++ ++#################################################################### ++# CONFIGURATION # ++#################################################################### ++INCLUDE (${CMAKE_SOURCE_DIR}/VERSION.cmake) ++ ++SET (LIBRCF_LIBRARIES "-lpthread -ldl -latomic") ++INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/include) ++ ++IF (LIBRCF_USE_OPENSSL) ++ IF (NOT OPENSSL_FOUND) ++ FIND_PACKAGE (OpenSSL REQUIRED) ++ ENDIF (NOT OPENSSL_FOUND) ++ INCLUDE_DIRECTORIES (${OPENSSL_INCLUDE_DIR}) ++ ADD_DEFINITIONS (-DRCF_USE_OPENSSL) ++ENDIF (LIBRCF_USE_OPENSSL) ++ ++IF (LIBRCF_OPENSSL_STATIC) ++ LIST (APPEND LIBRCF_LIBRARIES ${OPENSSL_LIBRARIES}) ++ ADD_DEFINITIONS (-DRCF_OPENSSL_STATIC) ++ENDIF (LIBRCF_OPENSSL_STATIC) ++ ++IF (LIBRCF_USE_ZLIB) ++ IF (NOT ZLIB_FOUND) ++ FIND_PACKAGE (ZLIB REQUIRED) ++ ENDIF (NOT ZLIB_FOUND) ++ INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIR}) ++ ADD_DEFINITIONS (-DRCF_USE_ZLIB) ++ENDIF (LIBRCF_USE_ZLIB) ++ ++IF (LIBRCF_ZLIB_STATIC) ++ LIST (APPEND LIBRCF_LIBRARIES ${ZLIB_LIBRARIES}) ++ ADD_DEFINITIONS (-DRCF_ZLIB_STATIC) ++ENDIF (LIBRCF_ZLIB_STATIC) ++ ++IF (LIBRCF_USE_SF_SERIALIZATION) ++ IF (NOT Boost_SYSTEM_FOUND) ++ FIND_PACKAGE (Boost REQUIRED COMPONENTS system) ++ ENDIF (NOT Boost_SYSTEM_FOUND) ++ INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR}) ++ LIST (APPEND LIBRCF_LIBRARIES ${Boost_SYSTEM_LIBRARY}) ++ ADD_DEFINITIONS (-DRCF_USE_SF_SERIALIZATION) ++ENDIF (LIBRCF_USE_SF_SERIALIZATION) ++ ++IF (LIBRCF_USE_BOOST_SERIALIZATION) ++ IF (NOT Boost_SERIALIZATION_FOUND) ++ FIND_PACKAGE (Boost REQUIRED COMPONENTS serialization) ++ ENDIF (NOT Boost_SERIALIZATION_FOUND) ++ INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR}) ++ LIST (APPEND LIBRCF_LIBRARIES ${Boost_SERIALIZATION_LIBRARY}) ++ ADD_DEFINITIONS (-DRCF_USE_BOOST_SERIALIZATION) ++ENDIF (LIBRCF_USE_BOOST_SERIALIZATION) ++ ++IF (LIBRCF_USE_BOOST_FILESYSTEM) ++ IF (NOT Boost_FILESYSTEM_FOUND) ++ FIND_PACKAGE (Boost REQUIRED COMPONENTS filesystem system) ++ ENDIF (NOT Boost_FILESYSTEM_FOUND) ++ INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR}) ++ LIST (APPEND LIBRCF_LIBRARIES ${Boost_FILESYSTEM_LIBRARY}) ++ LIST (APPEND LIBRCF_LIBRARIES ${Boost_SYSTEM_LIBRARY}) ++ ADD_DEFINITIONS (-DRCF_USE_BOOST_FILESYSTEM) ++ENDIF (LIBRCF_USE_BOOST_FILESYSTEM) ++ ++IF (LIBRCF_USE_BOOST_ASIO) ++ IF (NOT Boost_FOUND) ++ FIND_PACKAGE (Boost REQUIRED) ++ ENDIF (NOT Boost_FOUND) ++ INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR}) ++ ADD_DEFINITIONS (-DRCF_USE_BOOST_ASIO) ++ENDIF (LIBRCF_USE_BOOST_ASIO) ++ ++IF (LIBRCF_USE_PROTOBUF) ++ IF(NOT Protobuf_FOUND) ++ FIND_PACKAGE (Protobuf REQUIRED) ++ ENDIF (NOT Protobuf_FOUND) ++ INCLUDE_DIRECTORIES (${Protobuf_INCLUDE_DIR}) ++ LIST (APPEND LIBRCF_LIBRARIES ${Protobuf_LIBRARIES}) ++ ADD_DEFINITIONS (-DRCF_USE_PROTOBUF) ++ENDIF (LIBRCF_USE_PROTOBUF) ++ ++IF (LIBRCF_USE_JSON) ++ IF (NOT LibJsonSpirit_FOUND) ++ FIND_PACKAGE (LibJsonSpirit REQUIRED) ++ ENDIF (NOT LibJsonSpirit_FOUND) ++ INCLUDE_DIRECTORIES (${LibJsonSpirit_INCLUDE_DIR}) ++ LIST (APPEND LIBRCF_LIBRARIES ${LibJsonSpirit_LIBRARIES}) ++ ADD_DEFINITIONS (-DRCF_USE_JSON) ++ENDIF (LIBRCF_USE_JSON) ++ ++IF (LIBRCF_USE_IPV6) ++ ADD_DEFINITIONS (-DRCF_USE_IPV6) ++ENDIF (LIBRCF_USE_IPV6) ++ ++IF (LIBRCF_USE_CUSTOM_ALLOCATOR) ++ ADD_DEFINITIONS (-DRCF_USE_CUSTOM_ALLOCATOR) ++ENDIF (LIBRCF_USE_CUSTOM_ALLOCATOR) ++ ++IF (LIBRCF_BUILD_DLL) ++ ADD_DEFINITIONS (-DRCF_BUILD_DLL) ++ENDIF (LIBRCF_BUILD_DLL) ++ ++IF (LIBRCF_AUTO_INIT_DEINIT) ++ ADD_DEFINITIONS (-DRCF_AUTO_INIT_DEINIT) ++ENDIF (LIBRCF_AUTO_INIT_DEINIT) ++ ++#################################################################### ++# SUBDIRECTORY # ++#################################################################### ++ADD_SUBDIRECTORY (src) ++ ++IF (LIBRCF_BUILD_DEMOS) ++ # Server ++ ADD_EXECUTABLE (RcfServer demo/Server.cpp) ++ TARGET_LINK_LIBRARIES (RcfServer rcf ${LIBRCF_LIBRARIES}) ++ INSTALL (TARGETS RcfServer DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ ++ # Client ++ ADD_EXECUTABLE (RcfClient demo/Client.cpp) ++ TARGET_LINK_LIBRARIES (RcfClient rcf ${LIBRCF_LIBRARIES}) ++ INSTALL (TARGETS RcfClient DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ENDIF (LIBRCF_BUILD_DEMOS) ++ ++INSTALL (FILES ${CMAKE_SOURCE_DIR}/FindLibRcf.cmake DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules) +diff --git a/FindLibRcf.cmake b/FindLibRcf.cmake +new file mode 100644 +index 0000000..9d7d8cd +--- /dev/null ++++ b/FindLibRcf.cmake +@@ -0,0 +1,63 @@ ++# FindLibRcf - Find librcf headers and libraries. ++# ++# Sample: ++# ++# SET( LibRcf_USE_STATIC_LIBS OFF ) ++# FIND_PACKAGE( LibRcf REQUIRED ) ++# IF( LibRcf_FOUND ) ++# INCLUDE_DIRECTORIES( ${LibRcf_INCLUDE_DIRS} ) ++# TARGET_LINK_LIBRARIES( ... ${LibRcf_LIBRARIES} ) ++# ENDIF() ++# ++# Variables used by this module need to be set before calling find_package ++# ++# LibRcf_USE_STATIC_LIBS Can be set to ON to force the use of the static ++# librcf libraries. Defaults to OFF. ++# ++# Variables provided by this module: ++# ++# LibRcf_FOUND Include dir, librcf libraries. ++# ++# LibRcf_LIBRARIES Link to these to use all the libraries you specified. ++# ++# LibRcf_INCLUDE_DIRS Include directories. ++# ++# For each component you specify in find_package(), the following (UPPER-CASE) ++# variables are set to pick and choose components instead of just using LibRcf_LIBRARIES: ++# ++# LIBRCF_FOUND TRUE if librcf was found ++# LIBRCF_LIBRARY librcf libraries ++# ++ ++# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES ++IF(LibRcf_USE_STATIC_LIBS) ++ SET( _ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) ++ SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ) ++ENDIF() ++ ++# Look for the header files ++UNSET(LibRcf_INCLUDE_DIRS CACHE) ++FIND_PATH(LibRcf_INCLUDE_DIRS NAMES RCF/RcfClient.hpp) ++ ++# Look for the core library ++UNSET(LIBRCF_LIBRARY CACHE) ++FIND_LIBRARY(LIBRCF_LIBRARY NAMES rcf) ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibRcf DEFAULT_MSG LIBRCF_LIBRARY LibRcf_INCLUDE_DIRS) ++MARK_AS_ADVANCED( ++ LIBRCF_FOUND ++ LIBRCF_LIBRARY ++) ++ ++# Prepare return values and collectiong more components ++SET(LibRcf_FOUND ${LIBRCF_FOUND}) ++SET(LibRcf_LIBRARIES ${LIBRCF_LIBRARY}) ++MARK_AS_ADVANCED( ++ LibRcf_FOUND ++ LibRcf_LIBRARIES ++ LibRcf_INCLUDE_DIRS ++) ++ ++# Restore CMAKE_FIND_LIBRARY_SUFFIXES ++IF(LibRcf_USE_STATIC_LIBS) ++ SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} ) ++ENDIF() +diff --git a/VERSION.cmake b/VERSION.cmake +new file mode 100644 +index 0000000..8b4bcdc +--- /dev/null ++++ b/VERSION.cmake +@@ -0,0 +1,21 @@ ++# ================================================== ++# Versioning ++# ========== ++# ++# MAJOR Major number for this branch. ++# ++# MINOR The most recent interface number this ++# library implements. ++# ++# COMPATMINOR The latest binary compatible minor number ++# this library implements. ++# ++# PATCH The implementation number of the current interface. ++# ++# ++# - The package VERSION will be MAJOR.MINOR.PATCH. ++# ++ ++SET (LIBRCF_SOVERSION_MAJOR "2") ++SET (LIBRCF_SOVERSION_MINOR "2") ++SET (LIBRCF_SOVERSION_PATCH "0") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +new file mode 100755 +index 0000000..c227901 +--- /dev/null ++++ b/src/CMakeLists.txt +@@ -0,0 +1,25 @@ ++IF (NOT LIBRCF_BUILD_SHARED_LIBS) ++ ADD_LIBRARY (rcf STATIC RCF/RCF.cpp) ++ELSE (NOT LIBRCF_BUILD_SHARED_LIBS) ++ ADD_LIBRARY (rcf SHARED RCF/RCF.cpp) ++ TARGET_LINK_LIBRARIES (rcf ${LIBRCF_LIBRARIES}) ++ SET_TARGET_PROPERTIES (rcf PROPERTIES COMPILE_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) ++ SET_TARGET_PROPERTIES (rcf PROPERTIES VERSION ${LIBRCF_SOVERSION_MAJOR}.${LIBRCF_SOVERSION_MINOR}.${LIBRCF_SOVERSION_PATCH}) ++ENDIF (NOT LIBRCF_BUILD_SHARED_LIBS) ++ ++SET_TARGET_PROPERTIES (rcf PROPERTIES PROJECT_LABEL "RCF Library") ++SET_TARGET_PROPERTIES (rcf PROPERTIES OUTPUT_NAME "rcf") ++SET_TARGET_PROPERTIES (rcf PROPERTIES SOVERSION ${LIBRCF_SOVERSION_MAJOR}) ++SET_TARGET_PROPERTIES (rcf PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_LIBDIR}) ++ ++INSTALL (DIRECTORY "${CMAKE_SOURCE_DIR}/include/RCF" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++INSTALL (DIRECTORY "${CMAKE_SOURCE_DIR}/include/SF" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++INSTALL (TARGETS rcf LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ ++IF (LIBRCF_BUILD_STATIC_LIBS AND LIBRCF_BUILD_SHARED_LIBS) ++ ADD_LIBRARY (rcf_static STATIC RCF/RCF.cpp) ++ SET_TARGET_PROPERTIES (rcf_static PROPERTIES PROJECT_LABEL "RCF Static Library") ++ SET_TARGET_PROPERTIES (rcf_static PROPERTIES OUTPUT_NAME "rcf") ++ SET_TARGET_PROPERTIES (rcf_static PROPERTIES SOVERSION ${LIBRCF_SOVERSION_MAJOR}) ++ INSTALL (TARGETS rcf_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ENDIF (LIBRCF_BUILD_STATIC_LIBS AND LIBRCF_BUILD_SHARED_LIBS) +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-Check-for-__powerpc__-define.patch b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-Check-for-__powerpc__-define.patch new file mode 100644 index 00000000..d91accf1 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-Check-for-__powerpc__-define.patch @@ -0,0 +1,28 @@ +From ac7316679e30f7013604b19aa0949a0744e91d2f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 1 Jul 2017 13:06:30 -0700 +Subject: [PATCH] Check for __powerpc__ define + +Also check for gcc's internal define for ppc platform + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/RCF/ByteOrdering.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/RCF/ByteOrdering.cpp b/src/RCF/ByteOrdering.cpp +index 278ca80..9f9c446 100755 +--- a/src/RCF/ByteOrdering.cpp ++++ b/src/RCF/ByteOrdering.cpp +@@ -36,7 +36,7 @@ namespace RCF { + + const ByteOrder MachineByteOrder = BigEndian; + +-#elif defined( __ppc__ ) ++#elif defined( __ppc__ ) || defined( __powerpc__ ) + + const ByteOrder MachineByteOrder = BigEndian; + +-- +2.13.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-ClientStub.hpp-fix-a-clang-compiling-issue.patch b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-ClientStub.hpp-fix-a-clang-compiling-issue.patch new file mode 100644 index 00000000..e949dee4 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-ClientStub.hpp-fix-a-clang-compiling-issue.patch @@ -0,0 +1,35 @@ +From d78851b6f87f2472f041102d7b3726ffc009bfad Mon Sep 17 00:00:00 2001 +From: Ming Liu <peter.x.liu@external.atlascopco.com> +Date: Tue, 6 Jun 2017 05:54:20 +0200 +Subject: [PATCH] ClientStub.hpp: fix a clang compiling issue + +A error was observed with clang compiler, as follows: +| src/RCF/RCF.cpp:49: +| src/RCF/ClientStub.cpp:28: +| include/RCF/Future.hpp:49:26: error: 'enrol' is a private member of 'RCF::ClientStub' + +it can be fixed by declaring Future as a friend class of ClientStub. + +Upstream-Status: Pending + +Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> +--- + include/RCF/ClientStub.hpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/RCF/ClientStub.hpp b/include/RCF/ClientStub.hpp +index 9882cf4..8465625 100755 +--- a/include/RCF/ClientStub.hpp ++++ b/include/RCF/ClientStub.hpp +@@ -372,6 +372,8 @@ namespace RCF { + + private: + ++ template<typename U> ++ friend class Future; + friend class FutureImplBase; + + template< +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/aarch64-support.patch b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/aarch64-support.patch new file mode 100644 index 00000000..e08efb92 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/aarch64-support.patch @@ -0,0 +1,13 @@ +Index: RCF-2.2.0.0/src/RCF/ByteOrdering.cpp +=================================================================== +--- RCF-2.2.0.0.orig/src/RCF/ByteOrdering.cpp ++++ RCF-2.2.0.0/src/RCF/ByteOrdering.cpp +@@ -60,7 +60,7 @@ namespace RCF { + + const ByteOrder MachineByteOrder = LittleEndian; + +-#elif defined(__arm__) ++#elif defined(__arm__) || defined(__aarch64__) + + const ByteOrder MachineByteOrder = LittleEndian; + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/mips-support.patch b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/mips-support.patch new file mode 100644 index 00000000..4a327f78 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/mips-support.patch @@ -0,0 +1,19 @@ +Index: RCF-2.2.0.0/src/RCF/ByteOrdering.cpp +=================================================================== +--- RCF-2.2.0.0.orig/src/RCF/ByteOrdering.cpp ++++ RCF-2.2.0.0/src/RCF/ByteOrdering.cpp +@@ -64,6 +64,14 @@ namespace RCF { + + const ByteOrder MachineByteOrder = LittleEndian; + ++#elif defined(__mipsel__) || defined(__mips64el__) ++ ++ const ByteOrder MachineByteOrder = LittleEndian; ++ ++#elif defined( __mips__ ) || defined(__mips64__) ++ ++ const ByteOrder MachineByteOrder = BigEndian; ++ + #elif defined(__bfin__) + + const ByteOrder MachineByteOrder = LittleEndian; diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf_2.2.0.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf_2.2.0.0.bb new file mode 100644 index 00000000..dcd47a4e --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf_2.2.0.0.bb @@ -0,0 +1,53 @@ +SUMMARY = "RCF (Remote Call Framework) is a cross-platform interprocess communication framework for C++" +DESCRIPTION = "Unlike other communication frameworks, RCF doesn't use a separate \ +IDL (Interface Definition Language). RCF interfaces are defined directly in C++, \ +and serialization for user-defined data types likewise is implemented in C++. \ +Instead of a separate IDL compiler tool, RCF uses the C++ compiler to generate \ +client and server stubs." +HOMEPAGE = "http://www.deltavsoft.com/" +SECTION = "libs" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://license.txt;md5=7586a312b9e978f9d6fac9a5780d1f84" + +SRC_URI = "http://www.deltavsoft.com/downloads/RCF-${PV}.tar.gz \ + file://0001-Add-CMake-build-files.patch \ + file://aarch64-support.patch \ + file://0001-ClientStub.hpp-fix-a-clang-compiling-issue.patch \ + file://mips-support.patch \ + file://0001-Check-for-__powerpc__-define.patch \ + " + +SRC_URI[md5sum] = "7ecb3c73f7eb66dba8790b659374f690" +SRC_URI[sha256sum] = "bbfcc88de502c39604878c395f516b03fff4eac63eb4f7f44c07d433839712dd" + +S = "${WORKDIR}/RCF-${PV}" + +inherit cmake dos2unix + +PACKAGECONFIG ?= "zlib openssl sf-serialization boost-filesystem boost-asio protobuf json dll static shared demos" +PACKAGECONFIG[zlib] = "-DLIBRCF_USE_ZLIB=ON,-DLIBRCF_USE_ZLIB=OFF,zlib,zlib" +PACKAGECONFIG[zlib-static] = "-DLIBRCF_USE_ZLIB=ON -DLIBRCF_ZLIB_STATIC=ON,-DLIBRCF_ZLIB_STATIC=OFF,zlib," +PACKAGECONFIG[openssl] = "-DLIBRCF_USE_OPENSSL=ON,-DLIBRCF_USE_OPENSSL=OFF,openssl,libssl libcrypto" +PACKAGECONFIG[openssl-static] = "-DLIBRCF_USE_OPENSSL=ON -DLIBRCF_OPENSSL_STATIC=ON,-DLIBRCF_OPENSSL_STATIC=OFF,openssl," +PACKAGECONFIG[sf-serialization] = "-DLIBRCF_USE_SF_SERIALIZATION=ON,-DLIBRCF_USE_SF_SERIALIZATION=OFF,boost," +PACKAGECONFIG[boost-serialization] = "-DLIBRCF_USE_BOOST_SERIALIZATION=ON,-DLIBRCF_USE_BOOST_SERIALIZATION=OFF,boost," +PACKAGECONFIG[boost-filesystem] = "-DLIBRCF_USE_BOOST_FILESYSTEM=ON,-DLIBRCF_USE_BOOST_FILESYSTEM=OFF,boost," +PACKAGECONFIG[boost-asio] = "-DLIBRCF_USE_BOOST_ASIO=ON,-DLIBRCF_USE_BOOST_ASIO=OFF,boost," +PACKAGECONFIG[protobuf] = "-DLIBRCF_USE_PROTOBUF=ON,-DLIBRCF_USE_PROTOBUF=OFF,protobuf,protobuf" +PACKAGECONFIG[json] = "-DLIBRCF_USE_JSON=ON,-DLIBRCF_USE_JSON=OFF,json-spirit,json-spirit" +PACKAGECONFIG[ipv6] = "-DLIBRCF_USE_IPV6=ON,-DLIBRCF_USE_IPV6=OFF," +PACKAGECONFIG[custom-allocator] = "-DLIBRCF_USE_CUSTOM_ALLOCATOR=ON,-DLIBRCF_USE_CUSTOM_ALLOCATOR=OFF," +PACKAGECONFIG[dll] = "-DLIBRCF_BUILD_DLL=ON,-DLIBRCF_BUILD_DLL=OFF," +PACKAGECONFIG[auto-init-deinit] = "-DLIBRCF_AUTO_INIT_DEINIT=ON,-DLIBRCF_AUTO_INIT_DEINIT=OFF," +PACKAGECONFIG[static] = "-DLIBRCF_BUILD_STATIC_LIBS=ON,-DLIBRCF_BUILD_STATIC_LIBS=OFF," +PACKAGECONFIG[shared] = "-DLIBRCF_BUILD_SHARED_LIBS=ON,-DLIBRCF_BUILD_SHARED_LIBS=OFF," +PACKAGECONFIG[demos] = "-DLIBRCF_BUILD_DEMOS=ON,-DLIBRCF_BUILD_DEMOS=OFF," + +PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'demos', '${PN}-demos', '', d)}" + +FILES_${PN}-demos = "${bindir}/*" + +BBCLASSEXTEND = "nativesdk" + +PNBLACKLIST[librcf] = " error: invalid use of incomplete type 'RCF::AsioIoService {aka class boost::asio::io_service}; among others?" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/libsombok3/libsombok3/0001-configure.ac-fix-cross-compiling-issue.patch b/external/meta-openembedded/meta-oe/recipes-devtools/libsombok3/libsombok3/0001-configure.ac-fix-cross-compiling-issue.patch new file mode 100644 index 00000000..1a692870 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/libsombok3/libsombok3/0001-configure.ac-fix-cross-compiling-issue.patch @@ -0,0 +1,31 @@ +From 9c2ffe825e28d63e2a771135f297e8ffac0dbe81 Mon Sep 17 00:00:00 2001 +From: Ming Liu <liu.ming50@gmail.com> +Date: Tue, 11 Jul 2017 14:35:30 +0200 +Subject: [PATCH] configure.ac: fix cross-compiling issue + +Avoid checking for file existence when cross compiling. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Ming Liu <liu.ming50@gmail.com> +--- + configure.ac | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 9978852..06b16e3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -120,9 +120,6 @@ AC_ARG_WITH(unicode-version, + AC_HELP_STRING(--with-unicode-version=VERSION, + [version of Unicode Standard @<:@default=current version@:>@]), + UNICODE_VERSION=$withval,UNICODE_VERSION=$DEFAULT_UNICODE_VERSION) +-AC_CHECK_FILE([lib/$UNICODE_VERSION.c], +- AC_MSG_RESULT($UNICODE_VERSION), +- AC_MSG_ERROR(Unknown Unicode version $UNICODE_VERSION.)) + AC_SUBST(UNICODE_VERSION) + + # check if code to debug memory allocation is enabled. +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/libsombok3/libsombok3_2.4.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/libsombok3/libsombok3_2.4.0.bb new file mode 100644 index 00000000..b83e86a4 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/libsombok3/libsombok3_2.4.0.bb @@ -0,0 +1,25 @@ +SUMMARY = "Sombok - Unicode Text Segmentation Package." +DESCRIPTION = "Sombok library package performs Line Breaking Algorithm described in \ +Unicode Standard Annex #14 (UAX #14). East_Asian_Width informative \ +properties defined by Annex #11 (UAX #11) may be concerned to determin \ +breaking positions. This package also implements "default" Grapheme \ +Cluster segmentation described in Annex #29 (UAX #29)." +LICENSE = "Artistic-1.0 | GPLv1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=5b122a36d0f6dc55279a0ebc69f3c60b" + +SRC_URI = "git://github.com/hatukanezumi/sombok.git;protocol=https \ + file://0001-configure.ac-fix-cross-compiling-issue.patch \ + " + +inherit autotools pkgconfig + +# sombok-2.4.0 +SRCREV = "0098d85a037ef5c99a648a3669a077781a45e8cc" + +S = "${WORKDIR}/git" +B = "${S}" + +# Disable libthai support +EXTRA_OECONF = "--disable-libthai" + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox/0001-version-libraries.patch b/external/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox/0001-version-libraries.patch new file mode 100644 index 00000000..02117fa8 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox/0001-version-libraries.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 57804cf..1aa7f27 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,6 +18,7 @@ ENDIF() + SET(SOURCES avl.c avl-cmp.c blob.c blobmsg.c uloop.c usock.c ustream.c ustream-fd.c vlist.c utils.c safe_list.c runqueue.c md5.c kvlist.c ulog.c base64.c) + + ADD_LIBRARY(ubox SHARED ${SOURCES}) ++SET_TARGET_PROPERTIES(ubox PROPERTIES VERSION 1.0.1 SOVERSION 1) + ADD_LIBRARY(ubox-static STATIC ${SOURCES}) + SET_TARGET_PROPERTIES(ubox-static PROPERTIES OUTPUT_NAME ubox) + +@@ -46,6 +47,7 @@ find_library(json NAMES json-c) + IF(EXISTS ${json}) + ADD_LIBRARY(blobmsg_json SHARED blobmsg_json.c) + TARGET_LINK_LIBRARIES(blobmsg_json ubox ${json}) ++ SET_TARGET_PROPERTIES(blobmsg_json PROPERTIES VERSION 1.0.1 SOVERSION 1) + + ADD_LIBRARY(blobmsg_json-static STATIC blobmsg_json.c) + SET_TARGET_PROPERTIES(blobmsg_json-static +@@ -55,6 +57,7 @@ IF(EXISTS ${json}) + TARGET_LINK_LIBRARIES(jshn blobmsg_json ${json}) + + ADD_LIBRARY(json_script SHARED json_script.c) ++ SET_TARGET_PROPERTIES(json_script PROPERTIES VERSION 1.0.1 SOVERSION 1) + TARGET_LINK_LIBRARIES(json_script ubox) + + INSTALL(TARGETS blobmsg_json blobmsg_json-static jshn json_script diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox/fix-libdir.patch b/external/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox/fix-libdir.patch new file mode 100644 index 00000000..6f09c8b2 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox/fix-libdir.patch @@ -0,0 +1,40 @@ +[PATCH] fix the CMAKE_INSTALL_LIBDIR + +Upstream-Status: Pending + +libdir maybe /usr/lib64 for 64bit machine + +Signed-off-by: Roy Li <rongqing.li@windriver.com> +--- + CMakeLists.txt | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 57804cf..2c7bdc1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,8 +35,8 @@ INSTALL(FILES ${headers} + DESTINATION include/libubox + ) + INSTALL(TARGETS ubox ubox-static +- ARCHIVE DESTINATION lib +- LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + + ADD_SUBDIRECTORY(lua) +@@ -58,8 +58,8 @@ IF(EXISTS ${json}) + TARGET_LINK_LIBRARIES(json_script ubox) + + INSTALL(TARGETS blobmsg_json blobmsg_json-static jshn json_script +- ARCHIVE DESTINATION lib +- LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION bin + ) + +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox_git.bb new file mode 100644 index 00000000..f9f4e08b --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox_git.bb @@ -0,0 +1,30 @@ +DESCRIPTION = "C utility functions for OpenWrt" +SECTION = "libs" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "\ + file://avl.c;endline=39;md5=00810155fed3d604816ec5814523d60a \ + file://avl-cmp.c;endline=15;md5=1603e6094b432a5f3f320877a06f41b5 \ + file://base64.c;endline=61;md5=51fdff010d45b0086ac0a6e035693dc0 \ + file://blobmsg.c;endline=15;md5=7ed64c1570e8c9b46c4fc6fbd16c489e \ + file://list.h;endline=28;md5=2d5f5475fbd0f08741354c5a99c2e983 \ + file://md5.h;endline=39;md5=048bf9f68963c207a0c2b3a94c9d2aaa \ + file://md5.c;endline=51;md5=0a448eea0bcbc89e3c7e6608f2d119a0 \ + file://usock.h;endline=18;md5=f0dfdc8de858e66d66d74036611bba14 \ +" + +SRC_URI = "\ + git://git.openwrt.org/project/libubox.git \ + file://0001-version-libraries.patch \ + file://fix-libdir.patch \ +" + +SRCREV = "155bf39896f126b1ba121b816922a88dc34c31e3" +PV = "1.0.1+git${SRCPV}" + +S = "${WORKDIR}/git" + +inherit cmake + +DEPENDS = "json-c" + +EXTRA_OECMAKE = "-DBUILD_EXAMPLES=OFF -DBUILD_LUA=OFF" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/log4cplus/log4cplus_2.0.2.bb b/external/meta-openembedded/meta-oe/recipes-devtools/log4cplus/log4cplus_2.0.2.bb new file mode 100644 index 00000000..d17d15c9 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/log4cplus/log4cplus_2.0.2.bb @@ -0,0 +1,18 @@ +SUMMARY = "log4cplus provides a simple C++ logging API for log management" +SECTION = "libs" +HOMEPAGE = "http://sourceforge.net/projects/log4cplus/" +BUGTRACKER = "http://sourceforge.net/p/log4cplus/bugs/" + +LICENSE = "Apache-2.0 & BSD-2-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=41e8e060c26822886b592ab4765c756b" + +SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}-stable/${PV}/${BP}.tar.gz" +SRC_URI[md5sum] = "b3bbeb2dc3e170768430cf87583016f8" +SRC_URI[sha256sum] = "10539f2315271d370c7bc6a2b4808cbe369279837f4539ce5c789e456489fc62" + +UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/log4cplus/files/log4cplus-stable/" +UPSTREAM_CHECK_REGEX = "log4cplus-stable/(?P<pver>\d+(\.\d+)+)/" + +inherit autotools pkgconfig + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Fix-cross-compilation.patch b/external/meta-openembedded/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Fix-cross-compilation.patch new file mode 100644 index 00000000..6db6ab95 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lshw/files/0001-Makefile-Fix-cross-compilation.patch @@ -0,0 +1,57 @@ +From 62f9ed95b5d0feab426bff452be793c62a6b795a Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski <krzk@kernel.org> +Date: Wed, 6 Jun 2018 12:49:21 +0200 +Subject: [PATCH 1/2] Makefile: Fix cross compilation + +Allow building on ARMv7 and ARMv8. + +Upstream-Status: Submitted +Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> +--- + src/Makefile | 2 +- + src/core/Makefile | 2 +- + src/gui/Makefile | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index b50586bc9234..654b786dd899 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -18,7 +18,7 @@ export MANDIR + export DATADIR + export SQLITE + +-CXX?=c++ ++CXX?=$(CROSS_COMPILE)c++ + INCLUDES=-I./core/ + DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" + CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) +diff --git a/src/core/Makefile b/src/core/Makefile +index 5bf5a69cc6a6..2bd1b94c4175 100644 +--- a/src/core/Makefile ++++ b/src/core/Makefile +@@ -1,6 +1,6 @@ + PACKAGENAME?=lshw + +-CXX=c++ ++CXX?=$(CROSS_COMPILE)c++ + INCLUDES= + DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" + CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) +diff --git a/src/gui/Makefile b/src/gui/Makefile +index 332ce5704819..b0f925490356 100644 +--- a/src/gui/Makefile ++++ b/src/gui/Makefile +@@ -1,7 +1,7 @@ + PACKAGENAME?=lshw + +-CXX?=c++ +-CC?=cc ++CXX?=$(CROSS_COMPILE)c++ ++CC?=$(CROSS_COMPILE)cc + STRIP?=strip + OBJCOPY?=objcopy + +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lshw/files/0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch b/external/meta-openembedded/meta-oe/recipes-devtools/lshw/files/0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch new file mode 100644 index 00000000..d3da01b4 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lshw/files/0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch @@ -0,0 +1,34 @@ +From 75667f8a0ae4f1689ff03eb1768b1ee8cdfbf00d Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski <krzk@kernel.org> +Date: Wed, 6 Jun 2018 12:49:30 +0200 +Subject: [PATCH 2/2] Makefile: Use supplied LDFLAGS to silence OE GNU_HASH QA + warning + +Fix OpenEmbedded/Yocto QA warning: + + ERROR: lshw-02.16-r1 do_package_qa: QA Issue: No GNU_HASH in the elf binary: 'build/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/lshw/02.16-r1/packages-split/lshw/usr/sbin/lshw' [ldflags] + ERROR: lshw-02.16-r1 do_package_qa: QA run found fatal errors. Please consider fixing them. + ERROR: lshw-02.16-r1 do_package_qa: Function failed: do_package_qa + +Upstream-Status: Submitted +Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index 654b786dd899..a441ba2bb666 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -25,7 +25,7 @@ CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) + ifeq ($(SQLITE), 1) + CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3) + endif +-LDFLAGS=-L./core/ -g ++LDFLAGS+=-L./core/ -g + ifneq ($(shell $(LD) --help 2| grep -- --as-needed), ) + LDFLAGS+= -Wl,--as-needed + endif +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lshw/files/0003-sysfs-Fix-basename-build-with-musl.patch b/external/meta-openembedded/meta-oe/recipes-devtools/lshw/files/0003-sysfs-Fix-basename-build-with-musl.patch new file mode 100644 index 00000000..34924939 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lshw/files/0003-sysfs-Fix-basename-build-with-musl.patch @@ -0,0 +1,92 @@ +From a89f2ba8496994c8b5e28a89202df15d64c648f9 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski <krzk@kernel.org> +Date: Wed, 6 Jun 2018 12:47:02 +0200 +Subject: [PATCH] sysfs: Fix basename() build with musl + +musl provides only standard basename() which accepts non-const string. +This fixes build error with musl C library: + + | sysfs.cc: In function 'std::__cxx11::string sysfs_getbustype(const string&)': + | sysfs.cc:102:21: error: 'basename' was not declared in this scope + | "/devices/" + basename(path.c_str()); + | ^~~~~~~~ + +Upstream-Status: Submitted +Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> +--- + src/core/dasd.cc | 3 ++- + src/core/sysfs.cc | 9 +++++---- + 2 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/core/dasd.cc b/src/core/dasd.cc +index 626b8a872b0f..b27844215cc4 100644 +--- a/src/core/dasd.cc ++++ b/src/core/dasd.cc +@@ -2,6 +2,7 @@ + #include "osutils.h" + #include "dasd.h" + #include <glob.h> ++#include <libgen.h> + #include <string.h> + #include <fcntl.h> + #include <unistd.h> +@@ -42,7 +43,7 @@ bool scan_dasd(hwNode & n) + { + for(dev_num=0;dev_num<devices.gl_pathc;dev_num++) + { +- dev_name = basename(devices.gl_pathv[dev_num]); ++ dev_name = basename(const_cast<char *>(devices.gl_pathv[dev_num])); + for (std::vector<std::string>::iterator it = sysfs_attribs.begin(); it != sysfs_attribs.end(); ++it) + { + std::string attrib_fname = std::string(SYSFS_PREFIX) + dev_name + "/device/" + *it; +diff --git a/src/core/sysfs.cc b/src/core/sysfs.cc +index acc9d0056d5e..c56bab7b3b9f 100644 +--- a/src/core/sysfs.cc ++++ b/src/core/sysfs.cc +@@ -7,6 +7,7 @@ + #include "version.h" + #include "sysfs.h" + #include "osutils.h" ++#include <libgen.h> + #include <limits.h> + #include <unistd.h> + #include <stdlib.h> +@@ -99,7 +100,7 @@ static string sysfs_getbustype(const string & path) + { + devname = + string(fs.path + "/bus/") + string(namelist[i]->d_name) + +- "/devices/" + basename(path.c_str()); ++ "/devices/" + basename(const_cast<char *>(path.c_str())); + + if (samefile(devname, path)) + return string(namelist[i]->d_name); +@@ -139,7 +140,7 @@ static string sysfstobusinfo(const string & path) + + if (bustype == "virtio") + { +- string name = basename(path.c_str()); ++ string name = basename(const_cast<char *>(path.c_str())); + if (name.compare(0, 6, "virtio") == 0) + return "virtio@" + name.substr(6); + else +@@ -207,7 +208,7 @@ string entry::driver() const + string driverlink = This->devpath + "/driver"; + if (!exists(driverlink)) + return ""; +- return basename(readlink(driverlink).c_str()); ++ return basename(const_cast<char *>(readlink(driverlink).c_str())); + } + + +@@ -288,7 +289,7 @@ string entry::name_in_class(const string & classname) const + + string entry::name() const + { +- return basename(This->devpath.c_str()); ++ return basename(const_cast<char *>(This->devpath.c_str())); + } + + +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lshw/lshw_02.18.bb b/external/meta-openembedded/meta-oe/recipes-devtools/lshw/lshw_02.18.bb new file mode 100644 index 00000000..b344fbf3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lshw/lshw_02.18.bb @@ -0,0 +1,32 @@ +DESCRIPTION = "A small tool to provide detailed information on the hardware \ +configuration of the machine. It can report exact memory configuration, \ +firmware version, mainboard configuration, CPU version and speed, cache \ +configuration, bus speed, etc. on DMI-capable or EFI systems." +SUMMARY = "Hardware lister" +HOMEPAGE = "http://ezix.org/project/wiki/HardwareLiSter" +SECTION = "console/tools" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" + +SRC_URI = " \ + http://ezix.org/software/files/lshw-B.${PV}.tar.gz \ + file://0001-Makefile-Fix-cross-compilation.patch \ + file://0002-Makefile-Use-supplied-LDFLAGS-to-silence-OE-GNU_HASH.patch \ + file://0003-sysfs-Fix-basename-build-with-musl.patch \ +" +SRC_URI[md5sum] = "8671c6d94d6324a744b7f21f1bfecfd2" +SRC_URI[sha256sum] = "ae22ef11c934364be4fd2a0a1a7aadf4495a0251ec6979da280d342a89ca3c2f" + +S = "${WORKDIR}/lshw-B.${PV}" + +do_compile() { + # build core only - don't ship gui + oe_runmake -C src core +} + +do_install() { + oe_runmake install DESTDIR=${D} +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch new file mode 100644 index 00000000..4d0e0392 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch @@ -0,0 +1,40 @@ +From 95ff340a74af16cca89fd5c5ca99890821053209 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 22 Apr 2017 00:47:16 -0700 +Subject: [PATCH] ARM code has unreachable code after switch statement move + initialization + +Fixed +sysdeps/linux-gnu/arm/trace.c:173:33: error: statement will never be executed [-Werror=switch-unreachable] + uint32_t operand1, operand2, result = 0; + ^~~~~~ + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/linux-gnu/arm/trace.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sysdeps/linux-gnu/arm/trace.c b/sysdeps/linux-gnu/arm/trace.c +index 5e51e91..f974d1f 100644 +--- a/sysdeps/linux-gnu/arm/trace.c ++++ b/sysdeps/linux-gnu/arm/trace.c +@@ -155,6 +155,8 @@ arm_get_next_pcs(struct process *proc, + const unsigned cond = BITS(this_instr, 28, 31); + const unsigned opcode = BITS(this_instr, 24, 27); + ++ uint32_t operand1, operand2, result = 0; ++ + if (cond == COND_NV) + switch (opcode) { + arch_addr_t addr; +@@ -170,7 +172,6 @@ arm_get_next_pcs(struct process *proc, + } + else + switch (opcode) { +- uint32_t operand1, operand2, result = 0; + case 0x0: + case 0x1: /* data processing */ + case 0x2: +-- +2.12.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Add-support-for-mips64-n32-n64.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Add-support-for-mips64-n32-n64.patch new file mode 100644 index 00000000..d0daf146 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Add-support-for-mips64-n32-n64.patch @@ -0,0 +1,1148 @@ +From 5f6dfafb80bdc2566fe91d5fde96769175fabf35 Mon Sep 17 00:00:00 2001 +From: Faraz Shahbazker <faraz.shahbazker@imgtec.com> +Date: Sat, 1 Jul 2017 10:56:59 -0700 +Subject: [PATCH] Add support for mips64 n32/n64 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending +Source: http://lists.alioth.debian.org/pipermail/ltrace-devel/2015-May/001327.html + + backend.h | 8 + + ltrace-elf.c | 12 ++ + proc.h | 1 + + sysdeps/linux-gnu/mips/Makefile.am | 1 + + sysdeps/linux-gnu/mips/abi.c | 64 +++++++ + sysdeps/linux-gnu/mips/arch.h | 24 ++- + sysdeps/linux-gnu/mips/plt.c | 68 ++++++-- + sysdeps/linux-gnu/mips/signalent1.h | 52 ++++++ + sysdeps/linux-gnu/mips/syscallent1.h | 328 +++++++++++++++++++++++++++++++++++ + sysdeps/linux-gnu/mips/trace.c | 241 ++++++++++++++++++------- + sysdeps/linux-gnu/mksyscallent_mips | 9 +- + 11 files changed, 728 insertions(+), 80 deletions(-) + create mode 100644 sysdeps/linux-gnu/mips/abi.c + create mode 100644 sysdeps/linux-gnu/mips/signalent1.h + create mode 100644 sysdeps/linux-gnu/mips/syscallent1.h + +diff --git a/backend.h b/backend.h +index e25daa0..0d6926a 100644 +--- a/backend.h ++++ b/backend.h +@@ -314,6 +314,14 @@ int arch_process_exec(struct process *proc); + int arch_get_sym_info(struct ltelf *lte, const char *filename, size_t sym_index, + GElf_Rela *rela, GElf_Sym *sym); + ++/* The following callback has to be implemented in backend if arch.h ++ * defines ARCH_HAVE_GET_ABI ++ * ++ * This is called from read_module just once, when reading the main module. ++ * The value returned is an architecture specific ID for the current ABI ++ * to be used later for ABI-specific operations. */ ++char arch_get_abi(GElf_Ehdr ehdr); ++ + enum plt_status { + PLT_FAIL, + PLT_OK, +diff --git a/ltrace-elf.c b/ltrace-elf.c +index f439cb0..a85edca 100644 +--- a/ltrace-elf.c ++++ b/ltrace-elf.c +@@ -1131,6 +1131,14 @@ populate_symtab(struct process *proc, const char *filename, + only_exported_names); + } + ++#ifndef ARCH_HAVE_GET_ABI ++char ++arch_get_abi(GElf_Ehdr ehdr) ++{ ++ return 0; ++} ++#endif ++ + static int + read_module(struct library *lib, struct process *proc, + const char *filename, GElf_Addr bias, int main) +@@ -1151,6 +1159,10 @@ read_module(struct library *lib, struct process *proc, + * with 32-bit ltrace. It is desirable to preserve this. */ + proc->e_machine = lte.ehdr.e_machine; + proc->e_class = lte.ehdr.e_ident[EI_CLASS]; ++ /* Another candidate for the ABI module. We probably ++ * want to do all of the e_* stuff only once, for main */ ++ if (main) ++ proc->e_abi = arch_get_abi(lte.ehdr); + get_arch_dep(proc); + + /* Find out the base address. For PIE main binaries we look +diff --git a/proc.h b/proc.h +index a611456..00094e1 100644 +--- a/proc.h ++++ b/proc.h +@@ -117,6 +117,7 @@ struct process { + * nauseam. */ + short e_machine; + char e_class; ++ char e_abi; + + #if defined(HAVE_LIBDW) + /* Unwind info for leader, NULL for non-leader procs. */ +diff --git a/sysdeps/linux-gnu/mips/Makefile.am b/sysdeps/linux-gnu/mips/Makefile.am +index 1fd8c2a..571ee0d 100644 +--- a/sysdeps/linux-gnu/mips/Makefile.am ++++ b/sysdeps/linux-gnu/mips/Makefile.am +@@ -20,6 +20,7 @@ noinst_LTLIBRARIES = \ + ../libcpu.la + + ___libcpu_la_SOURCES = \ ++ abi.c \ + plt.c \ + regs.c \ + trace.c +diff --git a/sysdeps/linux-gnu/mips/abi.c b/sysdeps/linux-gnu/mips/abi.c +new file mode 100644 +index 0000000..64e3c10 +--- /dev/null ++++ b/sysdeps/linux-gnu/mips/abi.c +@@ -0,0 +1,64 @@ ++/* ++ * This file is part of ltrace. ++ * Copyright (C) 2015 Imagination Technologies Limited ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ++ * 02110-1301 USA ++ */ ++ ++#include <stdio.h> ++#include <gelf.h> ++#include "arch.h" ++ ++/* ++ * There is no bit in the header-flags to mark N64 ABI, it must be ++ * determined by exclusion of other ABIs. The following values are ++ * from elfcpp/mips.h in binutils sources ++ */ ++enum ++{ ++ E_MIPS_ABI_MASK = 0x0000F000, ++ E_MIPS_ABI_N32 = 0x00000020, ++ E_MIPS_ABI_O32 = 0x00001000, ++ E_MIPS_ABI_O64 = 0x00002000, ++ E_MIPS_ABI_EABI32 = 0x00003000, ++ E_MIPS_ABI_EABI64 = 0x00004000, ++}; ++ ++char ++arch_get_abi(GElf_Ehdr ehdr) ++{ ++ enum mips_abi_type abi; ++ switch (ehdr.e_flags & E_MIPS_ABI_MASK) { ++ case E_MIPS_ABI_O32: ++ abi = ABI_O32; break; ++ case E_MIPS_ABI_O64: ++ abi = ABI_O64; break; ++ case E_MIPS_ABI_EABI32: ++ case E_MIPS_ABI_EABI64: ++ fprintf(stderr, "%s: MIPS EABI is not supported\n", __func__); ++ abi = -1; ++ break; ++ default: ++ if (ehdr.e_flags & E_MIPS_ABI_N32) ++ abi = ABI_N32; ++ else ++ abi = ABI_N64; ++ } ++ ++ return abi; ++} ++ ++/**@}*/ +diff --git a/sysdeps/linux-gnu/mips/arch.h b/sysdeps/linux-gnu/mips/arch.h +index 16273d2..8b75df2 100644 +--- a/sysdeps/linux-gnu/mips/arch.h ++++ b/sysdeps/linux-gnu/mips/arch.h +@@ -1,5 +1,6 @@ + /* + * This file is part of ltrace. ++ * Copyright (C) 2015 Imagination Technologies Limited + * Copyright (C) 2013,2014 Petr Machata, Red Hat Inc. + * Copyright (C) 2006 Eric Vaitl + * +@@ -38,8 +39,12 @@ + #define BREAKPOINT_LENGTH 4 + #define DECR_PC_AFTER_BREAK 0 + +-#define LT_ELFCLASS ELFCLASS32 ++#ifdef __LP64__ ++#define LT_ELFCLASS ELFCLASS64 + #define LT_ELF_MACHINE EM_MIPS ++#endif /* __LP64__ */ ++#define LT_ELFCLASS2 ELFCLASS32 ++#define LT_ELF_MACHINE2 EM_MIPS + + #define ARCH_HAVE_LTELF_DATA + struct arch_ltelf_data { +@@ -53,8 +58,14 @@ struct arch_ltelf_data { + #define ARCH_HAVE_ADD_PLT_ENTRY + #define ARCH_HAVE_SW_SINGLESTEP + #define ARCH_HAVE_SYMBOL_RET +- ++#define ARCH_HAVE_GET_ABI + #define ARCH_HAVE_LIBRARY_SYMBOL_DATA ++ ++#ifdef __LP64__ ++#define ARCH_HAVE_SIZEOF ++#define ARCH_HAVE_ALIGNOF ++#endif /* __LP64__ */ ++ + enum mips_plt_type + { + /* A symbol has associated PLT entry. */ +@@ -73,7 +84,14 @@ enum mips_plt_type + MIPS_PLT_NEED_UNRESOLVE, + }; + +-struct mips_unresolve_data; ++enum mips_abi_type ++{ ++ ABI_O32, ++ ABI_N32, ++ ABI_N64, ++ ABI_O64, ++}; ++ + struct arch_library_symbol_data { + enum mips_plt_type type; + union { +diff --git a/sysdeps/linux-gnu/mips/plt.c b/sysdeps/linux-gnu/mips/plt.c +index f3c12da..2d85ad9 100644 +--- a/sysdeps/linux-gnu/mips/plt.c ++++ b/sysdeps/linux-gnu/mips/plt.c +@@ -1,5 +1,6 @@ + /* + * This file is part of ltrace. ++ * Copyright (C) 2015 Imagination Technologies Limited + * Copyright (C) 2012,2013,2014 Petr Machata, Red Hat Inc. + * Copyright (C) 2012 Edgar E. Iglesias, Axis Communications + * Copyright (C) 2008,2009 Juan Cespedes +@@ -182,6 +183,11 @@ arch_find_dl_debug(struct process *proc, arch_addr_t dyn_addr, + { + arch_addr_t rld_addr; + int r; ++#ifdef __LP64__ ++ size_t addrsize = proc->mask_32bit ? 4 : (sizeof *ret); ++#else /* !__LP64__ */ ++ size_t addrsize = sizeof *ret; ++#endif /* !__LP64__ */ + + /* MIPS puts the address of the r_debug structure into the + * DT_MIPS_RLD_MAP entry instead of into the DT_DEBUG entry. */ +@@ -189,7 +195,7 @@ arch_find_dl_debug(struct process *proc, arch_addr_t dyn_addr, + DT_MIPS_RLD_MAP, &rld_addr); + if (r == 0) { + if (umovebytes(proc, rld_addr, +- ret, sizeof *ret) != sizeof *ret) { ++ ret, addrsize) != addrsize) { + r = -1; + } + } +@@ -295,14 +301,25 @@ arch_elf_init(struct ltelf *lte, struct library *lib) + + for (j = 0; j < data->d_size / 16; ++j) { + uint32_t insn; ++ int got_size = 4; ++ uint32_t load_inst = 0x24180000U; /* addui t8,0,xx */ ++ ++#ifdef __LP64__ ++ if (arch_get_abi(lte->ehdr) == ABI_N64 ++ || arch_get_abi(lte->ehdr) == ABI_O64) { ++ got_size = 8; ++ load_inst = 0x64180000U; /* daddui t8,0,xx */ ++ } ++#endif /* __LP64__ */ ++ + if (elf_read_u32(data, j * 16 + 12, &insn) < 0) + goto fail_stubs; + + if (insn == 0) + continue; + +- /* 0x2418XXXX encodes lbu 0,t8,XXXX or li t8,XXXX. */ +- if ((insn & 0xffff0000U) != 0x24180000U) ++ /* 0x[62]418XXXX encodes [d]addiu t8, 0, XXXX. */ ++ if ((insn & 0xffff0000U) != load_inst) + goto fail_stubs; + + unsigned idx = insn & 0xffff; +@@ -323,8 +340,8 @@ arch_elf_init(struct ltelf *lte, struct library *lib) + + lte->arch.mips_local_gotno; + /* XXX Double cast. */ + arch_addr_t got_entry_addr +- = (arch_addr_t) (uintptr_t) lte->arch.pltgot_addr +- + got_idx * 4; ++ = (arch_addr_t) (uintptr_t) (lte->arch.pltgot_addr ++ + got_idx * got_size); + + GElf_Rela rela = { + /* XXX double cast. */ +@@ -336,7 +353,7 @@ arch_elf_init(struct ltelf *lte, struct library *lib) + if (VECT_PUSHBACK(<e->plt_relocs, &rela) < 0) + goto fail_stubs; + +- fprintf(stderr, ++ debug(2, + "added stub entry for symbol %u at %#lx, GOT @%p\n", + idx, (unsigned long) rela.r_addend, got_entry_addr); + } +@@ -362,8 +379,17 @@ read_got_entry(struct process *proc, GElf_Addr addr, GElf_Addr *valp) + { + /* XXX double cast. */ + arch_addr_t a = (arch_addr_t) (uintptr_t) addr; +- uint32_t l; +- if (proc_read_32(proc, a, &l) < 0) { ++ uint64_t l = 0; ++ int result; ++ ++#ifdef __LP64__ ++ if (!proc->mask_32bit) ++ result = proc_read_64(proc, a, &l); ++ else ++#endif /* __LP64__ */ ++ result = proc_read_32(proc, a, (uint32_t *) &l); ++ ++ if (result < 0) { + fprintf(stderr, "ptrace read got entry @%#" PRIx64 ": %s\n", + addr, strerror(errno)); + return -1; +@@ -426,13 +452,13 @@ arch_elf_add_plt_entry(struct process *proc, struct ltelf *lte, + GElf_Addr stub_addr = rela->r_addend + lte->bias; + + debug(2, "PLT-less arch_elf_add_plt_entry %s = %#llx\n", +- a_name, stub_addr); ++ a_name, (unsigned long long) stub_addr); + + struct library_symbol *libsym = NULL; + if (default_elf_add_plt_entry(proc, lte, a_name, rela, ndx, + &libsym) < 0) { +- fprintf(stderr, "%s: failed %s(%#llx): %s\n", __func__, +- a_name, stub_addr, strerror(errno)); ++ fprintf(stderr, "%s: failed %s(%#lx): %s\n", __func__, ++ a_name, (unsigned long) stub_addr, strerror(errno)); + goto fail; + } + +@@ -503,13 +529,27 @@ jump_to_entry_point(struct process *proc, struct breakpoint *bp) + static int + unresolve_got_entry(struct process *proc, GElf_Addr addr, GElf_Addr value) + { +- uint32_t v32 = (uint32_t) value; +- uint32_t a32 = (uint32_t) addr; +- if (ptrace(PTRACE_POKETEXT, proc->pid, a32, v32) < 0) { ++ arch_addr_t a = (arch_addr_t) (uintptr_t) addr; ++#ifdef __LP64__ ++ /* To write 32-bit value in 64-bit mode, we must read-modify-write ++ the 64-bit value with only the lower 32 bits modified. */ ++ if (proc->mask_32bit) { ++ GElf_Addr orig = ptrace(PTRACE_PEEKTEXT, proc->pid, a, 0); ++ char *obytes = (char *) &orig; ++ char *nbytes = (char *) &value; ++ unsigned i; ++ ++ for (i = 0; i < 4; i++) ++ obytes[i] = nbytes[i]; ++ value = orig; ++ } ++#endif /* __LP64__ */ ++ if (ptrace(PTRACE_POKETEXT, proc->pid, a, (unsigned long) value) < 0) { + fprintf(stderr, "failed to unresolve GOT entry: %s\n", + strerror(errno)); + return -1; + } ++ + return 0; + } + +diff --git a/sysdeps/linux-gnu/mips/signalent1.h b/sysdeps/linux-gnu/mips/signalent1.h +new file mode 100644 +index 0000000..9e9d1f7 +--- /dev/null ++++ b/sysdeps/linux-gnu/mips/signalent1.h +@@ -0,0 +1,52 @@ ++/* ++ * This file is part of ltrace. ++ * Copyright (C) 2015 Imagination Technologies Limited ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ++ * 02110-1301 USA ++ */ ++ ++ "SIG_0", /* 0 */ ++ "SIGHUP", /* 1 */ ++ "SIGINT", /* 2 */ ++ "SIGQUIT", /* 3 */ ++ "SIGILL", /* 4 */ ++ "SIGTRAP", /* 5 */ ++ "SIGIOT", /* 6 */ ++ "SIGEMT", /* 7 */ ++ "SIGFPE", /* 8 */ ++ "SIGKILL", /* 9 */ ++ "SIGBUS", /* 10 */ ++ "SIGSEGV", /* 11 */ ++ "SIGSYS", /* 12 */ ++ "SIGPIPE", /* 13 */ ++ "SIGALRM", /* 14 */ ++ "SIGTERM", /* 15 */ ++ "SIGUSR1", /* 16 */ ++ "SIGUSR2", /* 17 */ ++ "SIGCHLD", /* 18 */ ++ "SIGPWR", /* 19 */ ++ "SIGWINCH", /* 20 */ ++ "SIGURG", /* 21 */ ++ "SIGIO", /* 22 */ ++ "SIGSTOP", /* 23 */ ++ "SIGTSTP", /* 24 */ ++ "SIGCONT", /* 25 */ ++ "SIGTTIN", /* 26 */ ++ "SIGTTOU", /* 27 */ ++ "SIGVTALRM", /* 28 */ ++ "SIGPROF", /* 29 */ ++ "SIGXCPU", /* 30 */ ++ "SIGXFSZ", /* 31 */ +diff --git a/sysdeps/linux-gnu/mips/syscallent1.h b/sysdeps/linux-gnu/mips/syscallent1.h +new file mode 100644 +index 0000000..dfa4954 +--- /dev/null ++++ b/sysdeps/linux-gnu/mips/syscallent1.h +@@ -0,0 +1,328 @@ ++/* ++ * This file is part of ltrace. ++ * Copyright (C) 2015 Imagination Technologies Limited ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ++ * 02110-1301 USA ++ */ ++ ++/* MIPS64 */ ++ ++ "read", /* 0 */ ++ "write", /* 1 */ ++ "open", /* 2 */ ++ "close", /* 3 */ ++ "stat", /* 4 */ ++ "fstat", /* 5 */ ++ "lstat", /* 6 */ ++ "poll", /* 7 */ ++ "lseek", /* 8 */ ++ "mmap", /* 9 */ ++ "mprotect", /* 10 */ ++ "munmap", /* 11 */ ++ "brk", /* 12 */ ++ "rt_sigaction", /* 13 */ ++ "rt_sigprocmask", /* 14 */ ++ "ioctl", /* 15 */ ++ "pread64", /* 16 */ ++ "pwrite64", /* 17 */ ++ "readv", /* 18 */ ++ "writev", /* 19 */ ++ "access", /* 20 */ ++ "pipe", /* 21 */ ++ "_newselect", /* 22 */ ++ "sched_yield", /* 23 */ ++ "mremap", /* 24 */ ++ "msync", /* 25 */ ++ "mincore", /* 26 */ ++ "madvise", /* 27 */ ++ "shmget", /* 28 */ ++ "shmat", /* 29 */ ++ "shmctl", /* 30 */ ++ "dup", /* 31 */ ++ "dup2", /* 32 */ ++ "pause", /* 33 */ ++ "nanosleep", /* 34 */ ++ "getitimer", /* 35 */ ++ "setitimer", /* 36 */ ++ "alarm", /* 37 */ ++ "getpid", /* 38 */ ++ "sendfile", /* 39 */ ++ "socket", /* 40 */ ++ "connect", /* 41 */ ++ "accept", /* 42 */ ++ "sendto", /* 43 */ ++ "recvfrom", /* 44 */ ++ "sendmsg", /* 45 */ ++ "recvmsg", /* 46 */ ++ "shutdown", /* 47 */ ++ "bind", /* 48 */ ++ "listen", /* 49 */ ++ "getsockname", /* 50 */ ++ "getpeername", /* 51 */ ++ "socketpair", /* 52 */ ++ "setsockopt", /* 53 */ ++ "getsockopt", /* 54 */ ++ "clone", /* 55 */ ++ "fork", /* 56 */ ++ "execve", /* 57 */ ++ "exit", /* 58 */ ++ "wait4", /* 59 */ ++ "kill", /* 60 */ ++ "uname", /* 61 */ ++ "semget", /* 62 */ ++ "semop", /* 63 */ ++ "semctl", /* 64 */ ++ "shmdt", /* 65 */ ++ "msgget", /* 66 */ ++ "msgsnd", /* 67 */ ++ "msgrcv", /* 68 */ ++ "msgctl", /* 69 */ ++ "fcntl", /* 70 */ ++ "flock", /* 71 */ ++ "fsync", /* 72 */ ++ "fdatasync", /* 73 */ ++ "truncate", /* 74 */ ++ "ftruncate", /* 75 */ ++ "getdents", /* 76 */ ++ "getcwd", /* 77 */ ++ "chdir", /* 78 */ ++ "fchdir", /* 79 */ ++ "rename", /* 80 */ ++ "mkdir", /* 81 */ ++ "rmdir", /* 82 */ ++ "creat", /* 83 */ ++ "link", /* 84 */ ++ "unlink", /* 85 */ ++ "symlink", /* 86 */ ++ "readlink", /* 87 */ ++ "chmod", /* 88 */ ++ "fchmod", /* 89 */ ++ "chown", /* 90 */ ++ "fchown", /* 91 */ ++ "lchown", /* 92 */ ++ "umask", /* 93 */ ++ "gettimeofday", /* 94 */ ++ "getrlimit", /* 95 */ ++ "getrusage", /* 96 */ ++ "sysinfo", /* 97 */ ++ "times", /* 98 */ ++ "ptrace", /* 99 */ ++ "getuid", /* 100 */ ++ "syslog", /* 101 */ ++ "getgid", /* 102 */ ++ "setuid", /* 103 */ ++ "setgid", /* 104 */ ++ "geteuid", /* 105 */ ++ "getegid", /* 106 */ ++ "setpgid", /* 107 */ ++ "getppid", /* 108 */ ++ "getpgrp", /* 109 */ ++ "setsid", /* 110 */ ++ "setreuid", /* 111 */ ++ "setregid", /* 112 */ ++ "getgroups", /* 113 */ ++ "setgroups", /* 114 */ ++ "setresuid", /* 115 */ ++ "getresuid", /* 116 */ ++ "setresgid", /* 117 */ ++ "getresgid", /* 118 */ ++ "getpgid", /* 119 */ ++ "setfsuid", /* 120 */ ++ "setfsgid", /* 121 */ ++ "getsid", /* 122 */ ++ "capget", /* 123 */ ++ "capset", /* 124 */ ++ "rt_sigpending", /* 125 */ ++ "rt_sigtimedwait", /* 126 */ ++ "rt_sigqueueinfo", /* 127 */ ++ "rt_sigsuspend", /* 128 */ ++ "sigaltstack", /* 129 */ ++ "utime", /* 130 */ ++ "mknod", /* 131 */ ++ "personality", /* 132 */ ++ "ustat", /* 133 */ ++ "statfs", /* 134 */ ++ "fstatfs", /* 135 */ ++ "sysfs", /* 136 */ ++ "getpriority", /* 137 */ ++ "setpriority", /* 138 */ ++ "sched_setparam", /* 139 */ ++ "sched_getparam", /* 140 */ ++ "sched_setscheduler", /* 141 */ ++ "sched_getscheduler", /* 142 */ ++ "sched_get_priority_max", /* 143 */ ++ "sched_get_priority_min", /* 144 */ ++ "sched_rr_get_interval", /* 145 */ ++ "mlock", /* 146 */ ++ "munlock", /* 147 */ ++ "mlockall", /* 148 */ ++ "munlockall", /* 149 */ ++ "vhangup", /* 150 */ ++ "pivot_root", /* 151 */ ++ "_sysctl", /* 152 */ ++ "prctl", /* 153 */ ++ "adjtimex", /* 154 */ ++ "setrlimit", /* 155 */ ++ "chroot", /* 156 */ ++ "sync", /* 157 */ ++ "acct", /* 158 */ ++ "settimeofday", /* 159 */ ++ "mount", /* 160 */ ++ "umount2", /* 161 */ ++ "swapon", /* 162 */ ++ "swapoff", /* 163 */ ++ "reboot", /* 164 */ ++ "sethostname", /* 165 */ ++ "setdomainname", /* 166 */ ++ "create_module", /* 167 */ ++ "init_module", /* 168 */ ++ "delete_module", /* 169 */ ++ "get_kernel_syms", /* 170 */ ++ "query_module", /* 171 */ ++ "quotactl", /* 172 */ ++ "nfsservctl", /* 173 */ ++ "getpmsg", /* 174 */ ++ "putpmsg", /* 175 */ ++ "afs_syscall", /* 176 */ ++ "reserved177", /* 177 */ ++ "gettid", /* 178 */ ++ "readahead", /* 179 */ ++ "setxattr", /* 180 */ ++ "lsetxattr", /* 181 */ ++ "fsetxattr", /* 182 */ ++ "getxattr", /* 183 */ ++ "lgetxattr", /* 184 */ ++ "fgetxattr", /* 185 */ ++ "listxattr", /* 186 */ ++ "llistxattr", /* 187 */ ++ "flistxattr", /* 188 */ ++ "removexattr", /* 189 */ ++ "lremovexattr", /* 190 */ ++ "fremovexattr", /* 191 */ ++ "tkill", /* 192 */ ++ "reserved193", /* 193 */ ++ "futex", /* 194 */ ++ "sched_setaffinity", /* 195 */ ++ "sched_getaffinity", /* 196 */ ++ "cacheflush", /* 197 */ ++ "cachectl", /* 198 */ ++ "sysmips", /* 199 */ ++ "io_setup", /* 200 */ ++ "io_destroy", /* 201 */ ++ "io_getevents", /* 202 */ ++ "io_submit", /* 203 */ ++ "io_cancel", /* 204 */ ++ "exit_group", /* 205 */ ++ "lookup_dcookie", /* 206 */ ++ "epoll_create", /* 207 */ ++ "epoll_ctl", /* 208 */ ++ "epoll_wait", /* 209 */ ++ "remap_file_pages", /* 210 */ ++ "rt_sigreturn", /* 211 */ ++ "set_tid_address", /* 212 */ ++ "restart_syscall", /* 213 */ ++ "semtimedop", /* 214 */ ++ "fadvise64", /* 215 */ ++ "timer_create", /* 216 */ ++ "timer_settime", /* 217 */ ++ "timer_gettime", /* 218 */ ++ "timer_getoverrun", /* 219 */ ++ "timer_delete", /* 220 */ ++ "clock_settime", /* 221 */ ++ "clock_gettime", /* 222 */ ++ "clock_getres", /* 223 */ ++ "clock_nanosleep", /* 224 */ ++ "tgkill", /* 225 */ ++ "utimes", /* 226 */ ++ "mbind", /* 227 */ ++ "get_mempolicy", /* 228 */ ++ "set_mempolicy", /* 229 */ ++ "mq_open", /* 230 */ ++ "mq_unlink", /* 231 */ ++ "mq_timedsend", /* 232 */ ++ "mq_timedreceive", /* 233 */ ++ "mq_notify", /* 234 */ ++ "mq_getsetattr", /* 235 */ ++ "vserver", /* 236 */ ++ "waitid", /* 237 */ ++ "238", /* 238 */ ++ "add_key", /* 239 */ ++ "request_key", /* 240 */ ++ "keyctl", /* 241 */ ++ "set_thread_area", /* 242 */ ++ "inotify_init", /* 243 */ ++ "inotify_add_watch", /* 244 */ ++ "inotify_rm_watch", /* 245 */ ++ "migrate_pages", /* 246 */ ++ "openat", /* 247 */ ++ "mkdirat", /* 248 */ ++ "mknodat", /* 249 */ ++ "fchownat", /* 250 */ ++ "futimesat", /* 251 */ ++ "newfstatat", /* 252 */ ++ "unlinkat", /* 253 */ ++ "renameat", /* 254 */ ++ "linkat", /* 255 */ ++ "symlinkat", /* 256 */ ++ "readlinkat", /* 257 */ ++ "fchmodat", /* 258 */ ++ "faccessat", /* 259 */ ++ "pselect6", /* 260 */ ++ "ppoll", /* 261 */ ++ "unshare", /* 262 */ ++ "splice", /* 263 */ ++ "sync_file_range", /* 264 */ ++ "tee", /* 265 */ ++ "vmsplice", /* 266 */ ++ "move_pages", /* 267 */ ++ "set_robust_list", /* 268 */ ++ "get_robust_list", /* 269 */ ++ "kexec_load", /* 270 */ ++ "getcpu", /* 271 */ ++ "epoll_pwait", /* 272 */ ++ "ioprio_set", /* 273 */ ++ "ioprio_get", /* 274 */ ++ "utimensat", /* 275 */ ++ "signalfd", /* 276 */ ++ "timerfd", /* 277 */ ++ "eventfd", /* 278 */ ++ "fallocate", /* 279 */ ++ "timerfd_create", /* 280 */ ++ "timerfd_gettime", /* 281 */ ++ "timerfd_settime", /* 282 */ ++ "signalfd4", /* 283 */ ++ "eventfd2", /* 284 */ ++ "epoll_create1", /* 285 */ ++ "dup3", /* 286 */ ++ "pipe2", /* 287 */ ++ "inotify_init1", /* 288 */ ++ "preadv", /* 289 */ ++ "pwritev", /* 290 */ ++ "rt_tgsigqueueinfo", /* 291 */ ++ "perf_event_open", /* 292 */ ++ "accept4", /* 293 */ ++ "recvmmsg", /* 294 */ ++ "fanotify_init", /* 295 */ ++ "fanotify_mark", /* 296 */ ++ "prlimit64", /* 297 */ ++ "name_to_handle_at", /* 298 */ ++ "open_by_handle_at", /* 299 */ ++ "clock_adjtime", /* 300 */ ++ "syncfs", /* 301 */ ++ "sendmmsg", /* 302 */ ++ "setns", /* 303 */ ++ "process_vm_readv", /* 304 */ ++ "process_vm_writev", /* 305 */ +diff --git a/sysdeps/linux-gnu/mips/trace.c b/sysdeps/linux-gnu/mips/trace.c +index e81b374..d54818e 100644 +--- a/sysdeps/linux-gnu/mips/trace.c ++++ b/sysdeps/linux-gnu/mips/trace.c +@@ -1,5 +1,6 @@ + /* + * This file is part of ltrace. ++ * Copyright (C) 2015 Imagination Technologies Limited + * Copyright (C) 2013 Petr Machata, Red Hat Inc. + * Copyright (C) 2012 Edgar E. Iglesias, Axis Communications + * Copyright (C) 2010 Arnaud Patard, Mandriva SA +@@ -29,6 +30,7 @@ + #include <signal.h> + #include <sys/ptrace.h> + #include <asm/ptrace.h> ++#include <asm/unistd.h> + #include <assert.h> + #include <asm/unistd.h> + +@@ -68,6 +70,44 @@ + void + get_arch_dep(struct process *proc) + { ++#ifdef __LP64__ ++ proc->mask_32bit = (proc->e_class == ELFCLASS32); ++#endif /* __LP64__ */ ++ /* n32 personality is best approximated by n64, ++ at least for syscall numbers */ ++ proc->personality = (proc->e_class == ELFCLASS64 ++ || proc->e_abi == ABI_N32); ++} ++ ++/** ++ \param abi ABI of current process, from mips_abi_type enum ++ \param list An array of 4 elements, each corresponding to an ABI, in ++ the order: o32, n32, n64, o64 ++ ++ return value from array corresponding to requested ABI ++ */ ++static int ++abi_select(const int abi, const int list[]) ++{ ++ int retval; ++ switch (abi) ++ { ++ case ABI_N32: ++ retval = list[1]; ++ break; ++ case ABI_N64: ++ retval = list[2]; ++ break; ++ case ABI_O64: ++ retval = list[3]; ++ break; ++ case ABI_O32: ++ default: ++ retval = list[0]; ++ break; ++ } ++ ++ return retval; + } + + /** +@@ -90,53 +130,94 @@ get_arch_dep(struct process *proc) + int + syscall_p(struct process *proc, int status, int *sysnum) + { +- if (WIFSTOPPED(status) +- && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) { +- /* get the user's pc (plus 8) */ +- long pc = (long)get_instruction_pointer(proc); +- /* fetch the SWI instruction */ +- int insn = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 4, 0); +- int num = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 8, 0); +- +- /* +- On a mips, syscall looks like: +- 24040fa1 li v0, 0x0fa1 # 4001 --> _exit syscall +- 0000000c syscall +- */ +- if(insn!=0x0000000c){ +- /* sigreturn returns control to the point +- where the signal was received; skip check +- for preceeding syscall instruction */ +- int depth = proc->callstack_depth; +- struct callstack_element *top = NULL; +- if (depth > 0) +- top = &proc->callstack[depth - 1]; +- +- if (top != NULL && top->is_syscall && +- (top->c_un.syscall == (__NR_rt_sigreturn - +- __NR_Linux) || +- top->c_un.syscall == (__NR_sigreturn - +- __NR_Linux))) { +- *sysnum = top->c_un.syscall; +- return 2; +- } +- else +- return 0; +- } +- +- *sysnum = (num & 0xFFFF) - 4000; +- /* if it is a syscall, return 1 or 2 */ +- if (proc->callstack_depth > 0 && +- proc->callstack[proc->callstack_depth - 1].is_syscall && +- proc->callstack[proc->callstack_depth - 1].c_un.syscall == *sysnum) { ++ unsigned long pc; ++ int insn, prev; ++ int min_syscall, max_syscall, sigreturn, rt_sigreturn; ++ struct callstack_element *top = NULL; ++ int depth = proc->callstack_depth; ++ const int syscallbase[] = {__NR_O32_Linux, __NR_N32_Linux, ++ __NR_64_Linux, __NR_O32_Linux}; ++ const int syscallnum[] = {__NR_O32_Linux_syscalls, ++ __NR_N32_Linux_syscalls, ++ __NR_64_Linux_syscalls, ++ __NR_O32_Linux_syscalls}; ++ const int rt_sigreturn_list[] = {193, 211, 211, 193}; ++ const int sigreturn_list[] = {119, -1, -1, 119}; ++ ++ if (!WIFSTOPPED(status) ++ || WSTOPSIG(status) != (SIGTRAP | proc->tracesysgood)) ++ return 0; ++ ++ /* get the user's pc (plus 8) */ ++ pc = (unsigned long)get_instruction_pointer(proc); ++ /* fetch the SWI instruction */ ++ insn = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 4, 0); ++ prev = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 8, 0); ++ ++ if (depth > 0) ++ top = &proc->callstack[depth - 1]; ++ ++ /* Range of syscall numbers varies with ABI; ref:asm/unistd.h */ ++ min_syscall = abi_select(proc->e_abi, syscallbase); ++ max_syscall = min_syscall + abi_select(proc->e_abi, syscallnum); ++ sigreturn = min_syscall + abi_select(proc->e_abi, sigreturn_list); ++ rt_sigreturn = min_syscall + abi_select(proc->e_abi, rt_sigreturn_list); ++ ++ /* not a syscall instruction */ ++ if(insn!=0x0000000c){ ++ /* sigreturn returns control to the point where the signal was ++ received; skip check for preceeding syscall instruction */ ++ if (top != NULL && top->is_syscall ++ && (top->c_un.syscall == (rt_sigreturn - min_syscall) ++ || top->c_un.syscall == (sigreturn - min_syscall))) { ++ *sysnum = top->c_un.syscall; + return 2; + } ++ else ++ return 0; ++ } + +- if (*sysnum >= 0) { +- return 1; +- } ++ /* ++ On a mips, syscall looks like: ++ 24020fa1 li v0, 0x0fa1 # 4001 --> _exit syscall ++ 0000000c syscall ++ */ ++ if ((prev & 0xFFFF0000) == 0x24020000) { ++ *sysnum = (prev & 0xFFFF) - min_syscall; + } +- return 0; ++ /* ++ The above is not necessary in Linux kernel > v2.6.35. Recent ++ kernels have a fancy-pants method of restarting syscalls. ++ We must read v0 instead, to get the syscall number. ++ ++ Unfortunately, v0 is not preserved till the point of return. ++ If already in syscall and v0 is invalid, assume this event ++ to be a return without attempting to match previous syscall. ++ ++ Caveat: logic fails if v0 incidentally contains a valid ++ syscall number, distinct from the current syscall number, ++ at the point of return from a nested syscall. ++ */ ++ else { ++ int v0 = ptrace(PTRACE_PEEKUSER, proc->pid, off_v0, 0); ++ ++ if ((v0 >= min_syscall) && (v0 <= max_syscall)) ++ *sysnum = v0 - min_syscall; ++ else if (depth > 0 && top->is_syscall) ++ *sysnum = top->c_un.syscall; ++ else /* syscall instruction without valid number - ignored */ ++ return 0; ++ } ++ ++ /* if it is a syscall, return 1 or 2 */ ++ if (depth > 0 && top->is_syscall && top->c_un.syscall == *sysnum) { ++ return 2; ++ } ++ ++ if (*sysnum >= 0) ++ return 1; ++ else ++ return 0; + } + + /* Based on GDB code. */ +@@ -162,9 +243,11 @@ mips32_relative_offset (uint32_t inst) + return ((itype_immediate(inst) ^ 0x8000) - 0x8000) << 2; + } + +-int mips_next_pcs(struct process *proc, uint32_t pc, uint32_t *newpc) ++int mips_next_pcs(struct process *proc, unsigned long pc, ++ unsigned long *newpc) + { +- uint32_t inst, rx; ++ uint32_t inst; ++ unsigned long rx; + int op; + int rn; + int nr = 0; +@@ -277,8 +360,8 @@ int mips_next_pcs(struct process *proc, uint32_t pc, uint32_t *newpc) + return nr; + + fail: +- printf("nr=%d pc=%x\n", nr, pc); +- printf("pc=%x %x\n", newpc[0], newpc[1]); ++ printf("nr=%d pc=%lx\n", nr, pc); ++ printf("pc=%lx %lx\n", newpc[0], newpc[1]); + return 0; + } + +@@ -304,17 +387,27 @@ fail: + * branches within the LL-SC sequence. + */ + #define inrange(x,lo,hi) ((x)<=(hi) && (x)>=(lo)) ++/* Instruction encodings for atomic operations */ ++#ifdef __mips64 ++#define op_SC_p(op) (op == 0x38 || op == 0x3c) ++#define op_LL_p(op) (op == 0x30 || op == 0x34) ++#else /* !__mips64 */ ++#define op_SC_p(op) (op == 0x38) ++#define op_LL_p(op) (op == 0x30) ++#endif /* !__mips64 */ ++ + static int +-mips_atomic_next_pcs(struct process *proc, uint32_t lladdr, uint32_t *newpcs) ++mips_atomic_next_pcs(struct process *proc, unsigned long lladdr, ++ unsigned long *newpcs) + { + int nr = 0; + +- uint32_t scaddr; ++ unsigned long scaddr; + for (scaddr = lladdr + 4; scaddr - lladdr <= 2048; scaddr += 4) { + /* Found SC, now stepover trailing branch */ + uint32_t inst; + if (proc_read_32(proc, (arch_addr_t)scaddr, &inst) >= 0 && +- itype_op(inst) == 0x38) { ++ op_SC_p (itype_op(inst))) { + newpcs[nr++] = scaddr + 4; + break; + } +@@ -327,16 +420,16 @@ mips_atomic_next_pcs(struct process *proc, uint32_t lladdr, uint32_t *newpcs) + } + + /* Scan LL<->SC range for branches going outside that range */ +- uint32_t spc; ++ unsigned long spc; + for (spc = lladdr + 4; spc < scaddr; spc += 4) { +- uint32_t scanpcs[2]; ++ unsigned long scanpcs[2]; + int snr = mips_next_pcs(proc, spc, scanpcs); + + int i; + for (i = 0; i < snr; ++i) { + if (!inrange(scanpcs[i], lladdr, scaddr)) { +- uint32_t *tmp = realloc(newpcs, (nr + 1) * +- sizeof *newpcs); ++ unsigned long *tmp = realloc(newpcs, (nr + 1) ++ * sizeof *newpcs); + if (tmp == NULL) { + perror("malloc atomic next pcs"); + return -1; +@@ -357,8 +450,8 @@ arch_sw_singlestep(struct process *proc, struct breakpoint *bp, + int (*add_cb)(arch_addr_t, struct sw_singlestep_data *), + struct sw_singlestep_data *add_cb_data) + { +- uint32_t pc = (uint32_t) get_instruction_pointer(proc); +- uint32_t *newpcs; ++ unsigned long pc = (unsigned long) get_instruction_pointer(proc); ++ unsigned long *newpcs; + int nr; + uint32_t inst; + +@@ -369,7 +462,7 @@ arch_sw_singlestep(struct process *proc, struct breakpoint *bp, + return SWS_FAIL; + + /* Starting an atomic read-modify-write sequence */ +- if (itype_op(inst) == 0x30) ++ if (op_LL_p(itype_op(inst))) + nr = mips_atomic_next_pcs(proc, pc, newpcs); + else + nr = mips_next_pcs(proc, pc, newpcs); +@@ -462,7 +555,7 @@ gimme_arg(enum tof type, struct process *proc, int arg_num, + debug(2,"ret = %#lx",addr); + return addr; + } +- ret = addr + 4*arg_num; ++ ret = addr + sizeof(long) * arg_num; + ret=ptrace(PTRACE_PEEKTEXT,proc->pid,addr,0); + debug(2,"ret = %#lx",ret); + return ret; +@@ -474,7 +567,7 @@ gimme_arg(enum tof type, struct process *proc, int arg_num, + debug(2,"ret = %#lx",addr); + return addr; + } +- ret = addr + 4*arg_num; ++ ret = addr + sizeof(long) * arg_num; + ret=ptrace(PTRACE_PEEKTEXT,proc->pid,addr,0); + debug(2,"ret = %#lx",ret); + return ret; +@@ -483,4 +576,34 @@ gimme_arg(enum tof type, struct process *proc, int arg_num, + return 0; + } + ++#ifdef __LP64__ ++size_t ++arch_type_sizeof(struct process *proc, struct arg_type_info *info) ++{ ++ if (proc == NULL) ++ return (size_t)-2; ++ ++ switch (info->type) { ++ case ARGTYPE_LONG: ++ case ARGTYPE_ULONG: ++ return proc->mask_32bit ? 4 : sizeof (long); ++ ++ case ARGTYPE_POINTER: ++ return proc->mask_32bit ? 4 : sizeof (void *); ++ ++ default: ++ /* Use default value. */ ++ return (size_t)-2; ++ } ++} ++ ++size_t ++arch_type_alignof(struct process *proc, struct arg_type_info *info) ++{ ++ if (proc == NULL) ++ return (size_t)-2; ++ ++ return arch_type_sizeof(proc, info); ++} ++#endif /* __LP64__ */ + /**@}*/ +diff --git a/sysdeps/linux-gnu/mksyscallent_mips b/sysdeps/linux-gnu/mksyscallent_mips +index f3961b4..f8dcfe1 100755 +--- a/sysdeps/linux-gnu/mksyscallent_mips ++++ b/sysdeps/linux-gnu/mksyscallent_mips +@@ -19,9 +19,7 @@ + + # hack expression to generate arch/syscallent.h from <asm/unistd.h> + # It reads from stdin and writes to stdout +-# It should work OK on i386,m68k,arm,ia64 +-# It does NOT work in mips, s390 +-# It is untested in other architectures ++# Default is o32; arch=mips64 generates n64 syscalls + + BEGIN { + max=0; +@@ -31,7 +29,10 @@ BEGIN { + { + #debug + #printf("/%s/%s/%s/%s/\n", $1, $2, $3, $4); +- if ($2 ~ /__NR_Linux/ && $3 ~ /4000/) { ++ min=4000 ++ if (arch ~ "mips64") min=5000 ++ ++ if ($2 ~ /__NR_Linux/ && $3 ~ min) { + syscall=1; + } + if ($2 ~ /__NR_Linux_syscalls/) { +-- +2.13.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Fix-tautological-compare-warning.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Fix-tautological-compare-warning.patch new file mode 100644 index 00000000..a599d0e1 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Fix-tautological-compare-warning.patch @@ -0,0 +1,261 @@ +From 0af8ced6376f2256b9daac301c851e1c99c3b035 Mon Sep 17 00:00:00 2001 +From: Adam Trhon <adam.trhon@tbs-biometrics.com> +Date: Fri, 12 May 2017 13:39:11 +0200 +Subject: [PATCH] Fix tautological compare warning + +By default, gcc ignores warning from code generated by macros +(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80369). When +ltrace is compiled under icecream the warning *is generated* +(https://github.com/icecc/icecream/issues/202) +and the compilation fails (because of -Werror). + +Upstream-Status: Submitted [ltrace-devel@lists.alioth.debian.org] + +Signed-off-by: Adam Trhon <adam.trhon@tbs-biometrics.com> +--- + filter.c | 4 ++-- + sysdeps/linux-gnu/arm/fetch.c | 2 +- + sysdeps/linux-gnu/arm/trace.c | 2 +- + sysdeps/linux-gnu/ia64/fetch.c | 2 +- + sysdeps/linux-gnu/metag/trace.c | 2 +- + sysdeps/linux-gnu/mips/plt.c | 2 +- + sysdeps/linux-gnu/ppc/fetch.c | 2 +- + sysdeps/linux-gnu/ppc/plt.c | 2 +- + sysdeps/linux-gnu/ppc/trace.c | 4 ++-- + sysdeps/linux-gnu/s390/fetch.c | 2 +- + sysdeps/linux-gnu/s390/trace.c | 4 ++-- + sysdeps/linux-gnu/x86/fetch.c | 2 +- + sysdeps/linux-gnu/x86/trace.c | 4 ++-- + value.c | 4 ++-- + 14 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/filter.c b/filter.c +index ba50c40..a65856d 100644 +--- a/filter.c ++++ b/filter.c +@@ -79,7 +79,7 @@ filter_lib_matcher_name_init(struct filter_lib_matcher *matcher, + { + switch (type) { + case FLM_MAIN: +- assert(type != type); ++ assert(!"Unexpected value of type"); + abort(); + + case FLM_SONAME: +@@ -137,7 +137,7 @@ matcher_matches_library(struct filter_lib_matcher *matcher, struct library *lib) + case FLM_MAIN: + return lib->type == LT_LIBTYPE_MAIN; + } +- assert(matcher->type != matcher->type); ++ assert(!"Unexpected value of matcher->type"); + abort(); + } + +diff --git a/sysdeps/linux-gnu/arm/fetch.c b/sysdeps/linux-gnu/arm/fetch.c +index b500448..8f75fcf 100644 +--- a/sysdeps/linux-gnu/arm/fetch.c ++++ b/sysdeps/linux-gnu/arm/fetch.c +@@ -317,7 +317,7 @@ arch_fetch_retval(struct fetch_context *ctx, enum tof type, + memmove(data, ctx->regs.uregs, sz); + return 0; + } +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + } + +diff --git a/sysdeps/linux-gnu/arm/trace.c b/sysdeps/linux-gnu/arm/trace.c +index 5e51e91..e76bf63 100644 +--- a/sysdeps/linux-gnu/arm/trace.c ++++ b/sysdeps/linux-gnu/arm/trace.c +@@ -701,7 +701,7 @@ arch_type_sizeof(struct process *proc, struct arg_type_info *info) + return (size_t)-2; + + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + } + } +diff --git a/sysdeps/linux-gnu/ia64/fetch.c b/sysdeps/linux-gnu/ia64/fetch.c +index 171c7a2..ee2fbc7 100644 +--- a/sysdeps/linux-gnu/ia64/fetch.c ++++ b/sysdeps/linux-gnu/ia64/fetch.c +@@ -409,7 +409,7 @@ arch_fetch_arg_next(struct fetch_context *ctx, enum tof type, + case ARGTYPE_ARRAY: + /* Arrays decay into pointers. XXX Fortran? */ + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + } + } +diff --git a/sysdeps/linux-gnu/metag/trace.c b/sysdeps/linux-gnu/metag/trace.c +index ad5fffe..7a843d6 100644 +--- a/sysdeps/linux-gnu/metag/trace.c ++++ b/sysdeps/linux-gnu/metag/trace.c +@@ -142,7 +142,7 @@ get_regval_from_unit(enum metag_unitnum unit, unsigned int reg, + return regs->ax[reg][0]; + /* We really shouldn't be here. */ + default: +- assert(unit != unit); ++ assert(!"Unexpected value of unit"); + abort(); + } + return 0; +diff --git a/sysdeps/linux-gnu/mips/plt.c b/sysdeps/linux-gnu/mips/plt.c +index c7c10ac..ca2307d 100644 +--- a/sysdeps/linux-gnu/mips/plt.c ++++ b/sysdeps/linux-gnu/mips/plt.c +@@ -651,7 +651,7 @@ mips_stub_bp_continue(struct breakpoint *bp, struct process *proc) + break; + } + +- assert(bp->libsym->arch.type != bp->libsym->arch.type); ++ assert(!"Unexpected value of bp->libsym->arch.type"); + abort(); + } + +diff --git a/sysdeps/linux-gnu/ppc/fetch.c b/sysdeps/linux-gnu/ppc/fetch.c +index c6cbd71..5db5675 100644 +--- a/sysdeps/linux-gnu/ppc/fetch.c ++++ b/sysdeps/linux-gnu/ppc/fetch.c +@@ -502,7 +502,7 @@ allocate_argument(struct fetch_context *ctx, struct process *proc, + case ARGTYPE_ARRAY: + /* Arrays decay into pointers. XXX Fortran? */ + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + } + +diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c +index 5f81889..781da03 100644 +--- a/sysdeps/linux-gnu/ppc/plt.c ++++ b/sysdeps/linux-gnu/ppc/plt.c +@@ -1085,7 +1085,7 @@ ppc_plt_bp_continue(struct breakpoint *bp, struct process *proc) + break; + } + +- assert(bp->libsym->arch.type != bp->libsym->arch.type); ++ assert(!"Unexpected value of bp->libsym->arch.type"); + abort(); + } + +diff --git a/sysdeps/linux-gnu/ppc/trace.c b/sysdeps/linux-gnu/ppc/trace.c +index 5aab538..caa6035 100644 +--- a/sysdeps/linux-gnu/ppc/trace.c ++++ b/sysdeps/linux-gnu/ppc/trace.c +@@ -217,7 +217,7 @@ arch_type_sizeof(struct process *proc, struct arg_type_info *info) + return (size_t)-2; + + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + break; + } +@@ -231,7 +231,7 @@ arch_type_alignof(struct process *proc, struct arg_type_info *info) + + switch (info->type) { + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + break; + +diff --git a/sysdeps/linux-gnu/s390/fetch.c b/sysdeps/linux-gnu/s390/fetch.c +index 4ad5951..4721c30 100644 +--- a/sysdeps/linux-gnu/s390/fetch.c ++++ b/sysdeps/linux-gnu/s390/fetch.c +@@ -266,7 +266,7 @@ arch_fetch_arg_next(struct fetch_context *ctx, enum tof type, + return allocate_gpr(ctx, proc, info, valuep, sz); + + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + } + return -1; +diff --git a/sysdeps/linux-gnu/s390/trace.c b/sysdeps/linux-gnu/s390/trace.c +index 78b04c3..24f7801 100644 +--- a/sysdeps/linux-gnu/s390/trace.c ++++ b/sysdeps/linux-gnu/s390/trace.c +@@ -213,7 +213,7 @@ arch_type_sizeof(struct process *proc, struct arg_type_info *info) + return (size_t)-2; + + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + } + } +@@ -226,7 +226,7 @@ arch_type_alignof(struct process *proc, struct arg_type_info *info) + + switch (info->type) { + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + break; + + case ARGTYPE_CHAR: +diff --git a/sysdeps/linux-gnu/x86/fetch.c b/sysdeps/linux-gnu/x86/fetch.c +index 6868101..ae2ed79 100644 +--- a/sysdeps/linux-gnu/x86/fetch.c ++++ b/sysdeps/linux-gnu/x86/fetch.c +@@ -523,7 +523,7 @@ classify(struct process *proc, struct fetch_context *context, + + default: + /* Unsupported type. */ +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + } + abort(); +diff --git a/sysdeps/linux-gnu/x86/trace.c b/sysdeps/linux-gnu/x86/trace.c +index 6a1a6a5..d8d2115 100644 +--- a/sysdeps/linux-gnu/x86/trace.c ++++ b/sysdeps/linux-gnu/x86/trace.c +@@ -145,7 +145,7 @@ arch_type_sizeof(struct process *proc, struct arg_type_info *info) + return (size_t)-2; + + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + } + } +@@ -158,7 +158,7 @@ arch_type_alignof(struct process *proc, struct arg_type_info *info) + + switch (info->type) { + default: +- assert(info->type != info->type); ++ assert(!"Unexpected value of info->type"); + abort(); + break; + +diff --git a/value.c b/value.c +index 2125ba9..30edb4e 100644 +--- a/value.c ++++ b/value.c +@@ -363,7 +363,7 @@ value_set_word(struct value *value, long word) + u.u64 = word; + break; + default: +- assert(sz != sz); ++ assert(!"Unexpected value of sz"); + abort(); + } + +@@ -414,7 +414,7 @@ value_extract_word(struct value *value, long *retp, + *retp = (long)u.u64; + return 0; + default: +- assert(sz != sz); ++ assert(!"Unexpected value of sz"); + abort(); + } + } +-- +2.12.0 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch new file mode 100644 index 00000000..01a35842 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch @@ -0,0 +1,28 @@ +From df490528d1e81a98ba2991c700c92a8e6c969083 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 6 Mar 2017 21:32:22 -0800 +Subject: [PATCH 1/2] Use correct enum type + +Clang warns about wrong enum initializtion + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/linux-gnu/aarch64/fetch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysdeps/linux-gnu/aarch64/fetch.c b/sysdeps/linux-gnu/aarch64/fetch.c +index 2744df0..1dcf7cc 100644 +--- a/sysdeps/linux-gnu/aarch64/fetch.c ++++ b/sysdeps/linux-gnu/aarch64/fetch.c +@@ -173,7 +173,7 @@ static struct fetch_script + pass_arg(struct fetch_context const *context, + struct process *proc, struct arg_type_info *info) + { +- enum fetch_method cvt = CVT_NOP; ++ enum convert_method cvt = CVT_NOP; + + size_t sz = type_sizeof(proc, info); + if (sz == (size_t) -1) +-- +2.12.0 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch new file mode 100644 index 00000000..52264a17 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch @@ -0,0 +1,25 @@ +From c1d3aaf5ec810c2594938438c7b4ccd20943f255 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 10:20:52 -0700 +Subject: [PATCH] configure: Recognise linux-musl as a host OS + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configure.ac b/configure.ac +index 3e8667f..95d6642 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -35,6 +35,7 @@ AC_CANONICAL_HOST + case "${host_os}" in + linux-gnu*) HOST_OS="linux-gnu" ;; + linux-uclibc*) HOST_OS="linux-gnu" ;; ++ linux-musl*) HOST_OS="linux-gnu" ;; + *) AC_MSG_ERROR([unkown host-os ${host_os}]) ;; + esac + AC_SUBST(HOST_OS) +-- +2.13.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-plt.c-Delete-include-error.h.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-plt.c-Delete-include-error.h.patch new file mode 100644 index 00000000..76ba7de7 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-plt.c-Delete-include-error.h.patch @@ -0,0 +1,27 @@ +From 19a3e590c97420bd3952301bf376067c75d0ee32 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 18 Sep 2017 23:45:54 -0700 +Subject: [PATCH] mips/plt.c: Delete include error.h + +Its not needed + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/linux-gnu/mips/plt.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/sysdeps/linux-gnu/mips/plt.c b/sysdeps/linux-gnu/mips/plt.c +index 2d85ad9..9c3ae2f 100644 +--- a/sysdeps/linux-gnu/mips/plt.c ++++ b/sysdeps/linux-gnu/mips/plt.c +@@ -24,7 +24,6 @@ + + #include <sys/ptrace.h> + #include <errno.h> +-#include <error.h> + #include <gelf.h> + #include <inttypes.h> + #include <string.h> +-- +2.14.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-replace-readdir_r-with-readdir.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-replace-readdir_r-with-readdir.patch new file mode 100644 index 00000000..65c7d535 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-replace-readdir_r-with-readdir.patch @@ -0,0 +1,36 @@ +From 64f98f84fd88797e219f9dde1ca387fee4b509f0 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 24 Apr 2016 16:58:17 -0700 +Subject: [PATCH] replace readdir_r with readdir + +glibc 2.24 has deprecated readdir_r + +https://sourceware.org/ml/libc-alpha/2016-02/msg00093.html + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + sysdeps/linux-gnu/proc.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/sysdeps/linux-gnu/proc.c b/sysdeps/linux-gnu/proc.c +index 953fd86..edb716d 100644 +--- a/sysdeps/linux-gnu/proc.c ++++ b/sysdeps/linux-gnu/proc.c +@@ -242,9 +242,10 @@ process_tasks(pid_t pid, pid_t **ret_tasks, size_t *ret_n) + size_t alloc = 0; + + while (1) { +- struct dirent entry; + struct dirent *result; +- if (readdir_r(d, &entry, &result) != 0) { ++ errno = 0; ++ result = readdir(d); ++ if (errno != 0) { + fail: + free(tasks); + closedir(d); +-- +2.8.0 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch new file mode 100644 index 00000000..c1527719 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch @@ -0,0 +1,76 @@ +From 4d3ec1a514f9b1df8ce3a1b04c8a2823d977377f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 6 Mar 2017 21:34:01 -0800 +Subject: [PATCH 2/2] Fix const qualifier error + +Fixes clang warning +error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + dict.h | 2 +- + library.c | 2 +- + vect.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +Index: git/dict.h +=================================================================== +--- git.orig/dict.h ++++ git/dict.h +@@ -90,7 +90,7 @@ int dict_clone(struct dict *target, cons + assert(_source_d->values.elt_size == sizeof(VALUE_TYPE)); \ + /* Check that callbacks are typed properly. */ \ + void (*_key_dtor_cb)(KEY_TYPE *, void *) = DTOR_KEY; \ +- int (*_key_clone_cb)(KEY_TYPE *, const KEY_TYPE *, \ ++ int (*_key_clone_cb)(KEY_TYPE *, KEY_TYPE *, \ + void *) = CLONE_KEY; \ + void (*_value_dtor_cb)(VALUE_TYPE *, void *) = DTOR_VALUE; \ + int (*_value_clone_cb)(VALUE_TYPE *, const VALUE_TYPE *, \ +Index: git/library.c +=================================================================== +--- git.orig/library.c ++++ git/library.c +@@ -353,7 +353,7 @@ static void + library_exported_names_init(struct library_exported_names *names) + { + DICT_INIT(&names->names, +- const char*, uint64_t, ++ char*, uint64_t, + dict_hash_string, dict_eq_string, NULL); + DICT_INIT(&names->addrs, + uint64_t, struct vect*, +Index: git/vect.h +=================================================================== +--- git.orig/vect.h ++++ git/vect.h +@@ -66,7 +66,7 @@ int vect_clone(struct vect *target, cons + assert(_source_vec->elt_size == sizeof(ELT_TYPE)); \ + /* Check that callbacks are typed properly. */ \ + void (*_dtor_callback)(ELT_TYPE *, void *) = DTOR; \ +- int (*_clone_callback)(ELT_TYPE *, const ELT_TYPE *, \ ++ int (*_clone_callback)(ELT_TYPE *, ELT_TYPE *, \ + void *) = CLONE; \ + vect_clone((TGT_VEC), _source_vec, \ + (int (*)(void *, const void *, \ +Index: git/value_dict.c +=================================================================== +--- git.orig/value_dict.c ++++ git/value_dict.c +@@ -40,7 +40,7 @@ val_dict_init(struct value_dict *dict) + } + + static int +-value_clone_cb(struct value *tgt, const struct value *src, void *data) ++value_clone_cb(struct value *tgt, struct value *src, void *data) + { + return value_clone(tgt, src); + } +@@ -53,7 +53,7 @@ value_dtor(struct value *val, void *data + + static int + named_value_clone(struct named_value *tgt, +- const struct named_value *src, void *data) ++ struct named_value *src, void *data) + { + tgt->name = strdup(src->name); + if (tgt->name == NULL) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/configure-allow-to-disable-selinux-support.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/configure-allow-to-disable-selinux-support.patch new file mode 100644 index 00000000..4f89d8f2 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/configure-allow-to-disable-selinux-support.patch @@ -0,0 +1,36 @@ +From 887a403e38f590ebf1d04ce600d94cb7a351744c Mon Sep 17 00:00:00 2001 +From: Wenzong Fan <wenzong.fan@windriver.com> +Date: Mon, 1 Dec 2014 00:57:42 -0500 +Subject: [PATCH] ltrace: allow to enable/disable selinux support + +Upstream-Status: Pending + +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> +--- + configure.ac | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 6fe5e3b..189885a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -125,8 +125,14 @@ AC_SUBST(libstdcxx_LIBS) + + + dnl Check security_get_boolean_active availability. +-AC_CHECK_HEADERS(selinux/selinux.h) +-AC_CHECK_LIB(selinux, security_get_boolean_active) ++AC_ARG_ENABLE([selinux], ++ AS_HELP_STRING([--enable-selinux],[enable SELinux support [default=auto]]), ++ [], [enable_selinux=auto]) ++ ++if test x$enable_selinux != xno; then ++ AC_CHECK_HEADERS(selinux/selinux.h) ++ AC_CHECK_LIB(selinux, security_get_boolean_active) ++fi + + dnl Whether (and which) elfutils libdw.so to use for unwinding. + AC_ARG_WITH(elfutils, +-- +1.7.9.5 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace_git.bb new file mode 100644 index 00000000..f4033f7c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace_git.bb @@ -0,0 +1,39 @@ +SUMMARY = "ltrace intercepts and records dynamic library calls" + +DESCRIPTION = "ltrace intercepts and records dynamic library calls \ +which are called by an executed process and the signals received by that process. \ +It can also intercept and print the system calls executed by the program.\ +" +HOMEPAGE = "http://ltrace.org/" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a" + +PE = "1" +PV = "7.91+git${SRCPV}" +SRCREV = "c22d359433b333937ee3d803450dc41998115685" + +DEPENDS = "elfutils" +RDEPENDS_${PN} = "elfutils" +SRC_URI = "git://github.com/sparkleholic/ltrace.git;branch=master;protocol=http \ + file://configure-allow-to-disable-selinux-support.patch \ + file://0001-replace-readdir_r-with-readdir.patch \ + file://0001-Use-correct-enum-type.patch \ + file://0002-Fix-const-qualifier-error.patch \ + file://0001-ARM-code-has-unreachable-code-after-switch-statement.patch \ + file://0001-Fix-tautological-compare-warning.patch \ + file://0001-Add-support-for-mips64-n32-n64.patch \ + file://0001-configure-Recognise-linux-musl-as-a-host-OS.patch \ + file://0001-mips-plt.c-Delete-include-error.h.patch \ + " +S = "${WORKDIR}/git" + +inherit autotools + +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}" +PACKAGECONFIG[unwind] = "--with-libunwind,--without-libunwind,libunwind" +PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" + +do_configure_prepend () { + ( cd ${S}; ./autogen.sh ) +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/lua.pc.in b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/lua.pc.in new file mode 100644 index 00000000..c27e86e8 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/lua.pc.in @@ -0,0 +1,10 @@ +prefix=/usr +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: Lua +Description: Lua language engine +Version: @VERSION@ +Requires: +Libs: -L${libdir} -llua -lm -ldl +Cflags: -I${includedir} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/run-ptest b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/run-ptest new file mode 100644 index 00000000..8e085e1a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/run-ptest @@ -0,0 +1,19 @@ +#!/bin/sh + +cd test +lua -e"_U=true" all.lua > lua-test.tmp + +echo "--- test output ---" +cat lua-test.tmp +echo "" +echo "" +echo "--- ptest result ---" + +grep "final OK \!\!\!" lua-test.tmp > /dev/null +if [ $? -eq 0 ]; then + echo "PASS: lua" +else + echo "FAIL: lua" +fi + +rm -f lua-test.tmp diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/uclibc-pthread.patch b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/uclibc-pthread.patch new file mode 100644 index 00000000..f4cdc5d8 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/uclibc-pthread.patch @@ -0,0 +1,13 @@ +Index: lua-5.1.4/src/Makefile +=================================================================== +--- a/src/Makefile.orig 2013-10-22 22:17:19.929103523 -0400 ++++ a/src/Makefile 2013-10-22 22:18:27.992104545 -0400 +@@ -9,7 +9,7 @@ + CC= gcc + CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS) + LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) +-LIBS= -lm $(SYSLIBS) $(MYLIBS) ++LIBS= -lm -lpthread $(SYSLIBS) $(MYLIBS) + + AR= ar rcu + RANLIB= ranlib diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.4.bb b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.4.bb new file mode 100644 index 00000000..8f4e8fe6 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.4.bb @@ -0,0 +1,59 @@ +DESCRIPTION = "Lua is a powerful light-weight programming language designed \ +for extending applications." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://doc/readme.html;beginline=318;endline=352;md5=60aa5cfdbd40086501778d9b6ebf29ee" +HOMEPAGE = "http://www.lua.org/" + +DEPENDS = "readline" +SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \ + file://lua.pc.in \ + " +SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \ + 'http://www.lua.org/tests/lua-${PV}-tests.tar.gz;name=tarballtest \ + file://run-ptest \ + ', '', d)}" + +SRC_URI[tarballsrc.md5sum] = "53a9c68bcc0eda58bdc2095ad5cdfc63" +SRC_URI[tarballsrc.sha256sum] = "f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c" +SRC_URI[tarballtest.md5sum] = "b14fe3748c1cb2d74e3acd1943629ba3" +SRC_URI[tarballtest.sha256sum] = "b80771238271c72565e5a1183292ef31bd7166414cd0d43a8eb79845fa7f599f" + +inherit pkgconfig binconfig ptest + +UCLIBC_PATCHES += "file://uclibc-pthread.patch" +SRC_URI_append_libc-uclibc = "${UCLIBC_PATCHES}" + +TARGET_CC_ARCH += " -fPIC ${LDFLAGS}" +EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -DLUA_USE_LINUX -fPIC' MYLDFLAGS='${LDFLAGS}'" + +do_configure_prepend() { + sed -i -e s:/usr/local:${prefix}:g src/luaconf.h +} + +do_compile () { + oe_runmake linux +} + +do_install () { + oe_runmake \ + 'INSTALL_TOP=${D}${prefix}' \ + 'INSTALL_BIN=${D}${bindir}' \ + 'INSTALL_INC=${D}${includedir}/' \ + 'INSTALL_MAN=${D}${mandir}/man1' \ + 'INSTALL_SHARE=${D}${datadir}/lua' \ + 'INSTALL_LIB=${D}${libdir}' \ + 'INSTALL_CMOD=${D}${libdir}/lua/5.3' \ + install + install -d ${D}${libdir}/pkgconfig + + sed -e s/@VERSION@/${PV}/ ${WORKDIR}/lua.pc.in > ${WORKDIR}/lua.pc + install -m 0644 ${WORKDIR}/lua.pc ${D}${libdir}/pkgconfig/ + rmdir ${D}${datadir}/lua/5.3 + rmdir ${D}${datadir}/lua +} + +do_install_ptest () { + cp -R --no-dereference --preserve=mode,links -v ${WORKDIR}/lua-${PV}-tests ${D}${PTEST_PATH}/test +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit/0001-Do-not-strip-automatically-this-leaves-the-stripping.patch b/external/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit/0001-Do-not-strip-automatically-this-leaves-the-stripping.patch new file mode 100644 index 00000000..f123b3f5 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit/0001-Do-not-strip-automatically-this-leaves-the-stripping.patch @@ -0,0 +1,33 @@ +From 528009f5ca0685c95ef27f6c8957160499c0576a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 10 May 2013 10:42:45 -0700 +Subject: [PATCH] Do not strip automatically, this leaves the stripping + busines to OE + +Upstream-Status: Inappropriate [OE-Specific] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/Makefile | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 278324a..5ecd6d5 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -665,12 +665,10 @@ $(LUAJIT_A): $(LJVMCORE_O) + $(LUAJIT_SO): $(LJVMCORE_O) + $(E) "DYNLINK $@" + $(Q)$(TARGET_LD) $(TARGET_ASHLDFLAGS) -o $@ $(LJVMCORE_DYNO) $(TARGET_ALIBS) +- $(Q)$(TARGET_STRIP) $@ + + $(LUAJIT_T): $(TARGET_O) $(LUAJIT_O) $(TARGET_DEP) + $(E) "LINK $@" + $(Q)$(TARGET_LD) $(TARGET_ALDFLAGS) -o $@ $(LUAJIT_O) $(TARGET_O) $(TARGET_ALIBS) +- $(Q)$(TARGET_STRIP) $@ + $(E) "OK Successfully built LuaJIT" + + ############################################################################## +-- +1.7.9.5 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit/clang.patch b/external/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit/clang.patch new file mode 100644 index 00000000..c39ef6fd --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit/clang.patch @@ -0,0 +1,19 @@ +clang pretends to be gcc 4.2.0 which is a big lie when it comes +to features, its same as latest gcc + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending + +Index: LuaJIT-2.0.5/src/lj_arch.h +=================================================================== +--- LuaJIT-2.0.5.orig/src/lj_arch.h ++++ LuaJIT-2.0.5/src/lj_arch.h +@@ -313,7 +313,7 @@ + #error "Need at least GCC 4.2 or newer" + #endif + #elif !LJ_TARGET_PS3 +-#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3) ++#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3) && !defined(__clang__) + #error "Need at least GCC 4.3 or newer" + #endif + #endif diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit_2.0.5.bb b/external/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit_2.0.5.bb new file mode 100644 index 00000000..f3a0f70e --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit_2.0.5.bb @@ -0,0 +1,96 @@ +SUMMARY = "Just-In-Time Compiler for Lua" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=10a96c93403affcc34765f4c2612bc22" +HOMEPAGE = "http://luajit.org" + +PV .= "+git${SRCPV}" +SRCREV = "02b521981a1ab919ff2cd4d9bcaee80baf77dce2" +SRC_URI = "git://luajit.org/git/luajit-2.0.git;protocol=http \ + file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \ + file://clang.patch \ +" + +S = "${WORKDIR}/git" + +inherit pkgconfig binconfig siteinfo + +BBCLASSEXTEND = "native" + +# http://luajit.org/install.html#cross +# Host luajit needs to be compiled with the same pointer size +# If you want to cross-compile to any 32 bit target on an x64 OS, +# you need to install the multilib development package (e.g. +# libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part +# (HOST_CC="gcc -m32"). +BUILD_CC_ARCH_append = " ${@['-m32',''][d.getVar('SITEINFO_BITS', True) != '32']}" + +# The lua makefiles expect the TARGET_SYS to be from uname -s +# Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD +LUA_TARGET_OS = "Unknown" +LUA_TARGET_OS_darwin = "Darwin" +LUA_TARGET_OS_linux = "Linux" +LUA_TARGET_OS_linux-gnueabi = "Linux" +LUA_TARGET_OS_mingw32 = "Windows" + +# We don't want the lua buildsystem's compiler optimizations, or its +# stripping, and we don't want it to pick up CFLAGS or LDFLAGS, as those apply +# to both host and target compiles +EXTRA_OEMAKE = "\ + Q= E='@:' \ + \ + CCOPT= CCOPT_x86= CFLAGS= LDFLAGS= TARGET_STRIP='@:' \ + \ + 'TARGET_SYS=${LUA_TARGET_OS}' \ + \ + 'CC=${CC}' \ + 'TARGET_AR=${AR} rcus' \ + 'TARGET_CFLAGS=${CFLAGS}' \ + 'TARGET_LDFLAGS=${LDFLAGS}' \ + 'TARGET_SHLDFLAGS=${LDFLAGS}' \ + 'HOST_CC=${BUILD_CC}' \ + 'HOST_CFLAGS=${BUILD_CFLAGS}' \ + \ + 'PREFIX=${prefix}' \ + 'MULTILIB=${baselib}' \ + 'LDCONFIG=:' \ +" + +do_compile () { + oe_runmake +} + +# There's INSTALL_LIB and INSTALL_SHARE also, but the lua binary hardcodes the +# '/share' and '/' + LUA_MULTILIB paths, so we don't want to break those +# expectations. +EXTRA_OEMAKEINST = "\ + 'DESTDIR=${D}' \ + 'INSTALL_BIN=${D}${bindir}' \ + 'INSTALL_INC=${D}${includedir}/luajit-$(MAJVER).$(MINVER)' \ + 'INSTALL_MAN=${D}${mandir}/man1' \ +" +do_install () { + oe_runmake ${EXTRA_OEMAKEINST} install + rmdir ${D}${datadir}/lua/5.* \ + ${D}${datadir}/lua \ + ${D}${libdir}/lua/5.* \ + ${D}${libdir}/lua +} + +PACKAGES += 'luajit-common' + +# See the comment for EXTRA_OEMAKEINST. This is needed to ensure the hardcoded +# paths are packaged regardless of what the libdir and datadir paths are. +FILES_${PN} += "${prefix}/${baselib} ${prefix}/share" +FILES_${PN} += "${libdir}/libluajit-5.1.so.2 \ + ${libdir}/libluajit-5.1.so.${PV} \ +" +FILES_${PN}-dev += "${libdir}/libluajit-5.1.a \ + ${libdir}/libluajit-5.1.so \ + ${libdir}/pkgconfig/luajit.pc \ +" +FILES_luajit-common = "${datadir}/${BPN}-${PV}" + +# Aarch64/mips64 is not supported in this release +COMPATIBLE_HOST_aarch64 = "null" +COMPATIBLE_HOST_mipsarchn32 = "null" +COMPATIBLE_HOST_mipsarchn64 = "null" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/mcpp/files/ice-mcpp.patch b/external/meta-openembedded/meta-oe/recipes-devtools/mcpp/files/ice-mcpp.patch new file mode 100644 index 00000000..8103cf09 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/mcpp/files/ice-mcpp.patch @@ -0,0 +1,208 @@ +diff -r -c -N ../mcpp-2.7.2-old/noconfig/vc2010.dif ./noconfig/vc2010.dif +*** ../mcpp-2.7.2-old/noconfig/vc2010.dif Wed Dec 31 20:30:00 1969 +--- ./noconfig/vc2010.dif Fri May 14 12:47:22 2010 +*************** +*** 0 **** +--- 1,67 ---- ++ *** noconfig.H Thu Sep 25 15:34:56 2008 ++ --- noconfig.H.vc2005 Thu Sep 25 17:23:49 2008 ++ *************** ++ *** 15,21 **** ++ */ ++ ++ /* Define target operating-system. */ ++ ! #define SYSTEM SYS_FREEBSD ++ ++ /* Define target compiler. */ ++ #ifndef COMPILER ++ --- 15,21 ---- ++ */ ++ ++ /* Define target operating-system. */ ++ ! #define SYSTEM SYS_WIN32 ++ ++ /* Define target compiler. */ ++ #ifndef COMPILER ++ *************** ++ *** 26,36 **** ++ #define HOST_SYSTEM SYSTEM ++ ++ /* Define host compiler. */ ++ ! #define HOST_COMPILER GNUC ++ ++ /* Version message. */ ++ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ++ ! #define VERSION_MSG "GCC 3.4" ++ #if 0 ++ "LCC-Win32 2006-03" ++ "Visual C 2005" ++ --- 26,36 ---- ++ #define HOST_SYSTEM SYSTEM ++ ++ /* Define host compiler. */ ++ ! #define HOST_COMPILER MSC ++ ++ /* Version message. */ ++ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */ ++ ! #define VERSION_MSG "Visual C 2010" ++ #if 0 ++ "LCC-Win32 2006-03" ++ "Visual C 2005" ++ *************** ++ *** 212,221 **** ++ #define ONE_PASS TRUE ++ #endif ++ #define COMPILER_EXT "_MSC_VER" ++ ! #define COMPILER_EXT_VAL "1500" /* VC 6.0: "1200" */ ++ /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */ ++ #define COMPILER_EXT2 "_MSC_FULL_VER" ++ ! #define COMPILER_EXT2_VAL "150021022" /* VC 6.0: "12008804" */ ++ /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */ ++ /* VC 2008: "150021022" */ ++ #define COMPILER_SP1 "_MSC_EXTENSIONS" ++ --- 212,221 ---- ++ #define ONE_PASS TRUE ++ #endif ++ #define COMPILER_EXT "_MSC_VER" ++ ! #define COMPILER_EXT_VAL "1600" /* VC 6.0: "1200" */ ++ /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */ ++ #define COMPILER_EXT2 "_MSC_FULL_VER" ++ ! #define COMPILER_EXT2_VAL "160030319" /* VC 6.0: "12008804" */ ++ /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */ ++ /* VC 2008: "150021022" */ ++ #define COMPILER_SP1 "_MSC_EXTENSIONS" +diff -r -c -N ../mcpp-2.7.2-old/src/internal.H ./src/internal.H +*** ../mcpp-2.7.2-old/src/internal.H Wed Aug 27 10:31:16 2008 +--- ./src/internal.H Fri May 14 12:40:56 2010 +*************** +*** 390,395 **** +--- 390,397 ---- + extern char identifier[]; /* Lastly scanned name */ + extern IFINFO ifstack[]; /* Information of #if nesting */ + extern char work_buf[]; ++ extern FILEINFO * sh_file; ++ extern int sh_line; + /* Temporary buffer for directive line and macro expansion */ + + /* main.c */ +*************** +*** 557,562 **** + #endif + #endif + +! #if HOST_HAVE_STPCPY + extern char * stpcpy( char * dest, const char * src); + #endif +--- 559,564 ---- + #endif + #endif + +! #if HOST_HAVE_STPCPY && !defined(stpcpy) + extern char * stpcpy( char * dest, const char * src); + #endif +diff -r -c -N ../mcpp-2.7.2-old/src/main.c ./src/main.c +*** ../mcpp-2.7.2-old/src/main.c Wed Nov 5 05:04:46 2008 +--- ./src/main.c Fri May 14 12:40:56 2010 +*************** +*** 326,331 **** +--- 326,333 ---- + = FALSE; + option_flags.trig = TRIGRAPHS_INIT; + option_flags.dig = DIGRAPHS_INIT; ++ sh_file = NULL; ++ sh_line = 0; + } + + int mcpp_lib_main +diff -r -c -N ../mcpp-2.7.2-old/src/support.c ./src/support.c +*** ../mcpp-2.7.2-old/src/support.c Tue Jun 10 06:02:33 2008 +--- ./src/support.c Fri May 14 12:40:56 2010 +*************** +*** 188,194 **** + size_t length + ) + { +! if (mem_buf_p->bytes_avail < length) { /* Need to allocate more memory */ + size_t size = MAX( BUF_INCR_SIZE, length); + + if (mem_buf_p->buffer == NULL) { /* 1st append */ +--- 188,194 ---- + size_t length + ) + { +! if (mem_buf_p->bytes_avail < length + 1) { /* Need to allocate more memory */ + size_t size = MAX( BUF_INCR_SIZE, length); + + if (mem_buf_p->buffer == NULL) { /* 1st append */ +*************** +*** 1722,1727 **** +--- 1722,1729 ---- + sp -= 2; + while (*sp != '\n') /* Until end of line */ + mcpp_fputc( *sp++, OUT); ++ mcpp_fputc( '\n', OUT); ++ wrong_line = TRUE; + } + goto end_line; + default: /* Not a comment */ +diff -r -c -N ../mcpp-2.7.2-old/src/system.c ./src/system.c +*** ../mcpp-2.7.2-old/src/system.c 2008-11-26 10:53:51.000000000 +0100 +--- ./src/system.c 2011-02-21 16:18:05.678058106 +0100 +*************** +*** 3534,3539 **** +--- 3534,3565 ---- + FILEINFO * file; + const char * too_many_include_nest = + "More than %.0s%ld nesting of #include"; /* _F_ _W4_ */ ++ ++ // ++ // When encoding is UTF-8, skip BOM if present. ++ // ++ if(mbchar == UTF8 && fp != NULL && ftell(fp) == 0) ++ { ++ const unsigned char UTF8_BOM[3] = {0xEF, 0xBB, 0xBF}; ++ unsigned char FILE_HEAD[3] = {0, 0, 0}; ++ int i; ++ for(i = 0; i < 3; ++i) ++ { ++ FILE_HEAD[i] = getc(fp); ++ if(FILE_HEAD[i] != UTF8_BOM[i]) ++ { ++ if(FILE_HEAD[i] == (unsigned char)EOF) ++ { ++ i--; ++ } ++ for(; i >= 0; --i) ++ { ++ ungetc(FILE_HEAD[i], fp); ++ } ++ break; ++ } ++ } ++ } + + filename = set_fname( filename); /* Search or append to fnamelist[] */ + fullname = set_fname( fullname); /* Search or append to fnamelist[] */ +*************** +*** 3858,3863 **** +--- 3884,3892 ---- + } + #endif + ++ FILEINFO* sh_file; ++ int sh_line; ++ + void sharp( + FILEINFO * sharp_file, + int flag /* Flag to append to the line for GCC */ +*************** +*** 3868,3875 **** + * else (i.e. 'sharp_file' is NULL) 'infile'. + */ + { +- static FILEINFO * sh_file; +- static int sh_line; + FILEINFO * file; + int line; + +--- 3897,3902 ---- diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/mcpp/mcpp_2.7.2.bb b/external/meta-openembedded/meta-oe/recipes-devtools/mcpp/mcpp_2.7.2.bb new file mode 100644 index 00000000..a7163a35 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/mcpp/mcpp_2.7.2.bb @@ -0,0 +1,16 @@ +SUMMARY = "MCPP is a portable C/C++ preprocessor" +HOMEPAGE = "http://mcpp.sourceforge.net/" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://LICENSE;md5=5ca370b75ec890321888a00cea9bc1d5" + +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ + file://ice-mcpp.patch " +SRC_URI[md5sum] = "512de48c87ab023a69250edc7a0c7b05" +SRC_URI[sha256sum] = "3b9b4421888519876c4fc68ade324a3bbd81ceeb7092ecdbbc2055099fcb8864" + +inherit autotools + +EXTRA_OECONF = " --enable-mcpplib " + +BBCLASSEXTEND = "native nativesdk" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/memstat/memstat/0001-Include-limits.h-for-PATH_MAX-definition.patch b/external/meta-openembedded/meta-oe/recipes-devtools/memstat/memstat/0001-Include-limits.h-for-PATH_MAX-definition.patch new file mode 100644 index 00000000..9a0a17e0 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/memstat/memstat/0001-Include-limits.h-for-PATH_MAX-definition.patch @@ -0,0 +1,29 @@ +From 4b6c957372314562bf7b9117103e3a08643eb7b8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 18 Mar 2017 17:47:28 -0700 +Subject: [PATCH] Include limits.h for PATH_MAX definition + +Fixes + +error: use of undeclared identifier 'PATH_MAX' + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + memstat.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/memstat.c b/memstat.c +index 5039fb0..3ff6ee4 100644 +--- a/memstat.c ++++ b/memstat.c +@@ -19,6 +19,7 @@ + #include <unistd.h> + #include <getopt.h> + #include <errno.h> ++#include <limits.h> + + /* blacklist devices that just map physical memory */ + char *blacklist[] = { +-- +2.12.0 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/memstat/memstat_1.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/memstat/memstat_1.0.bb new file mode 100644 index 00000000..91a9200c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/memstat/memstat_1.0.bb @@ -0,0 +1,31 @@ +SUMMARY = "Display virtual memory allocation" +DESCRIPTION = "Lists all the processes, executables, and shared libraries \ +that are using up virtual memory. It's helpful to see how the shared memory \ +is used and which 'old' libs are loaded. \ +" +HOMEPAGE = "http://memstattool.sourceforge.net/" +SECTION = "devtool" + +LICENSE = "GPLv2" + +S = "${WORKDIR}/memstattool" + +LIC_FILES_CHKSUM = "file://debian/copyright;md5=87be186443b1ac2cfa466f475e1ee0cb" + +SRC_URI = "http://sourceforge.net/projects/memstattool/files/memstat_${PV}.tar.gz \ + file://0001-Include-limits.h-for-PATH_MAX-definition.patch \ + " + +SRC_URI[md5sum] = "2c3acc0c62b2a18f6601b84e54aa7462" +SRC_URI[sha256sum] = "245d5fc7fb87bcfd14486cd34917cae2856e799559ac568434af12c4852bce94" + +do_install_append(){ + install -d ${D}${bindir} + install -m 0755 memstat ${D}${bindir} + install -d ${D}${sysconfdir} + install -m 0755 memstat.conf ${D}${sysconfdir} + install -d ${D}${mandir}/man1 + install -m 0644 memstat.1 ${D}${mandir}/man1 + install -d ${D}${docdir}/${BPN} + install -m 0644 memstat-tutorial.txt ${D}${docdir}/${BPN} +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/mercurial/mercurial_4.6.1.bb b/external/meta-openembedded/meta-oe/recipes-devtools/mercurial/mercurial_4.6.1.bb new file mode 100644 index 00000000..13710aae --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/mercurial/mercurial_4.6.1.bb @@ -0,0 +1,31 @@ +SUMMARY = "The Mercurial distributed SCM" +HOMEPAGE = "http://mercurial.selenic.com/" +SECTION = "console/utils" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" +DEPENDS = "python python-native" +DEPENDS_class-native = "python-native" +RDEPENDS_${PN} = "python python-modules" + +inherit python-dir + +SRC_URI = "https://www.mercurial-scm.org/release/${BP}.tar.gz" +SRC_URI[md5sum] = "f9b2e4a3b5901ef744fa3abe4196e97e" +SRC_URI[sha256sum] = "89fa8ecbc8aa6e48e98f9803a1683ba91367124295dba2407b28c34ca621108d" + +S = "${WORKDIR}/mercurial-${PV}" + +BBCLASSEXTEND = "native" + +EXTRA_OEMAKE = "STAGING_LIBDIR=${STAGING_LIBDIR} STAGING_INCDIR=${STAGING_INCDIR} \ + PREFIX=${prefix}" + +do_configure_append () { + sed -i -e 's:PYTHON=python:PYTHON=${STAGING_BINDIR_NATIVE}/python-native/python:g' ${S}/Makefile +} + +do_install () { + oe_runmake -e install-bin DESTDIR=${D} PREFIX=${prefix} +} + +FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/mpich/mpich_3.2.bb b/external/meta-openembedded/meta-oe/recipes-devtools/mpich/mpich_3.2.bb new file mode 100644 index 00000000..51b313ce --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/mpich/mpich_3.2.bb @@ -0,0 +1,47 @@ +SUMMARY = "Message Passing Interface (MPI) implementation" +HOMEPAGE = "http://www.mpich.org/" +SECTION = "devel" + +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=2106f0435056f3dd9349747a766e5816" + +SRC_URI = " \ + http://www.mpich.org/static/downloads/${PV}/mpich-${PV}.tar.gz \ +" + +SRC_URI[md5sum] = "f414cfa77099cd1fa1a5ae4e22db508a" +SRC_URI[sha256sum] = "0778679a6b693d7b7caff37ff9d2856dc2bfc51318bf8373859bfa74253da3dc" + +RDEPENDS_${PN} += "bash perl libxml2" +S = "${WORKDIR}/${BP}" + +EXTRA_OECONF = "--enable-debuginfo \ + --enable-fast \ + --enable-shared \ + --with-pm=gforker \ + --disable-rpath \ + --disable-f77 \ + --disable-fc \ + --disable-fortran \ + --disable-cxx \ + BASH_SHELL='${USRBINPATH}/env bash' \ + PERL='${USRBINPATH}/env perl' \ +" + +inherit autotools-brokensep gettext + +do_configure_prepend() { + for d in confdb test/mpi/confdb src/openpa/confdb src/pm/hydra/confdb src/pm/hydra/tools/topo/hwloc/hwloc/config src/pm/hydra/mpl/confdb src/mpl/confdb src/mpi/romio/confdb; do + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/$d + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/$d + done + + autoreconf --verbose --install --force -I . -I confdb/ -I maint/ + oe_runconf + exit +} + +do_install_append() { + sed -i 's,${S}/,,g' ${D}/${libdir}/libmpi.la + sed -i 's,${DEBUG_PREFIX_MAP},,g' ${D}/${libdir}/pkgconfig/mpich.pc +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c/0001-Fix-Werror-class-memaccess.patch b/external/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c/0001-Fix-Werror-class-memaccess.patch new file mode 100644 index 00000000..b0d772d9 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c/0001-Fix-Werror-class-memaccess.patch @@ -0,0 +1,35 @@ +From a05d92ae85024d0648f69f95307a1d3e8e51109c Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 1 Apr 2018 19:55:38 -0700 +Subject: [PATCH] Fix -Werror=class-memaccess + +Casting to void* make gcc happy since its upset about +object types and rightly so + +Fixes + +'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'struct msgpack::v2::object' from an array of 'const msgpack_object' {aka 'const struct msgpack_object'} [-Werror=class-memaccess] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted [https://github.com/msgpack/msgpack-c/pull/659] + + include/msgpack/v1/object.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/msgpack/v1/object.hpp b/include/msgpack/v1/object.hpp +index 64da8c53..9721f705 100644 +--- a/include/msgpack/v1/object.hpp ++++ b/include/msgpack/v1/object.hpp +@@ -661,7 +661,7 @@ inline object::object(const msgpack_object& o) + inline void operator<< (msgpack::object& o, const msgpack_object& v) + { + // FIXME beter way? +- std::memcpy(&o, &v, sizeof(v)); ++ std::memcpy(static_cast<void*>(&o), &v, sizeof(v)); + } + + inline object::operator msgpack_object() const +-- +2.16.3 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c_2.1.5.bb b/external/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c_2.1.5.bb new file mode 100644 index 00000000..690a7f44 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c_2.1.5.bb @@ -0,0 +1,19 @@ +SUMMARY = "MessagePack implementation for C and C++" +DESCRIPTION = "MessagePack is an efficient binary serialization format. It's like JSON. but fast and small" +HOMEPAGE = "http://msgpack.org/index.html" +LICENSE = "BSL-1.0" +LIC_FILES_CHKSUM = "file://NOTICE;md5=7a858c074723608e08614061dc044352 \ + file://COPYING;md5=0639c4209b6f2abf1437c813b208f2d3 \ + file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c \ + " + +PV .= "+git${SRCPV}" + +SRC_URI = "git://github.com/msgpack/msgpack-c \ + file://0001-Fix-Werror-class-memaccess.patch \ + " +SRCREV = "208595b2620cf6260ce3d6d4cf8543f13b206449" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/msr-tools/msr-tools_1.3.bb b/external/meta-openembedded/meta-oe/recipes-devtools/msr-tools/msr-tools_1.3.bb new file mode 100644 index 00000000..e4701afa --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/msr-tools/msr-tools_1.3.bb @@ -0,0 +1,21 @@ +SUMMARY = "utilies to read and write Intel model-specific registers" +HOMEPAGE = "https://01.org/msr-tools" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://Makefile;beginline=1;endline=11;md5=678a3928c856042424c734f4a7586e65" +SECTION = "devel" + +SRC_URI = "https://01.org/sites/default/files/downloads/msr-tools/msr-tools-${PV}.zip" +SRC_URI[md5sum] = "67d18527f64fd707c9b7a79f13d19fd5" +SRC_URI[sha256sum] = "f9457b5340f5f274da4239a461f0db6b514142b40461559d9c6150f05aab1d1e" + +S = "${WORKDIR}/msr-tools-master" + +COMPATIBLE_HOST = '(i.86|x86_64).*-linux' + +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +do_install() { + install -d ${D}${sbindir} + install -m 0755 rdmsr ${D}${sbindir} + install -m 0755 wrmsr ${D}${sbindir} +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_git.bb new file mode 100644 index 00000000..65e49bc9 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_git.bb @@ -0,0 +1,29 @@ +SUMMARY = "JSON for modern C++" +HOMEPAGE = "https://nlohmann.github.io/json/" +SECTION = "libs" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE.MIT;md5=9a8ae1c2d606c432a2aa2e2de15be22a" + +SRC_URI = "git://github.com/nlohmann/json.git" + +PV = "3.3.0+git${SRCPV}" + +SRCREV = "aafad2be1f3cd259a1e79d2f6fcf267d1ede9ec7" + +S = "${WORKDIR}/git" + +inherit cmake + +EXTRA_OECMAKE += "-DJSON_BuildTests=OFF" + +# nlohmann-json is a header only C++ library, so the main package will be empty. + +RDEPENDS_${PN}-dev = "" + +BBCLASSEXTEND = "native nativesdk" + +# other packages commonly reference the file directly as "json.hpp" +# create symlink to allow this usage +do_install_append() { + ln -s nlohmann/json.hpp ${D}${includedir}/json.hpp +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0001-Disable-running-gyp-files-for-bundled-deps.patch b/external/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0001-Disable-running-gyp-files-for-bundled-deps.patch new file mode 100644 index 00000000..324a4683 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0001-Disable-running-gyp-files-for-bundled-deps.patch @@ -0,0 +1,29 @@ +From c2aff16cc196a61f4ab1cdae4a91c7926123c239 Mon Sep 17 00:00:00 2001 +From: Zuzana Svetlikova <zsvetlik@redhat.com> +Date: Thu, 27 Apr 2017 14:25:42 +0200 +Subject: [PATCH] Disable running gyp on shared deps + +--- + Makefile | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 0a217bd893..e1229ad07f 100644 +--- a/Makefile ++++ b/Makefile +@@ -79,10 +79,9 @@ $(NODE_G_EXE): config.gypi out/Makefile + $(MAKE) -C out BUILDTYPE=Debug V=$(V) + if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi + +-out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \ +- deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \ +- deps/v8/gypfiles/features.gypi deps/v8/src/v8.gyp node.gyp \ +- config.gypi ++out/Makefile: common.gypi deps/http_parser/http_parser.gyp \ ++ deps/v8/gypfiles/toolchain.gypi deps/v8/gypfiles/features.gypi \ ++ deps/v8/src/v8.gyp node.gyp config.gypi + $(PYTHON) tools/gyp_node.py -f make + + config.gypi: configure +-- +2.12.2 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_8.12.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_8.12.0.bb new file mode 100644 index 00000000..8c339782 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_8.12.0.bb @@ -0,0 +1,92 @@ +DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript" +HOMEPAGE = "http://nodejs.org" +LICENSE = "MIT & BSD & Artistic-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=fde91d5c5bbd1e0389623e1ac018d9e8" + +DEPENDS = "openssl zlib icu" + +inherit pkgconfig + +COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*" +COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*" +COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*" + +SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ + file://0001-Disable-running-gyp-files-for-bundled-deps.patch \ +" +SRC_URI[md5sum] = "8b3abd033dae96b6fadcb6a872a44d3c" +SRC_URI[sha256sum] = "5a9dff58016c18fb4bf902d963b124ff058a550ebcd9840c677757387bce419a" + +S = "${WORKDIR}/node-v${PV}" + +# v8 errors out if you have set CCACHE +CCACHE = "" + +def map_nodejs_arch(a, d): + import re + + if re.match('i.86$', a): return 'ia32' + elif re.match('x86_64$', a): return 'x64' + elif re.match('aarch64$', a): return 'arm64' + elif re.match('(powerpc64|ppc64le)$', a): return 'ppc64' + elif re.match('powerpc$', a): return 'ppc' + return a + +ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \ + ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \ + bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \ + bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \ + '--with-arm-fpu=vfp', d), d), d)}" +GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' " +ARCHFLAGS ?= "" + +# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi +do_configure () { + rm -rf ${S}/deps/openssl + export LD="${CXX}" + GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES + # $TARGET_ARCH settings don't match --dest-cpu settings + ./configure --prefix=${prefix} --with-intl=system-icu --without-snapshot --shared-openssl --shared-zlib \ + --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ + --dest-os=linux \ + ${ARCHFLAGS} +} + +do_compile () { + export LD="${CXX}" + oe_runmake BUILDTYPE=Release +} + +do_install () { + oe_runmake install DESTDIR=${D} +} + +do_install_append_class-native() { + # use node from PATH instead of absolute path to sysroot + # node-v0.10.25/tools/install.py is using: + # shebang = os.path.join(node_prefix, 'bin/node') + # update_shebang(link_path, shebang) + # and node_prefix can be very long path to bindir in native sysroot and + # when it exceeds 128 character shebang limit it's stripped to incorrect path + # and npm fails to execute like in this case with 133 characters show in log.do_install: + # updating shebang of /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/work/x86_64-linux/nodejs-native/0.10.15-r0/image/home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/npm to /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/node + # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js + # use sed on npm-cli.js because otherwise symlink is replaced with normal file and + # npm-cli.js continues to use old shebang + sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js +} + +do_install_append_class-target() { + sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js +} + +PACKAGES =+ "${PN}-npm" +FILES_${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm ${bindir}/npx" +RDEPENDS_${PN}-npm = "bash python-shell python-datetime python-subprocess python-textutils \ + python-compiler python-misc python-multiprocessing" + +PACKAGES =+ "${PN}-systemtap" +FILES_${PN}-systemtap = "${datadir}/systemtap" + + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/openocd/openocd/0001-Fix-libusb-1.0.22-deprecated-libusb_set_debug-with-l.patch b/external/meta-openembedded/meta-oe/recipes-devtools/openocd/openocd/0001-Fix-libusb-1.0.22-deprecated-libusb_set_debug-with-l.patch new file mode 100644 index 00000000..c5b9083d --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/openocd/openocd/0001-Fix-libusb-1.0.22-deprecated-libusb_set_debug-with-l.patch @@ -0,0 +1,39 @@ +From b95a996bfb281104b68ec66f32ebb79db519a4a8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 31 May 2018 21:06:46 -0700 +Subject: [PATCH] Fix libusb-1.0.22 deprecated libusb_set_debug with + libusb_set_option + +libusb_set_debug is deprecated in libusb >= 1.0.22 therefore replace +with equivalent libusb_set_option() API + +see libusb commit for more details + +https://github.com/libusb/libusb/commit/539f22e2fd916558d11ab9a66f10f461c5593168 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted [http://openocd.zylin.com/#/c/4540/] + src/jtag/drivers/xds110.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c +index 90b699027..9bfe02ea8 100644 +--- a/src/jtag/drivers/xds110.c ++++ b/src/jtag/drivers/xds110.c +@@ -367,8 +367,11 @@ static bool usb_connect(void) + + /* Set libusb to auto detach kernel and disable debug messages */ + (void)libusb_set_auto_detach_kernel_driver(dev, 1); ++#if LIBUSB_API_VERSION >= 0x01000106 ++ libusb_set_option(ctx, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_NONE); ++#else + libusb_set_debug(ctx, LIBUSB_LOG_LEVEL_NONE); +- ++#endif + /* Claim the debug interface on the XDS110 */ + result = libusb_claim_interface(dev, INTERFACE_DEBUG); + } else { +-- +2.17.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/openocd/openocd_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/openocd/openocd_git.bb new file mode 100644 index 00000000..21a86de3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/openocd/openocd_git.bb @@ -0,0 +1,54 @@ +SUMMARY = "Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" +DEPENDS = "libusb-compat libftdi" +RDEPENDS_${PN} = "libusb1" + +SRC_URI = " \ + git://repo.or.cz/openocd.git;protocol=http;name=openocd \ + git://repo.or.cz/r/git2cl.git;protocol=http;destsuffix=tools/git2cl;name=git2cl \ + git://repo.or.cz/r/jimtcl.git;protocol=http;destsuffix=git/jimtcl;name=jimtcl \ + git://repo.or.cz/r/libjaylink.git;protocol=http;destsuffix=git/src/jtag/drivers/libjaylink;name=libjaylink \ + file://0001-Fix-libusb-1.0.22-deprecated-libusb_set_debug-with-l.patch \ +" + +SRCREV_FORMAT = "openocd" +SRCREV_openocd = "cdf1e826eb23c29de1019ce64125f644f01b0afe" +SRCREV_git2cl = "8373c9f74993e218a08819cbcdbab3f3564bbeba" +SRCREV_jimtcl = "a9bf5975fd0f89974d689a2d9ebd0873c8d64787" +SRCREV_libjaylink = "8645845c1abebd004e991ba9a7f808f4fd0c608b" + +PV = "0.10+gitr${SRCPV}" +S = "${WORKDIR}/git" + +inherit pkgconfig autotools-brokensep gettext + +BBCLASSEXTEND += "nativesdk" + +EXTRA_OECONF = "--enable-ftdi --disable-doxygen-html" + +do_configure() { + ./bootstrap nosubmodule + oe_runconf ${EXTRA_OECONF} +} + +do_install() { + oe_runmake DESTDIR=${D} install + if [ -e "${D}${infodir}" ]; then + rm -Rf ${D}${infodir} + fi + if [ -e "${D}${mandir}" ]; then + rm -Rf ${D}${mandir} + fi + if [ -e "${D}${bindir}/.debug" ]; then + rm -Rf ${D}${bindir}/.debug + fi +} + +FILES_${PN} = " \ + ${datadir}/openocd/* \ + ${bindir}/openocd \ + " + +PACKAGECONFIG[sysfsgpio] = "--enable-sysfsgpio,--disable-sysfsgpio" +PACKAGECONFIG ??= "sysfsgpio" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/packagegroups/packagegroup-sdk-target.bb b/external/meta-openembedded/meta-oe/recipes-devtools/packagegroups/packagegroup-sdk-target.bb new file mode 100644 index 00000000..53fc159c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/packagegroups/packagegroup-sdk-target.bb @@ -0,0 +1,28 @@ +SUMMARY = "Packages required for a target (on-device) SDK" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +PR = "r1" + +inherit packagegroup + +RPROVIDES_${PN} += "packagegroup-native-sdk" +RREPLACES_${PN} += "packagegroup-native-sdk" +RCONFLICTS_${PN} += "packagegroup-native-sdk" +RDEPENDS_${PN} = "gcc-symlinks g++-symlinks cpp cpp-symlinks \ + binutils-symlinks \ + perl-modules \ + flex flex-dev \ + bison \ + gawk \ + sed \ + grep \ + autoconf automake \ + make \ + patch diffstat diffutils \ + libstdc++-dev \ + libtool libtool-dev \ + pkgconfig" + +# usefull, but not in oe-core/meta-oe yet: patchutils +RRECOMMENDS_${PN} = " g77-symlinks gfortran-symlinks" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/pax-utils/pax-utils_1.2.2.bb b/external/meta-openembedded/meta-oe/recipes-devtools/pax-utils/pax-utils_1.2.2.bb new file mode 100644 index 00000000..9635a5e7 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/pax-utils/pax-utils_1.2.2.bb @@ -0,0 +1,36 @@ +SUMMARY = "Security-focused ELF files checking tool" +DESCRIPTION = "This is a small set of various PaX aware and related \ +utilities for ELF binaries. It can check ELF binary files and running \ +processes for issues that might be relevant when using ELF binaries \ +along with PaX, such as non-PIC code or executable stack and heap." +HOMEPAGE = "http://www.gentoo.org/proj/en/hardened/pax-utils.xml" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a" + +SRC_URI = "https://dev.gentoo.org/~vapier/dist/pax-utils-${PV}.tar.xz" +SRC_URI[md5sum] = "a580468318f0ff42edf4a8cd314cc942" +SRC_URI[sha256sum] = "7f4a7f8db6b4743adde7582fa48992ad01776796fcde030683732f56221337d9" + +RDEPENDS_${PN} += "bash" + +export GNULIB_OVERRIDES_WINT_T = "0" + +do_configure_prepend() { + touch ${S}/NEWS ${S}/AUTHORS ${S}/ChangeLog ${S}/README +} + +do_install() { + oe_runmake PREFIX=${D}${prefix} DESTDIR=${D} install +} + +BBCLASSEXTEND = "native" + +inherit autotools pkgconfig + +PACKAGECONFIG ??= "" + +PACKAGECONFIG[libcap] = "--with-caps, --without-caps, libcap" +PACKAGECONFIG[libseccomp] = "--with-seccomp, --without-seccomp, libseccomp" +PACKAGECONFIG[pyelftools] = "--with-python, --without-python,, pyelftools" + +EXTRA_OECONF += "--enable-largefile" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/perl/ipc-run_20180523.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/perl/ipc-run_20180523.0.bb new file mode 100644 index 00000000..c812ae13 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/perl/ipc-run_20180523.0.bb @@ -0,0 +1,24 @@ +DESCRIPTION = "\ +IPC::Run allows you run and interact with child processes \ +using files, pipes, and pseudo-ttys. Both system()-style and scripted \ +usages are supported and may be mixed. Likewise, functional and OO API \ +styles are both supported and may be mixed." +HOMEPAGE = "https://metacpan.org/release/IPC-Run" +SECTION = "libs" +LICENSE = "Artistic-1.0 | GPL-1.0+" +LIC_FILES_CHKSUM = "file://LICENSE;md5=0ebd37caf53781e8b7223e6b99b63f4e" +DEPENDS = "perl" + +SRC_URI = "git://github.com/toddr/IPC-Run.git" +SRCREV = "0b409702490729eeb97ae65f5b94d949ec083134" + +S = "${WORKDIR}/git" + +inherit cpan + +EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}" + +do_compile() { + export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')" + cpan_do_compile +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/perl/libdbd-mysql-perl_4.043.bb b/external/meta-openembedded/meta-oe/recipes-devtools/perl/libdbd-mysql-perl_4.043.bb new file mode 100644 index 00000000..bd8ba780 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/perl/libdbd-mysql-perl_4.043.bb @@ -0,0 +1,25 @@ +SUMMARY = "A Perl DBI driver for MySQL" +DESCRIPTION = "DBD::mysql is the Perl5 Database Interface driver for \ +the MySQL database. In other words: DBD::mysql is an interface between \ +the Perl programming language and the MySQL programming API that comes \ +with the MySQL relational database management system. Most functions \ +provided by this programming API are supported. Some rarely used \ +functions are missing, mainly because no-one ever requested them. \ +" +HOMEPAGE = "http://search.cpan.org/~michielb/DBD-mysql-4.036/lib/DBD/mysql.pm" + +SECTION = "libs" +LICENSE = "Artistic-1.0 | GPL-1.0+" +DEPENDS += "libdbi-perl-native libmysqlclient" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=d0a06964340e5c0cde88b7af611f755c" + +SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MI/MICHIELB/DBD-mysql-${PV}.tar.gz \ +" + +SRC_URI[md5sum] = "4a00dd7f1c057931147c65dfc4901c36" +SRC_URI[sha256sum] = "629f865e8317f52602b2f2efd2b688002903d2e4bbcba5427cb6188b043d6f99" + +S = "${WORKDIR}/DBD-mysql-${PV}" + +inherit cpan diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/perl/libdbi-perl_1.641.bb b/external/meta-openembedded/meta-oe/recipes-devtools/perl/libdbi-perl_1.641.bb new file mode 100644 index 00000000..24a1245f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/perl/libdbi-perl_1.641.bb @@ -0,0 +1,36 @@ +SUMMARY = "The Perl Database Interface" +DESCRIPTION = "DBI is a database access Application Programming Interface \ +(API) for the Perl Language. The DBI API Specification defines a set \ +of functions, variables and conventions that provide a consistent \ +database interface independent of the actual database being used. \ +" +HOMEPAGE = "http://search.cpan.org/dist/DBI/" +SECTION = "libs" +LICENSE = "Artistic-1.0 | GPL-1.0+" +RDEPENDS_${PN} = " perl-module-carp \ + perl-module-exporter \ + perl-module-exporter-heavy \ + perl-module-dynaloader \ +" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=10982c7148e0a012c0fd80534522f5c5" + +SRC_URI = "http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-${PV}.tar.gz" +SRC_URI[md5sum] = "e77fd37fcf77fc88fde029c1b75ded54" +SRC_URI[sha256sum] = "5509e532cdd0e3d91eda550578deaac29e2f008a12b64576e8c261bb92e8c2c1" + +S = "${WORKDIR}/DBI-${PV}" + +inherit cpan ptest-perl + +do_install_prepend() { + # test requires "-T" (taint) command line option + rm -rf ${B}/t/pod-coverage.t + rm -rf ${B}/t/13taint.t + # source of test failure not obvious + rm -rf ${B}/t/85gofer.t + # unclear why there are several duplicates of tests in tarball + rm -rf ${B}/t/z*.t +} + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/perl/libio-pty-perl_1.12.bb b/external/meta-openembedded/meta-oe/recipes-devtools/perl/libio-pty-perl_1.12.bb new file mode 100644 index 00000000..b1a95e57 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/perl/libio-pty-perl_1.12.bb @@ -0,0 +1,16 @@ +SUMMARY = "Perl module for pseudo tty IO" +SECTION = "libs" +LICENSE = "Artistic-1.0 | GPL-1.0+" +LIC_FILES_CHKSUM = "file://META.yml;beginline=11;endline=12;md5=b2562f94907eeb42e8ce9d45f628e587" + +SRC_URI = "http://www.cpan.org/modules/by-module/IO/IO-Tty-${PV}.tar.gz" + +SRC_URI[md5sum] = "11695a1a516b3bd1b90ce75ff0ce3e6d" +SRC_URI[sha256sum] = "a2ef8770d3309178203f8c8ac25e623e63cf76e97830fd3be280ade1a555290d" + +S = "${WORKDIR}/IO-Tty-${PV}" + +inherit cpan + +FILES_${PN}-dbg += "${libdir}/perl/vendor_perl/*/auto/IO/Tty/.debug/" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php.inc b/external/meta-openembedded/meta-oe/recipes-devtools/php/php.inc new file mode 100644 index 00000000..bfd0ddfb --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php.inc @@ -0,0 +1,263 @@ +SUMMARY = "A server-side, HTML-embedded scripting language" +HOMEPAGE = "http://www.php.net" +SECTION = "console/network" + +LICENSE = "PHP-3.0" + +BBCLASSEXTEND = "native" +DEPENDS = "zlib bzip2 libxml2 virtual/libiconv php-native lemon-native" +DEPENDS_class-native = "zlib-native libxml2-native" + +PHP_MAJOR_VERSION = "${@d.getVar('PV', True).split('.')[0]}" + +SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \ + file://0001-php-don-t-use-broken-wrapper-for-mkdir.patch \ + " + +SRC_URI_append_class-target = " \ + file://iconv.patch \ + file://imap-fix-autofoo.patch \ + file://php_exec_native.patch \ + file://php-fpm.conf \ + file://php-fpm-apache.conf \ + file://0001-acinclude.m4-don-t-unset-cache-variables.patch \ + file://70_mod_php${PHP_MAJOR_VERSION}.conf \ + file://php-fpm.service \ + " +S = "${WORKDIR}/php-${PV}" + +inherit autotools pkgconfig pythonnative gettext + +# phpize is not scanned for absolute paths by default (but php-config is). +# +SSTATE_SCAN_FILES += "phpize" +SSTATE_SCAN_FILES += "build-defs.h" + +PHP_LIBDIR = "${libdir}/php${PHP_MAJOR_VERSION}" + +# Common EXTRA_OECONF +COMMON_EXTRA_OECONF = "--enable-sockets \ + --enable-pcntl \ + --enable-shared \ + --disable-rpath \ + --with-pic \ + --libdir=${PHP_LIBDIR} \ +" +EXTRA_OECONF = "--enable-mbstring \ + --enable-wddx \ + --enable-fpm \ + --enable-zip \ + --with-libdir=${baselib} \ + --with-gettext=${STAGING_LIBDIR}/.. \ + --with-zlib=${STAGING_LIBDIR}/.. \ + --with-iconv=${STAGING_LIBDIR}/.. \ + --with-bz2=${STAGING_DIR_TARGET}${exec_prefix} \ + --with-config-file-path=${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION} \ + ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'ac_cv_c_bigendian_php=no', 'ac_cv_c_bigendian_php=yes', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'pam', '', 'ac_cv_lib_pam_pam_start=no', d)} \ + ${COMMON_EXTRA_OECONF} \ +" + +CACHED_CONFIGUREVARS += "ac_cv_func_dlopen=no ac_cv_lib_dl_dlopen=yes" + +EXTRA_OECONF_class-native = " \ + --with-zlib=${STAGING_LIBDIR_NATIVE}/.. \ + --without-iconv \ + ${COMMON_EXTRA_OECONF} \ +" + +PACKAGECONFIG ??= "mysql sqlite3 imap opcache openssl \ + ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \ +" +PACKAGECONFIG_class-native = "" + +PACKAGECONFIG[mysql] = "--with-mysql=${STAGING_DIR_TARGET}${prefix} \ + --with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config \ + --with-pdo-mysql=${STAGING_BINDIR_CROSS}/mysql_config \ + ,--without-mysql --without-mysqli --without-pdo-mysql \ + ,mysql5" + +PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_LIBDIR}/.. \ + --with-pdo-sqlite=${STAGING_LIBDIR}/.. \ + ,--without-sqlite3 --without-pdo-sqlite \ + ,sqlite3" +PACKAGECONFIG[pgsql] = "--with-pgsql=${STAGING_DIR_TARGET}${exec_prefix},--without-pgsql,postgresql" +PACKAGECONFIG[soap] = "--enable-libxml --enable-soap, --disable-soap, libxml2" +PACKAGECONFIG[apache2] = "--with-apxs2=${STAGING_BINDIR_CROSS}/apxs,,apache2-native apache2" +PACKAGECONFIG[pam] = ",,libpam" +PACKAGECONFIG[imap] = "--with-imap=${STAGING_DIR_HOST} \ + --with-imap-ssl=${STAGING_DIR_HOST} \ + ,--without-imap --without-imap-ssl \ + ,uw-imap" +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," +PACKAGECONFIG[opcache] = "--enable-opcache,--disable-opcache" +PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" + +export PHP_NATIVE_DIR = "${STAGING_BINDIR_NATIVE}" +export PHP_PEAR_PHP_BIN = "${STAGING_BINDIR_NATIVE}/php" +CFLAGS += " -D_GNU_SOURCE -g -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED -I${STAGING_INCDIR}/apache2" +CFLAGS_append_aarch64 = " -O2" + +EXTRA_OEMAKE = "INSTALL_ROOT=${D}" + +acpaths = "" + +do_configure_prepend () { + rm -f ${S}/build/libtool.m4 ${S}/ltmain.sh ${S}/aclocal.m4 + find ${S} -name config.m4 | xargs -n1 sed -i 's!APXS_HTTPD=.*!APXS_HTTPD=${STAGING_BINDIR_NATIVE}/httpd!' +} + +do_configure_append() { + # No, libtool, we really don't want rpath set... + sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' ${HOST_SYS}-libtool + sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' ${HOST_SYS}-libtool +} + +do_install_append_class-native() { + rm -rf ${D}/${PHP_LIBDIR}/php/.registry + rm -rf ${D}/${PHP_LIBDIR}/php/.channels + rm -rf ${D}/${PHP_LIBDIR}/php/.[a-z]* +} + +do_install_prepend() { + cat ${ACLOCALDIR}/libtool.m4 ${ACLOCALDIR}/lt~obsolete.m4 ${ACLOCALDIR}/ltoptions.m4 \ + ${ACLOCALDIR}/ltsugar.m4 ${ACLOCALDIR}/ltversion.m4 > ${S}/build/libtool.m4 +} + +do_install_prepend_class-target() { + if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then + # Install dummy config file so apxs doesn't fail + install -d ${D}${sysconfdir}/apache2 + printf "\nLoadModule dummy_module modules/mod_dummy.so\n" > ${D}${sysconfdir}/apache2/httpd.conf + fi +} + +# fixme +do_install_append_class-target() { + install -d ${D}${sysconfdir}/ + if [ -d ${RECIPE_SYSROOT_NATIVE}${sysconfdir} ];then + install -m 0644 ${RECIPE_SYSROOT_NATIVE}${sysconfdir}/pear.conf ${D}${sysconfdir}/ + fi + rm -rf ${D}/${TMPDIR} + rm -rf ${D}/.registry + rm -rf ${D}/.channels + rm -rf ${D}/.[a-z]* + rm -rf ${D}/var + rm -f ${D}/${sysconfdir}/php-fpm.conf.default + sed -i 's:${STAGING_DIR_NATIVE}::g' ${D}${sysconfdir}/pear.conf + install -m 0644 ${WORKDIR}/php-fpm.conf ${D}/${sysconfdir}/php-fpm.conf + install -d ${D}/${sysconfdir}/apache2/conf.d + install -m 0644 ${WORKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf + install -d ${D}${sysconfdir}/init.d + sed -i 's:=/usr/sbin:=${sbindir}:g' ${B}/sapi/fpm/init.d.php-fpm + sed -i 's:=/etc:=${sysconfdir}:g' ${B}/sapi/fpm/init.d.php-fpm + sed -i 's:=/var:=${localstatedir}:g' ${B}/sapi/fpm/init.d.php-fpm + install -m 0755 ${B}/sapi/fpm/init.d.php-fpm ${D}${sysconfdir}/init.d/php-fpm + install -m 0644 ${WORKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/php-fpm.service ${D}${systemd_unitdir}/system/ + sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + -e 's,@LOCALSTATEDIR@,${localstatedir},g' \ + ${D}${systemd_unitdir}/system/php-fpm.service + fi + + TMP=`dirname ${D}/${TMPDIR}` + while test ${TMP} != ${D}; do + if [ -d ${TMP} ]; then + rmdir ${TMP} + fi + TMP=`dirname ${TMP}`; + done + + if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then + install -d ${D}${libdir}/apache2/modules + install -d ${D}${sysconfdir}/apache2/modules.d + install -d ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION} + install -m 755 libs/libphp${PHP_MAJOR_VERSION}.so ${D}${libdir}/apache2/modules + install -m 644 ${WORKDIR}/70_mod_php${PHP_MAJOR_VERSION}.conf ${D}${sysconfdir}/apache2/modules.d + sed -i s,lib/,${libdir}/, ${D}${sysconfdir}/apache2/modules.d/70_mod_php${PHP_MAJOR_VERSION}.conf + cat ${S}/php.ini-production | \ + sed -e 's,extension_dir = \"\./\",extension_dir = \"/usr/lib/extensions\",' \ + > ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION}/php.ini + rm -f ${D}${sysconfdir}/apache2/httpd.conf* + fi +} + +SYSROOT_PREPROCESS_FUNCS += "php_sysroot_preprocess" + +php_sysroot_preprocess () { + install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + install -m 755 ${D}${bindir}/phpize ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + install -m 755 ${D}${bindir}/php-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + + sed -i 's!eval echo /!eval echo ${STAGING_DIR_HOST}/!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/phpize + sed -i 's!^include_dir=.*!include_dir=${STAGING_INCDIR}/php!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/php-config +} + +MODPHP_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', '${PN}-modphp', '', d)}" + +PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-phar ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-opcache ${PN}" + +RDEPENDS_${PN} += "libgcc" +RDEPENDS_${PN}-pear = "${PN}" +RDEPENDS_${PN}-phar = "${PN}-cli" +RDEPENDS_${PN}-cli = "${PN}" +RDEPENDS_${PN}-modphp = "${PN} apache2" +RDEPENDS_${PN}-opcache = "${PN}" + +INITSCRIPT_PACKAGES = "${PN}-fpm" +inherit update-rc.d + +FILES_${PN}-dbg =+ "${bindir}/.debug \ + ${libdir}/apache2/modules/.debug" +FILES_${PN}-doc += "${PHP_LIBDIR}/php/doc" +FILES_${PN}-cli = "${bindir}/php" +FILES_${PN}-phar = "${bindir}/phar*" +FILES_${PN}-cgi = "${bindir}/php-cgi" +FILES_${PN}-fpm = "${sbindir}/php-fpm ${sysconfdir}/php-fpm.conf ${datadir}/fpm ${sysconfdir}/init.d/php-fpm ${systemd_unitdir}/system/php-fpm.service" +FILES_${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf" +CONFFILES_${PN}-fpm = "${sysconfdir}/php-fpm.conf" +CONFFILES_${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf" +INITSCRIPT_NAME_${PN}-fpm = "php-fpm" +INITSCRIPT_PARAMS_${PN}-fpm = "defaults 60" +FILES_${PN}-pear = "${bindir}/pear* ${bindir}/pecl ${PHP_LIBDIR}/php/PEAR \ + ${PHP_LIBDIR}/php/PEAR*.php ${PHP_LIBDIR}/php/System.php \ + ${PHP_LIBDIR}/php/peclcmd.php ${PHP_LIBDIR}/php/pearcmd.php \ + ${PHP_LIBDIR}/php/.channels ${PHP_LIBDIR}/php/.channels/.alias \ + ${PHP_LIBDIR}/php/.registry ${PHP_LIBDIR}/php/Archive/Tar.php \ + ${PHP_LIBDIR}/php/Console/Getopt.php ${PHP_LIBDIR}/php/OS/Guess.php \ + ${PHP_LIBDIR}/php/data/PEAR \ + ${sysconfdir}/pear.conf" +FILES_${PN}-dev = "${includedir}/php ${PHP_LIBDIR}/build ${bindir}/phpize \ + ${bindir}/php-config ${PHP_LIBDIR}/php/.depdb \ + ${PHP_LIBDIR}/php/.depdblock ${PHP_LIBDIR}/php/.filemap \ + ${PHP_LIBDIR}/php/.lock ${PHP_LIBDIR}/php/test" +FILES_${PN}-staticdev += "${PHP_LIBDIR}/extensions/*/*.a" +FILES_${PN}-opcache = "${PHP_LIBDIR}/extensions/*/opcache${SOLIBSDEV}" +FILES_${PN} = "${PHP_LIBDIR}/php" +FILES_${PN} += "${bindir}" + +SUMMARY_${PN}-modphp = "PHP module for the Apache HTTP server" +FILES_${PN}-modphp = "${libdir}/apache2 ${sysconfdir}" + +MODPHP_OLDPACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'modphp', '', d)}" +RPROVIDES_${PN}-modphp = "${MODPHP_OLDPACKAGE}" +RREPLACES_${PN}-modphp = "${MODPHP_OLDPACKAGE}" +RCONFLICTS_${PN}-modphp = "${MODPHP_OLDPACKAGE}" + +do_install_append_class-native() { + create_wrapper ${D}${bindir}/php \ + PHP_PEAR_SYSCONF_DIR=${sysconfdir}/ +} + + +# Fails to build with thumb-1 (qemuarm) +# | {standard input}: Assembler messages: +# | {standard input}:3719: Error: selected processor does not support Thumb mode `smull r0,r2,r9,r3' +# | {standard input}:3720: Error: unshifted register required -- `sub r2,r2,r0,asr#31' +# | {standard input}:3796: Error: selected processor does not support Thumb mode `smull r0,r2,r3,r3' +# | {standard input}:3797: Error: unshifted register required -- `sub r2,r2,r0,asr#31' +# | make: *** [ext/standard/math.lo] Error 1 +ARM_INSTRUCTION_SET = "arm" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-Add-lpthread-to-link.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-Add-lpthread-to-link.patch new file mode 100644 index 00000000..f70e550f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-Add-lpthread-to-link.patch @@ -0,0 +1,38 @@ +From ed0a954983d50267c2fc0bc13aba929ea0cad971 Mon Sep 17 00:00:00 2001 +From: Dengke Du <dengke.du@windriver.com> +Date: Tue, 2 May 2017 06:34:40 +0000 +Subject: [PATCH] Add -lpthread to link + +When building the php-5.6.26, the following errors occured: + + ld: TSRM/.libs/TSRM.o: undefined reference to symbol + 'pthread_sigmask@@GLIBC_2.2.5' + + error adding symbols: DSO missing from command line + +This is because no pthread to link, so we should add it. + +Upstream-Status: Pending + +Signed-off-by: Dengke Du <dengke.du@windriver.com> +--- + configure.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configure.in b/configure.in +index a467dff1..9afef652 100644 +--- a/configure.in ++++ b/configure.in +@@ -1058,7 +1058,8 @@ case $php_sapi_module in + ;; + esac + +-EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS" ++PTHREAD_LIBS="-lpthread" ++EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS $PTHREAD_LIBS" + + dnl this has to be here to prevent the openssl crypt() from + dnl overriding the system provided crypt(). +-- +2.11.0 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-PHP-5.6-LibSSL-1.1-compatibility.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-PHP-5.6-LibSSL-1.1-compatibility.patch new file mode 100644 index 00000000..ac8365b8 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-PHP-5.6-LibSSL-1.1-compatibility.patch @@ -0,0 +1,1285 @@ +Subject: [PATCH] PHP 5.6 - LibSSL 1.1 compatibility + +This patch does not try to backport the 7.1 openssl module, it is the +improved version of the 5.6 original openssl module. + +https://github.com/oerdnj/deb.sury.org/issues/566 +http://zettasystem.com/PHP-5.6.31-OpenSSL-1.1.0-compatibility-20170801.patch + +Upstream-Status: Deny [https://github.com/php/php-src/pull/2667] +Reason: As PHP 5.6 is no longer actively supported only security fixes +may land on this branch. As this change does not fall in this category, +I'm closing this PR. (All higher versions of PHP already have OpenSSL +1.1 support.) + +Author: zsalab@github https://github.com/zsalab + +Only port source modification, do not include the test case +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + ext/openssl/openssl.c | 683 +++++++++++++++++++++++++++++++++++++------------- + ext/openssl/xp_ssl.c | 18 +- + ext/phar/util.c | 13 +- + 3 files changed, 527 insertions(+), 187 deletions(-) + +diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c +index a78a8fb..b53114c 100644 +--- a/ext/openssl/openssl.c ++++ b/ext/openssl/openssl.c +@@ -42,6 +42,12 @@ + + /* OpenSSL includes */ + #include <openssl/evp.h> ++#if OPENSSL_VERSION_NUMBER >= 0x10002000L ++#include <openssl/bn.h> ++#include <openssl/rsa.h> ++#include <openssl/dsa.h> ++#include <openssl/dh.h> ++#endif + #include <openssl/x509.h> + #include <openssl/x509v3.h> + #include <openssl/crypto.h> +@@ -531,6 +537,133 @@ zend_module_entry openssl_module_entry = { + ZEND_GET_MODULE(openssl) + #endif + ++/* {{{ OpenSSL compatibility functions and macros */ ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) ++#define EVP_PKEY_get0_RSA(_pkey) _pkey->pkey.rsa ++#define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh ++#define EVP_PKEY_get0_DSA(_pkey) _pkey->pkey.dsa ++#define EVP_PKEY_get0_EC_KEY(_pkey) _pkey->pkey.ec ++ ++static int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) ++{ ++ r->n = n; ++ r->e = e; ++ r->d = d; ++ ++ return 1; ++} ++ ++static int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) ++{ ++ r->p = p; ++ r->q = q; ++ ++ return 1; ++} ++ ++static int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) ++{ ++ r->dmp1 = dmp1; ++ r->dmq1 = dmq1; ++ r->iqmp = iqmp; ++ ++ return 1; ++} ++ ++static void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) ++{ ++ *n = r->n; ++ *e = r->e; ++ *d = r->d; ++} ++ ++static void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) ++{ ++ *p = r->p; ++ *q = r->q; ++} ++ ++static void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp) ++{ ++ *dmp1 = r->dmp1; ++ *dmq1 = r->dmq1; ++ *iqmp = r->iqmp; ++} ++ ++static void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) ++{ ++ *p = dh->p; ++ *q = dh->q; ++ *g = dh->g; ++} ++ ++static int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) ++{ ++ dh->p = p; ++ dh->q = q; ++ dh->g = g; ++ ++ return 1; ++} ++ ++static void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) ++{ ++ *pub_key = dh->pub_key; ++ *priv_key = dh->priv_key; ++} ++ ++static int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) ++{ ++ dh->pub_key = pub_key; ++ dh->priv_key = priv_key; ++ ++ return 1; ++} ++ ++static void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) ++{ ++ *p = d->p; ++ *q = d->q; ++ *g = d->g; ++} ++ ++int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) ++{ ++ d->p = p; ++ d->q = q; ++ d->g = g; ++ ++ return 1; ++} ++ ++static void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) ++{ ++ *pub_key = d->pub_key; ++ *priv_key = d->priv_key; ++} ++ ++int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) ++{ ++ d->pub_key = pub_key; ++ d->priv_key = priv_key; ++ ++ return 1; ++} ++ ++#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER) ++#define EVP_PKEY_id(_pkey) _pkey->type ++#define EVP_PKEY_base_id(_key) EVP_PKEY_type(_key->type) ++ ++static int X509_get_signature_nid(const X509 *x) ++{ ++ return OBJ_obj2nid(x->sig_alg->algorithm); ++} ++ ++#endif ++ ++#endif ++/* }}} */ ++ + static int le_key; + static int le_x509; + static int le_csr; +@@ -825,7 +958,7 @@ static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */ + } + for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) { + cnf = sk_CONF_VALUE_value(sktmp, i); +- if (OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) { ++ if (OBJ_sn2nid(cnf->name) == NID_undef && OBJ_ln2nid(cnf->name) == NID_undef && OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value); + return FAILURE; + } +@@ -967,7 +1100,7 @@ static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC) + } + /* }}} */ + +-#ifdef PHP_WIN32 ++#if defined(PHP_WIN32) || (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) + #define PHP_OPENSSL_RAND_ADD_TIME() ((void) 0) + #else + #define PHP_OPENSSL_RAND_ADD_TIME() php_openssl_rand_add_timeval() +@@ -1053,9 +1186,11 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(long algo) { /* {{{ */ + mdtype = (EVP_MD *) EVP_md2(); + break; + #endif ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) + case OPENSSL_ALGO_DSS1: + mdtype = (EVP_MD *) EVP_dss1(); + break; ++#endif + #if OPENSSL_VERSION_NUMBER >= 0x0090708fL + case OPENSSL_ALGO_SHA224: + mdtype = (EVP_MD *) EVP_sha224(); +@@ -1146,6 +1281,12 @@ PHP_MINIT_FUNCTION(openssl) + OpenSSL_add_all_digests(); + OpenSSL_add_all_algorithms(); + ++#if !defined(OPENSSL_NO_AES) && defined(EVP_CIPH_CCM_MODE) && OPENSSL_VERSION_NUMBER < 0x100020000 ++ EVP_add_cipher(EVP_aes_128_ccm()); ++ EVP_add_cipher(EVP_aes_192_ccm()); ++ EVP_add_cipher(EVP_aes_256_ccm()); ++#endif ++ + SSL_load_error_strings(); + + /* register a resource id number with OpenSSL so that we can map SSL -> stream structures in +@@ -1173,7 +1314,9 @@ PHP_MINIT_FUNCTION(openssl) + #ifdef HAVE_OPENSSL_MD2_H + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT); + #endif ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT); ++#endif + #if OPENSSL_VERSION_NUMBER >= 0x0090708fL + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA256", OPENSSL_ALGO_SHA256, CONST_CS|CONST_PERSISTENT); +@@ -1251,7 +1394,9 @@ PHP_MINIT_FUNCTION(openssl) + } + + php_stream_xport_register("ssl", php_openssl_ssl_socket_factory TSRMLS_CC); ++#ifndef OPENSSL_NO_SSL3 + php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory TSRMLS_CC); ++#endif + #ifndef OPENSSL_NO_SSL2 + php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory TSRMLS_CC); + #endif +@@ -1308,7 +1453,9 @@ PHP_MSHUTDOWN_FUNCTION(openssl) + #ifndef OPENSSL_NO_SSL2 + php_stream_xport_unregister("sslv2" TSRMLS_CC); + #endif ++#ifndef OPENSSL_NO_SSL3 + php_stream_xport_unregister("sslv3" TSRMLS_CC); ++#endif + php_stream_xport_unregister("tls" TSRMLS_CC); + php_stream_xport_unregister("tlsv1.0" TSRMLS_CC); + #if OPENSSL_VERSION_NUMBER >= 0x10001001L +@@ -1893,6 +2040,7 @@ static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension) + { + GENERAL_NAMES *names; + const X509V3_EXT_METHOD *method = NULL; ++ ASN1_OCTET_STRING *extension_data; + long i, length, num; + const unsigned char *p; + +@@ -1901,8 +2049,9 @@ static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension) + return -1; + } + +- p = extension->value->data; +- length = extension->value->length; ++ extension_data = X509_EXTENSION_get_data(extension); ++ p = extension_data->data; ++ length = extension_data->length; + if (method->it) { + names = (GENERAL_NAMES*)(ASN1_item_d2i(NULL, &p, length, + ASN1_ITEM_ptr(method->it))); +@@ -1965,6 +2114,8 @@ PHP_FUNCTION(openssl_x509_parse) + char * tmpstr; + zval * subitem; + X509_EXTENSION *extension; ++ X509_NAME *subject_name; ++ char *cert_name; + char *extname; + BIO *bio_out; + BUF_MEM *bio_buf; +@@ -1979,10 +2130,10 @@ PHP_FUNCTION(openssl_x509_parse) + } + array_init(return_value); + +- if (cert->name) { +- add_assoc_string(return_value, "name", cert->name, 1); +- } +-/* add_assoc_bool(return_value, "valid", cert->valid); */ ++ subject_name = X509_get_subject_name(cert); ++ cert_name = X509_NAME_oneline(subject_name, NULL, 0); ++ add_assoc_string(return_value, "name", cert_name, 1); ++ OPENSSL_free(cert_name); + + add_assoc_name_entry(return_value, "subject", X509_get_subject_name(cert), useshortnames TSRMLS_CC); + /* hash as used in CA directories to lookup cert by subject name */ +@@ -2008,7 +2159,7 @@ PHP_FUNCTION(openssl_x509_parse) + add_assoc_string(return_value, "alias", tmpstr, 1); + } + +- sig_nid = OBJ_obj2nid((cert)->sig_alg->algorithm); ++ sig_nid = X509_get_signature_nid(cert); + add_assoc_string(return_value, "signatureTypeSN", (char*)OBJ_nid2sn(sig_nid), 1); + add_assoc_string(return_value, "signatureTypeLN", (char*)OBJ_nid2ln(sig_nid), 1); + add_assoc_long(return_value, "signatureTypeNID", sig_nid); +@@ -3217,7 +3368,21 @@ PHP_FUNCTION(openssl_csr_get_public_key) + RETURN_FALSE; + } + +- tpubkey=X509_REQ_get_pubkey(csr); ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) ++ /* Due to changes in OpenSSL 1.1 related to locking when decoding CSR, ++ * the pub key is not changed after assigning. It means if we pass ++ * a private key, it will be returned including the private part. ++ * If we duplicate it, then we get just the public part which is ++ * the same behavior as for OpenSSL 1.0 */ ++ csr = X509_REQ_dup(csr); ++#endif ++ /* Retrieve the public key from the CSR */ ++ tpubkey = X509_REQ_get_pubkey(csr); ++ ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) ++ /* We need to free the CSR as it was duplicated */ ++ X509_REQ_free(csr); ++#endif + RETVAL_RESOURCE(zend_list_insert(tpubkey, le_key TSRMLS_CC)); + return; + } +@@ -3482,13 +3647,20 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) + { + assert(pkey != NULL); + +- switch (pkey->type) { ++ switch (EVP_PKEY_id(pkey)) { + #ifndef NO_RSA + case EVP_PKEY_RSA: + case EVP_PKEY_RSA2: +- assert(pkey->pkey.rsa != NULL); +- if (pkey->pkey.rsa != NULL && (NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q)) { +- return 0; ++ { ++ RSA *rsa = EVP_PKEY_get0_RSA(pkey); ++ if (rsa != NULL) { ++ const BIGNUM *p, *q; ++ ++ RSA_get0_factors(rsa, &p, &q); ++ if (p == NULL || q == NULL) { ++ return 0; ++ } ++ } + } + break; + #endif +@@ -3498,28 +3670,51 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) + case EVP_PKEY_DSA2: + case EVP_PKEY_DSA3: + case EVP_PKEY_DSA4: +- assert(pkey->pkey.dsa != NULL); +- +- if (NULL == pkey->pkey.dsa->p || NULL == pkey->pkey.dsa->q || NULL == pkey->pkey.dsa->priv_key){ +- return 0; ++ { ++ DSA *dsa = EVP_PKEY_get0_DSA(pkey); ++ if (dsa != NULL) { ++ const BIGNUM *p, *q, *g, *pub_key, *priv_key; ++ ++ DSA_get0_pqg(dsa, &p, &q, &g); ++ if (p == NULL || q == NULL) { ++ return 0; ++ } ++ ++ DSA_get0_key(dsa, &pub_key, &priv_key); ++ if (priv_key == NULL) { ++ return 0; ++ } ++ } + } + break; + #endif + #ifndef NO_DH + case EVP_PKEY_DH: +- assert(pkey->pkey.dh != NULL); +- +- if (NULL == pkey->pkey.dh->p || NULL == pkey->pkey.dh->priv_key) { +- return 0; ++ { ++ DH *dh = EVP_PKEY_get0_DH(pkey); ++ if (dh != NULL) { ++ const BIGNUM *p, *q, *g, *pub_key, *priv_key; ++ ++ DH_get0_pqg(dh, &p, &q, &g); ++ if (p == NULL) { ++ return 0; ++ } ++ ++ DH_get0_key(dh, &pub_key, &priv_key); ++ if (priv_key == NULL) { ++ return 0; ++ } ++ } + } + break; + #endif + #ifdef HAVE_EVP_PKEY_EC + case EVP_PKEY_EC: +- assert(pkey->pkey.ec != NULL); +- +- if ( NULL == EC_KEY_get0_private_key(pkey->pkey.ec)) { +- return 0; ++ { ++ EC_KEY *ec = EVP_PKEY_get0_EC_KEY(pkey); ++ if (ec != NULL && NULL == EC_KEY_get0_private_key(ec)) { ++ return 0; ++ } + } + break; + #endif +@@ -3531,34 +3726,80 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) + } + /* }}} */ + +-#define OPENSSL_PKEY_GET_BN(_type, _name) do { \ +- if (pkey->pkey._type->_name != NULL) { \ +- int len = BN_num_bytes(pkey->pkey._type->_name); \ +- char *str = emalloc(len + 1); \ +- BN_bn2bin(pkey->pkey._type->_name, (unsigned char*)str); \ +- str[len] = 0; \ +- add_assoc_stringl(_type, #_name, str, len, 0); \ +- } \ +- } while (0) +- +-#define OPENSSL_PKEY_SET_BN(_ht, _type, _name) do { \ +- zval **bn; \ +- if (zend_hash_find(_ht, #_name, sizeof(#_name), (void**)&bn) == SUCCESS && \ +- Z_TYPE_PP(bn) == IS_STRING) { \ +- _type->_name = BN_bin2bn( \ +- (unsigned char*)Z_STRVAL_PP(bn), \ +- Z_STRLEN_PP(bn), NULL); \ +- } \ ++#define OPENSSL_GET_BN(_array, _bn, _name) do { \ ++ if (_bn != NULL) { \ ++ int len = BN_num_bytes(_bn); \ ++ char *str = emalloc(len + 1); \ ++ BN_bn2bin(_bn, (unsigned char*)str); \ ++ str[len] = 0; \ ++ add_assoc_stringl(_array, #_name, str, len, 0); \ ++ } \ + } while (0); + ++#define OPENSSL_PKEY_GET_BN(_type, _name) OPENSSL_GET_BN(_type, _name, _name) ++ ++#define OPENSSL_PKEY_SET_BN(_data, _name) do { \ ++ zval **bn; \ ++ if (zend_hash_find(Z_ARRVAL_P(_data), #_name, sizeof(#_name),(void**)&bn) == SUCCESS && \ ++ Z_TYPE_PP(bn) == IS_STRING) { \ ++ _name = BN_bin2bn( \ ++ (unsigned char*)Z_STRVAL_PP(bn), \ ++ Z_STRLEN_PP(bn), NULL); \ ++ } else { \ ++ _name = NULL; \ ++ } \ ++ } while (0); ++ ++/* {{{ php_openssl_pkey_init_rsa */ ++zend_bool php_openssl_pkey_init_and_assign_rsa(EVP_PKEY *pkey, RSA *rsa, zval *data) ++{ ++ BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp; ++ ++ OPENSSL_PKEY_SET_BN(data, n); ++ OPENSSL_PKEY_SET_BN(data, e); ++ OPENSSL_PKEY_SET_BN(data, d); ++ if (!n || !d || !RSA_set0_key(rsa, n, e, d)) { ++ return 0; ++ } ++ ++ OPENSSL_PKEY_SET_BN(data, p); ++ OPENSSL_PKEY_SET_BN(data, q); ++ if ((p || q) && !RSA_set0_factors(rsa, p, q)) { ++ return 0; ++ } ++ ++ OPENSSL_PKEY_SET_BN(data, dmp1); ++ OPENSSL_PKEY_SET_BN(data, dmq1); ++ OPENSSL_PKEY_SET_BN(data, iqmp); ++ if ((dmp1 || dmq1 || iqmp) && !RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp)) { ++ return 0; ++ } ++ ++ if (!EVP_PKEY_assign_RSA(pkey, rsa)) { ++ return 0; ++ } ++ ++ return 1; ++} ++/* }}} */ ++ + /* {{{ php_openssl_pkey_init_dsa */ +-zend_bool php_openssl_pkey_init_dsa(DSA *dsa) ++zend_bool php_openssl_pkey_init_dsa(DSA *dsa, zval *data) + { +- if (!dsa->p || !dsa->q || !dsa->g) { ++ BIGNUM *p, *q, *g, *priv_key, *pub_key; ++ const BIGNUM *priv_key_const, *pub_key_const; ++ ++ OPENSSL_PKEY_SET_BN(data, p); ++ OPENSSL_PKEY_SET_BN(data, q); ++ OPENSSL_PKEY_SET_BN(data, g); ++ if (!p || !q || !g || !DSA_set0_pqg(dsa, p, q, g)) { + return 0; + } +- if (dsa->priv_key || dsa->pub_key) { +- return 1; ++ ++ OPENSSL_PKEY_SET_BN(data, pub_key); ++ OPENSSL_PKEY_SET_BN(data, priv_key); ++ if (pub_key) { ++ return DSA_set0_key(dsa, pub_key, priv_key); + } + PHP_OPENSSL_RAND_ADD_TIME(); + if (!DSA_generate_key(dsa)) { +@@ -3566,7 +3807,8 @@ zend_bool php_openssl_pkey_init_dsa(DSA *dsa) + } + /* if BN_mod_exp return -1, then DSA_generate_key succeed for failed key + * so we need to double check that public key is created */ +- if (!dsa->pub_key || BN_is_zero(dsa->pub_key)) { ++ DSA_get0_key(dsa, &pub_key_const, &priv_key_const); ++ if (!pub_key_const || BN_is_zero(pub_key_const)) { + return 0; + } + /* all good */ +@@ -3574,14 +3816,66 @@ zend_bool php_openssl_pkey_init_dsa(DSA *dsa) + } + /* }}} */ + ++/* {{{ php_openssl_dh_pub_from_priv */ ++static BIGNUM *php_openssl_dh_pub_from_priv(BIGNUM *priv_key, BIGNUM *g, BIGNUM *p) ++{ ++ BIGNUM *pub_key, *priv_key_const_time; ++ BN_CTX *ctx; ++ ++ pub_key = BN_new(); ++ if (pub_key == NULL) { ++ return NULL; ++ } ++ ++ priv_key_const_time = BN_new(); ++ if (priv_key_const_time == NULL) { ++ BN_free(pub_key); ++ return NULL; ++ } ++ ctx = BN_CTX_new(); ++ if (ctx == NULL) { ++ BN_free(pub_key); ++ BN_free(priv_key_const_time); ++ return NULL; ++ } ++ ++ BN_with_flags(priv_key_const_time, priv_key, BN_FLG_CONSTTIME); ++ ++ if (!BN_mod_exp_mont(pub_key, g, priv_key_const_time, p, ctx, NULL)) { ++ BN_free(pub_key); ++ pub_key = NULL; ++ } ++ ++ BN_free(priv_key_const_time); ++ BN_CTX_free(ctx); ++ ++ return pub_key; ++} ++/* }}} */ ++ + /* {{{ php_openssl_pkey_init_dh */ +-zend_bool php_openssl_pkey_init_dh(DH *dh) ++zend_bool php_openssl_pkey_init_dh(DH *dh, zval *data) + { +- if (!dh->p || !dh->g) { ++ BIGNUM *p, *q, *g, *priv_key, *pub_key; ++ ++ OPENSSL_PKEY_SET_BN(data, p); ++ OPENSSL_PKEY_SET_BN(data, q); ++ OPENSSL_PKEY_SET_BN(data, g); ++ if (!p || !g || !DH_set0_pqg(dh, p, q, g)) { + return 0; + } +- if (dh->pub_key) { +- return 1; ++ ++ OPENSSL_PKEY_SET_BN(data, priv_key); ++ OPENSSL_PKEY_SET_BN(data, pub_key); ++ if (pub_key) { ++ return DH_set0_key(dh, pub_key, priv_key); ++ } ++ if (priv_key) { ++ pub_key = php_openssl_dh_pub_from_priv(priv_key, g, p); ++ if (pub_key == NULL) { ++ return 0; ++ } ++ return DH_set0_key(dh, pub_key, priv_key); + } + PHP_OPENSSL_RAND_ADD_TIME(); + if (!DH_generate_key(dh)) { +@@ -3614,18 +3908,8 @@ PHP_FUNCTION(openssl_pkey_new) + if (pkey) { + RSA *rsa = RSA_new(); + if (rsa) { +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, n); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, e); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, d); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, p); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, q); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, dmp1); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, dmq1); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, iqmp); +- if (rsa->n && rsa->d) { +- if (EVP_PKEY_assign_RSA(pkey, rsa)) { +- RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC)); +- } ++ if (php_openssl_pkey_init_and_assign_rsa(pkey, rsa, *data)) { ++ RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC)); + } + RSA_free(rsa); + } +@@ -3638,12 +3922,7 @@ PHP_FUNCTION(openssl_pkey_new) + if (pkey) { + DSA *dsa = DSA_new(); + if (dsa) { +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, p); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, q); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, g); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, priv_key); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dsa, pub_key); +- if (php_openssl_pkey_init_dsa(dsa)) { ++ if (php_openssl_pkey_init_dsa(dsa, *data)) { + if (EVP_PKEY_assign_DSA(pkey, dsa)) { + RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC)); + } +@@ -3659,11 +3938,7 @@ PHP_FUNCTION(openssl_pkey_new) + if (pkey) { + DH *dh = DH_new(); + if (dh) { +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dh, p); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dh, g); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dh, priv_key); +- OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), dh, pub_key); +- if (php_openssl_pkey_init_dh(dh)) { ++ if (php_openssl_pkey_init_dh(dh, *data)) { + if (EVP_PKEY_assign_DH(pkey, dh)) { + RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC)); + } +@@ -3738,10 +4013,10 @@ PHP_FUNCTION(openssl_pkey_export_to_file) + cipher = NULL; + } + +- switch (EVP_PKEY_type(key->type)) { ++ switch (EVP_PKEY_base_id(key)) { + #ifdef HAVE_EVP_PKEY_EC + case EVP_PKEY_EC: +- pem_write = PEM_write_bio_ECPrivateKey(bio_out, EVP_PKEY_get1_EC_KEY(key), cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL); ++ pem_write = PEM_write_bio_ECPrivateKey(bio_out, EVP_PKEY_get0_EC_KEY(key), cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL); + break; + #endif + default: +@@ -3807,7 +4082,7 @@ PHP_FUNCTION(openssl_pkey_export) + cipher = NULL; + } + +- switch (EVP_PKEY_type(key->type)) { ++ switch (EVP_PKEY_base_id(key)) { + #ifdef HAVE_EVP_PKEY_EC + case EVP_PKEY_EC: + pem_write = PEM_write_bio_ECPrivateKey(bio_out, EVP_PKEY_get1_EC_KEY(key), cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL); +@@ -3928,25 +4203,33 @@ PHP_FUNCTION(openssl_pkey_get_details) + /*TODO: Use the real values once the openssl constants are used + * See the enum at the top of this file + */ +- switch (EVP_PKEY_type(pkey->type)) { ++ switch (EVP_PKEY_base_id(pkey)) { + case EVP_PKEY_RSA: + case EVP_PKEY_RSA2: +- ktype = OPENSSL_KEYTYPE_RSA; +- +- if (pkey->pkey.rsa != NULL) { +- zval *rsa; +- +- ALLOC_INIT_ZVAL(rsa); +- array_init(rsa); +- OPENSSL_PKEY_GET_BN(rsa, n); +- OPENSSL_PKEY_GET_BN(rsa, e); +- OPENSSL_PKEY_GET_BN(rsa, d); +- OPENSSL_PKEY_GET_BN(rsa, p); +- OPENSSL_PKEY_GET_BN(rsa, q); +- OPENSSL_PKEY_GET_BN(rsa, dmp1); +- OPENSSL_PKEY_GET_BN(rsa, dmq1); +- OPENSSL_PKEY_GET_BN(rsa, iqmp); +- add_assoc_zval(return_value, "rsa", rsa); ++ { ++ RSA *rsa = EVP_PKEY_get0_RSA(pkey); ++ ktype = OPENSSL_KEYTYPE_RSA; ++ ++ if (rsa != NULL) { ++ zval *z_rsa; ++ const BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp; ++ ++ RSA_get0_key(rsa, &n, &e, &d); ++ RSA_get0_factors(rsa, &p, &q); ++ RSA_get0_crt_params(rsa, &dmp1, &dmq1, &iqmp); ++ ++ ALLOC_INIT_ZVAL(z_rsa); ++ array_init(z_rsa); ++ OPENSSL_PKEY_GET_BN(z_rsa, n); ++ OPENSSL_PKEY_GET_BN(z_rsa, e); ++ OPENSSL_PKEY_GET_BN(z_rsa, d); ++ OPENSSL_PKEY_GET_BN(z_rsa, p); ++ OPENSSL_PKEY_GET_BN(z_rsa, q); ++ OPENSSL_PKEY_GET_BN(z_rsa, dmp1); ++ OPENSSL_PKEY_GET_BN(z_rsa, dmq1); ++ OPENSSL_PKEY_GET_BN(z_rsa, iqmp); ++ add_assoc_zval(return_value, "rsa", z_rsa); ++ } + } + + break; +@@ -3954,42 +4237,55 @@ PHP_FUNCTION(openssl_pkey_get_details) + case EVP_PKEY_DSA2: + case EVP_PKEY_DSA3: + case EVP_PKEY_DSA4: +- ktype = OPENSSL_KEYTYPE_DSA; +- +- if (pkey->pkey.dsa != NULL) { +- zval *dsa; +- +- ALLOC_INIT_ZVAL(dsa); +- array_init(dsa); +- OPENSSL_PKEY_GET_BN(dsa, p); +- OPENSSL_PKEY_GET_BN(dsa, q); +- OPENSSL_PKEY_GET_BN(dsa, g); +- OPENSSL_PKEY_GET_BN(dsa, priv_key); +- OPENSSL_PKEY_GET_BN(dsa, pub_key); +- add_assoc_zval(return_value, "dsa", dsa); ++ { ++ DSA *dsa = EVP_PKEY_get0_DSA(pkey); ++ ktype = OPENSSL_KEYTYPE_DSA; ++ ++ if (dsa != NULL) { ++ zval *z_dsa; ++ const BIGNUM *p, *q, *g, *priv_key, *pub_key; ++ ++ DSA_get0_pqg(dsa, &p, &q, &g); ++ DSA_get0_key(dsa, &pub_key, &priv_key); ++ ++ ALLOC_INIT_ZVAL(z_dsa); ++ array_init(z_dsa); ++ OPENSSL_PKEY_GET_BN(z_dsa, p); ++ OPENSSL_PKEY_GET_BN(z_dsa, q); ++ OPENSSL_PKEY_GET_BN(z_dsa, g); ++ OPENSSL_PKEY_GET_BN(z_dsa, priv_key); ++ OPENSSL_PKEY_GET_BN(z_dsa, pub_key); ++ add_assoc_zval(return_value, "dsa", z_dsa); ++ } + } + break; + case EVP_PKEY_DH: +- +- ktype = OPENSSL_KEYTYPE_DH; +- +- if (pkey->pkey.dh != NULL) { +- zval *dh; +- +- ALLOC_INIT_ZVAL(dh); +- array_init(dh); +- OPENSSL_PKEY_GET_BN(dh, p); +- OPENSSL_PKEY_GET_BN(dh, g); +- OPENSSL_PKEY_GET_BN(dh, priv_key); +- OPENSSL_PKEY_GET_BN(dh, pub_key); +- add_assoc_zval(return_value, "dh", dh); ++ { ++ DH *dh = EVP_PKEY_get0_DH(pkey); ++ ktype = OPENSSL_KEYTYPE_DH; ++ ++ if (dh != NULL) { ++ zval *z_dh; ++ const BIGNUM *p, *q, *g, *priv_key, *pub_key; ++ ++ DH_get0_pqg(dh, &p, &q, &g); ++ DH_get0_key(dh, &pub_key, &priv_key); ++ ++ ALLOC_INIT_ZVAL(z_dh); ++ array_init(z_dh); ++ OPENSSL_PKEY_GET_BN(z_dh, p); ++ OPENSSL_PKEY_GET_BN(z_dh, g); ++ OPENSSL_PKEY_GET_BN(z_dh, priv_key); ++ OPENSSL_PKEY_GET_BN(z_dh, pub_key); ++ add_assoc_zval(return_value, "dh", z_dh); ++ } + } + + break; + #ifdef HAVE_EVP_PKEY_EC + case EVP_PKEY_EC: + ktype = OPENSSL_KEYTYPE_EC; +- if (pkey->pkey.ec != NULL) { ++ if (EVP_PKEY_get0_EC_KEY(pkey) != NULL) { + zval *ec; + const EC_GROUP *ec_group; + int nid; +@@ -4546,13 +4842,13 @@ PHP_FUNCTION(openssl_private_encrypt) + cryptedlen = EVP_PKEY_size(pkey); + cryptedbuf = emalloc(cryptedlen + 1); + +- switch (pkey->type) { ++ switch (EVP_PKEY_id(pkey)) { + case EVP_PKEY_RSA: + case EVP_PKEY_RSA2: + successful = (RSA_private_encrypt(data_len, + (unsigned char *)data, + cryptedbuf, +- pkey->pkey.rsa, ++ EVP_PKEY_get0_RSA(pkey), + padding) == cryptedlen); + break; + default: +@@ -4604,13 +4900,13 @@ PHP_FUNCTION(openssl_private_decrypt) + cryptedlen = EVP_PKEY_size(pkey); + crypttemp = emalloc(cryptedlen + 1); + +- switch (pkey->type) { ++ switch (EVP_PKEY_id(pkey)) { + case EVP_PKEY_RSA: + case EVP_PKEY_RSA2: + cryptedlen = RSA_private_decrypt(data_len, + (unsigned char *)data, + crypttemp, +- pkey->pkey.rsa, ++ EVP_PKEY_get0_RSA(pkey), + padding); + if (cryptedlen != -1) { + cryptedbuf = emalloc(cryptedlen + 1); +@@ -4669,13 +4965,13 @@ PHP_FUNCTION(openssl_public_encrypt) + cryptedlen = EVP_PKEY_size(pkey); + cryptedbuf = emalloc(cryptedlen + 1); + +- switch (pkey->type) { ++ switch (EVP_PKEY_id(pkey)) { + case EVP_PKEY_RSA: + case EVP_PKEY_RSA2: + successful = (RSA_public_encrypt(data_len, + (unsigned char *)data, + cryptedbuf, +- pkey->pkey.rsa, ++ EVP_PKEY_get0_RSA(pkey), + padding) == cryptedlen); + break; + default: +@@ -4728,13 +5024,13 @@ PHP_FUNCTION(openssl_public_decrypt) + cryptedlen = EVP_PKEY_size(pkey); + crypttemp = emalloc(cryptedlen + 1); + +- switch (pkey->type) { ++ switch (EVP_PKEY_id(pkey)) { + case EVP_PKEY_RSA: + case EVP_PKEY_RSA2: + cryptedlen = RSA_public_decrypt(data_len, + (unsigned char *)data, + crypttemp, +- pkey->pkey.rsa, ++ EVP_PKEY_get0_RSA(pkey), + padding); + if (cryptedlen != -1) { + cryptedbuf = emalloc(cryptedlen + 1); +@@ -4798,7 +5094,7 @@ PHP_FUNCTION(openssl_sign) + long keyresource = -1; + char * data; + int data_len; +- EVP_MD_CTX md_ctx; ++ EVP_MD_CTX *md_ctx; + zval *method = NULL; + long signature_algo = OPENSSL_ALGO_SHA1; + const EVP_MD *mdtype; +@@ -4831,9 +5127,10 @@ PHP_FUNCTION(openssl_sign) + siglen = EVP_PKEY_size(pkey); + sigbuf = emalloc(siglen + 1); + +- EVP_SignInit(&md_ctx, mdtype); +- EVP_SignUpdate(&md_ctx, data, data_len); +- if (EVP_SignFinal (&md_ctx, sigbuf,(unsigned int *)&siglen, pkey)) { ++ md_ctx = EVP_MD_CTX_create(); ++ EVP_SignInit(md_ctx, mdtype); ++ EVP_SignUpdate(md_ctx, data, data_len); ++ if (EVP_SignFinal (md_ctx, sigbuf,(unsigned int *)&siglen, pkey)) { + zval_dtor(signature); + sigbuf[siglen] = '\0'; + ZVAL_STRINGL(signature, (char *)sigbuf, siglen, 0); +@@ -4842,7 +5139,7 @@ PHP_FUNCTION(openssl_sign) + efree(sigbuf); + RETVAL_FALSE; + } +- EVP_MD_CTX_cleanup(&md_ctx); ++ EVP_MD_CTX_destroy(md_ctx); + if (keyresource == -1) { + EVP_PKEY_free(pkey); + } +@@ -4856,7 +5153,7 @@ PHP_FUNCTION(openssl_verify) + zval **key; + EVP_PKEY *pkey; + int err; +- EVP_MD_CTX md_ctx; ++ EVP_MD_CTX *md_ctx; + const EVP_MD *mdtype; + long keyresource = -1; + char * data; int data_len; +@@ -4890,10 +5187,11 @@ PHP_FUNCTION(openssl_verify) + RETURN_FALSE; + } + +- EVP_VerifyInit (&md_ctx, mdtype); +- EVP_VerifyUpdate (&md_ctx, data, data_len); +- err = EVP_VerifyFinal (&md_ctx, (unsigned char *)signature, signature_len, pkey); +- EVP_MD_CTX_cleanup(&md_ctx); ++ md_ctx = EVP_MD_CTX_create(); ++ EVP_VerifyInit (md_ctx, mdtype); ++ EVP_VerifyUpdate (md_ctx, data, data_len); ++ err = EVP_VerifyFinal (md_ctx, (unsigned char *)signature, signature_len, pkey); ++ EVP_MD_CTX_destroy(md_ctx); + + if (keyresource == -1) { + EVP_PKEY_free(pkey); +@@ -4917,7 +5215,7 @@ PHP_FUNCTION(openssl_seal) + char *method =NULL; + int method_len = 0; + const EVP_CIPHER *cipher; +- EVP_CIPHER_CTX ctx; ++ EVP_CIPHER_CTX *ctx; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szza/|s", &data, &data_len, &sealdata, &ekeys, &pubkeys, &method, &method_len) == FAILURE) { + return; +@@ -4950,6 +5248,7 @@ PHP_FUNCTION(openssl_seal) + memset(eks, 0, sizeof(*eks) * nkeys); + key_resources = safe_emalloc(nkeys, sizeof(long), 0); + memset(key_resources, 0, sizeof(*key_resources) * nkeys); ++ memset(pkeys, 0, sizeof(*pkeys) * nkeys); + + /* get the public keys we are using to seal this data */ + zend_hash_internal_pointer_reset_ex(pubkeysht, &pos); +@@ -4967,27 +5266,28 @@ PHP_FUNCTION(openssl_seal) + i++; + } + +- if (!EVP_EncryptInit(&ctx,cipher,NULL,NULL)) { ++ ctx = EVP_CIPHER_CTX_new(); ++ if (ctx == NULL || !EVP_EncryptInit(ctx,cipher,NULL,NULL)) { + RETVAL_FALSE; +- EVP_CIPHER_CTX_cleanup(&ctx); ++ EVP_CIPHER_CTX_free(ctx); + goto clean_exit; + } + + #if 0 + /* Need this if allow ciphers that require initialization vector */ +- ivlen = EVP_CIPHER_CTX_iv_length(&ctx); ++ ivlen = EVP_CIPHER_CTX_iv_length(ctx); + iv = ivlen ? emalloc(ivlen + 1) : NULL; + #endif + /* allocate one byte extra to make room for \0 */ +- buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx)); +- EVP_CIPHER_CTX_cleanup(&ctx); ++ buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(ctx)); ++ EVP_CIPHER_CTX_cleanup(ctx); + +- if (EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) <= 0 || +- !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len) || +- !EVP_SealFinal(&ctx, buf + len1, &len2)) { ++ if (EVP_SealInit(ctx, cipher, eks, eksl, NULL, pkeys, nkeys) <= 0 || ++ !EVP_SealUpdate(ctx, buf, &len1, (unsigned char *)data, data_len) || ++ !EVP_SealFinal(ctx, buf + len1, &len2)) { + RETVAL_FALSE; + efree(buf); +- EVP_CIPHER_CTX_cleanup(&ctx); ++ EVP_CIPHER_CTX_free(ctx); + goto clean_exit; + } + +@@ -5018,7 +5318,7 @@ PHP_FUNCTION(openssl_seal) + efree(buf); + } + RETVAL_LONG(len1 + len2); +- EVP_CIPHER_CTX_cleanup(&ctx); ++ EVP_CIPHER_CTX_free(ctx); + + clean_exit: + for (i=0; i<nkeys; i++) { +@@ -5045,7 +5345,7 @@ PHP_FUNCTION(openssl_open) + int len1, len2; + unsigned char *buf; + long keyresource = -1; +- EVP_CIPHER_CTX ctx; ++ EVP_CIPHER_CTX *ctx; + char * data; int data_len; + char * ekey; int ekey_len; + char *method =NULL; +@@ -5074,8 +5374,9 @@ PHP_FUNCTION(openssl_open) + + buf = emalloc(data_len + 1); + +- if (EVP_OpenInit(&ctx, cipher, (unsigned char *)ekey, ekey_len, NULL, pkey) && EVP_OpenUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) { +- if (!EVP_OpenFinal(&ctx, buf + len1, &len2) || (len1 + len2 == 0)) { ++ ctx = EVP_CIPHER_CTX_new(); ++ if (EVP_OpenInit(ctx, cipher, (unsigned char *)ekey, ekey_len, NULL, pkey) && EVP_OpenUpdate(ctx, buf, &len1, (unsigned char *)data, data_len)) { ++ if (!EVP_OpenFinal(ctx, buf + len1, &len2) || (len1 + len2 == 0)) { + efree(buf); + RETVAL_FALSE; + } else { +@@ -5091,7 +5392,7 @@ PHP_FUNCTION(openssl_open) + if (keyresource == -1) { + EVP_PKEY_free(pkey); + } +- EVP_CIPHER_CTX_cleanup(&ctx); ++ EVP_CIPHER_CTX_free(ctx); + } + /* }}} */ + +@@ -5151,7 +5452,7 @@ PHP_FUNCTION(openssl_digest) + char *data, *method; + int data_len, method_len; + const EVP_MD *mdtype; +- EVP_MD_CTX md_ctx; ++ EVP_MD_CTX *md_ctx; + int siglen; + unsigned char *sigbuf; + +@@ -5167,9 +5468,10 @@ PHP_FUNCTION(openssl_digest) + siglen = EVP_MD_size(mdtype); + sigbuf = emalloc(siglen + 1); + +- EVP_DigestInit(&md_ctx, mdtype); +- EVP_DigestUpdate(&md_ctx, (unsigned char *)data, data_len); +- if (EVP_DigestFinal (&md_ctx, (unsigned char *)sigbuf, (unsigned int *)&siglen)) { ++ md_ctx = EVP_MD_CTX_create(); ++ EVP_DigestInit(md_ctx, mdtype); ++ EVP_DigestUpdate(md_ctx, (unsigned char *)data, data_len); ++ if (EVP_DigestFinal (md_ctx, (unsigned char *)sigbuf, (unsigned int *)&siglen)) { + if (raw_output) { + sigbuf[siglen] = '\0'; + RETVAL_STRINGL((char *)sigbuf, siglen, 0); +@@ -5185,6 +5487,8 @@ PHP_FUNCTION(openssl_digest) + efree(sigbuf); + RETVAL_FALSE; + } ++ ++ EVP_MD_CTX_destroy(md_ctx); + } + /* }}} */ + +@@ -5230,7 +5534,7 @@ PHP_FUNCTION(openssl_encrypt) + char *data, *method, *password, *iv = ""; + int data_len, method_len, password_len, iv_len = 0, max_iv_len; + const EVP_CIPHER *cipher_type; +- EVP_CIPHER_CTX cipher_ctx; ++ EVP_CIPHER_CTX *cipher_ctx; + int i=0, outlen, keylen; + unsigned char *outbuf, *key; + zend_bool free_iv; +@@ -5262,19 +5566,24 @@ PHP_FUNCTION(openssl_encrypt) + outlen = data_len + EVP_CIPHER_block_size(cipher_type); + outbuf = safe_emalloc(outlen, 1, 1); + +- EVP_EncryptInit(&cipher_ctx, cipher_type, NULL, NULL); ++ cipher_ctx = EVP_CIPHER_CTX_new(); ++ if (!cipher_ctx) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to create cipher context"); ++ RETURN_FALSE; ++ } ++ EVP_EncryptInit(cipher_ctx, cipher_type, NULL, NULL); + if (password_len > keylen) { +- EVP_CIPHER_CTX_set_key_length(&cipher_ctx, password_len); ++ EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len); + } +- EVP_EncryptInit_ex(&cipher_ctx, NULL, NULL, key, (unsigned char *)iv); ++ EVP_EncryptInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)iv); + if (options & OPENSSL_ZERO_PADDING) { +- EVP_CIPHER_CTX_set_padding(&cipher_ctx, 0); ++ EVP_CIPHER_CTX_set_padding(cipher_ctx, 0); + } + if (data_len > 0) { +- EVP_EncryptUpdate(&cipher_ctx, outbuf, &i, (unsigned char *)data, data_len); ++ EVP_EncryptUpdate(cipher_ctx, outbuf, &i, (unsigned char *)data, data_len); + } + outlen = i; +- if (EVP_EncryptFinal(&cipher_ctx, (unsigned char *)outbuf + i, &i)) { ++ if (EVP_EncryptFinal(cipher_ctx, (unsigned char *)outbuf + i, &i)) { + outlen += i; + if (options & OPENSSL_RAW_DATA) { + outbuf[outlen] = '\0'; +@@ -5301,7 +5610,8 @@ PHP_FUNCTION(openssl_encrypt) + if (free_iv) { + efree(iv); + } +- EVP_CIPHER_CTX_cleanup(&cipher_ctx); ++ EVP_CIPHER_CTX_cleanup(cipher_ctx); ++ EVP_CIPHER_CTX_free(cipher_ctx); + } + /* }}} */ + +@@ -5313,7 +5623,7 @@ PHP_FUNCTION(openssl_decrypt) + char *data, *method, *password, *iv = ""; + int data_len, method_len, password_len, iv_len = 0; + const EVP_CIPHER *cipher_type; +- EVP_CIPHER_CTX cipher_ctx; ++ EVP_CIPHER_CTX *cipher_ctx; + int i, outlen, keylen; + unsigned char *outbuf, *key; + int base64_str_len; +@@ -5359,17 +5669,23 @@ PHP_FUNCTION(openssl_decrypt) + outlen = data_len + EVP_CIPHER_block_size(cipher_type); + outbuf = emalloc(outlen + 1); + +- EVP_DecryptInit(&cipher_ctx, cipher_type, NULL, NULL); ++ cipher_ctx = EVP_CIPHER_CTX_new(); ++ if (!cipher_ctx) { ++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to create cipher context"); ++ RETURN_FALSE; ++ } ++ ++ EVP_DecryptInit(cipher_ctx, cipher_type, NULL, NULL); + if (password_len > keylen) { +- EVP_CIPHER_CTX_set_key_length(&cipher_ctx, password_len); ++ EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len); + } +- EVP_DecryptInit_ex(&cipher_ctx, NULL, NULL, key, (unsigned char *)iv); ++ EVP_DecryptInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)iv); + if (options & OPENSSL_ZERO_PADDING) { +- EVP_CIPHER_CTX_set_padding(&cipher_ctx, 0); ++ EVP_CIPHER_CTX_set_padding(cipher_ctx, 0); + } +- EVP_DecryptUpdate(&cipher_ctx, outbuf, &i, (unsigned char *)data, data_len); ++ EVP_DecryptUpdate(cipher_ctx, outbuf, &i, (unsigned char *)data, data_len); + outlen = i; +- if (EVP_DecryptFinal(&cipher_ctx, (unsigned char *)outbuf + i, &i)) { ++ if (EVP_DecryptFinal(cipher_ctx, (unsigned char *)outbuf + i, &i)) { + outlen += i; + outbuf[outlen] = '\0'; + RETVAL_STRINGL((char *)outbuf, outlen, 0); +@@ -5386,7 +5702,8 @@ PHP_FUNCTION(openssl_decrypt) + if (base64_str) { + efree(base64_str); + } +- EVP_CIPHER_CTX_cleanup(&cipher_ctx); ++ EVP_CIPHER_CTX_cleanup(cipher_ctx); ++ EVP_CIPHER_CTX_free(cipher_ctx); + } + /* }}} */ + +@@ -5424,6 +5741,7 @@ PHP_FUNCTION(openssl_dh_compute_key) + zval *key; + char *pub_str; + int pub_len; ++ DH *dh; + EVP_PKEY *pkey; + BIGNUM *pub; + char *data; +@@ -5433,14 +5751,21 @@ PHP_FUNCTION(openssl_dh_compute_key) + return; + } + ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, &key, -1, "OpenSSL key", le_key); +- if (!pkey || EVP_PKEY_type(pkey->type) != EVP_PKEY_DH || !pkey->pkey.dh) { ++ if (pkey == NULL) { ++ RETURN_FALSE; ++ } ++ if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DH) { ++ RETURN_FALSE; ++ } ++ dh = EVP_PKEY_get0_DH(pkey); ++ if (dh == NULL) { + RETURN_FALSE; + } + + pub = BN_bin2bn((unsigned char*)pub_str, pub_len, NULL); + +- data = emalloc(DH_size(pkey->pkey.dh) + 1); +- len = DH_compute_key((unsigned char*)data, pub, pkey->pkey.dh); ++ data = emalloc(DH_size(dh) + 1); ++ len = DH_compute_key((unsigned char*)data, pub, dh); + + if (len >= 0) { + data[len] = 0; +diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c +index d549033..c2d477c 100644 +--- a/ext/openssl/xp_ssl.c ++++ b/ext/openssl/xp_ssl.c +@@ -935,7 +935,7 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */ + static const SSL_METHOD *php_select_crypto_method(long method_value, int is_client TSRMLS_DC) /* {{{ */ + { + if (method_value == STREAM_CRYPTO_METHOD_SSLv2) { +-#ifndef OPENSSL_NO_SSL2 ++#if !defined(OPENSSL_NO_SSL2) && OPENSSL_VERSION_NUMBER < 0x10100000L + return is_client ? SSLv2_client_method() : SSLv2_server_method(); + #else + php_error_docref(NULL TSRMLS_CC, E_WARNING, +@@ -1588,12 +1588,26 @@ int php_openssl_setup_crypto(php_stream *stream, + } + /* }}} */ + ++#define PHP_SSL_MAX_VERSION_LEN 32 ++ ++static char *php_ssl_cipher_get_version(const SSL_CIPHER *c, char *buffer, size_t max_len) /* {{{ */ ++{ ++ const char *version = SSL_CIPHER_get_version(c); ++ strncpy(buffer, version, max_len); ++ if (max_len <= strlen(version)) { ++ buffer[max_len - 1] = 0; ++ } ++ return buffer; ++} ++/* }}} */ ++ + static zval *capture_session_meta(SSL *ssl_handle) /* {{{ */ + { + zval *meta_arr; + char *proto_str; + long proto = SSL_version(ssl_handle); + const SSL_CIPHER *cipher = SSL_get_current_cipher(ssl_handle); ++ char version_str[PHP_SSL_MAX_VERSION_LEN]; + + switch (proto) { + #if OPENSSL_VERSION_NUMBER >= 0x10001001L +@@ -1611,7 +1625,7 @@ static zval *capture_session_meta(SSL *ssl_handle) /* {{{ */ + add_assoc_string(meta_arr, "protocol", proto_str, 1); + add_assoc_string(meta_arr, "cipher_name", (char *) SSL_CIPHER_get_name(cipher), 1); + add_assoc_long(meta_arr, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL)); +- add_assoc_string(meta_arr, "cipher_version", SSL_CIPHER_get_version(cipher), 1); ++ add_assoc_string(meta_arr, "cipher_version", php_ssl_cipher_get_version(cipher, version_str, PHP_SSL_MAX_VERSION_LEN), 1); + + return meta_arr; + } +diff --git a/ext/phar/util.c b/ext/phar/util.c +index 828be8f..06e4e55 100644 +--- a/ext/phar/util.c ++++ b/ext/phar/util.c +@@ -1531,7 +1531,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ + BIO *in; + EVP_PKEY *key; + EVP_MD *mdtype = (EVP_MD *) EVP_sha1(); +- EVP_MD_CTX md_ctx; ++ EVP_MD_CTX *md_ctx; + #else + int tempsig; + #endif +@@ -1608,7 +1608,8 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ + return FAILURE; + } + +- EVP_VerifyInit(&md_ctx, mdtype); ++ md_ctx = EVP_MD_CTX_create(); ++ EVP_VerifyInit(md_ctx, mdtype); + read_len = end_of_phar; + + if (read_len > sizeof(buf)) { +@@ -1620,7 +1621,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ + php_stream_seek(fp, 0, SEEK_SET); + + while (read_size && (len = php_stream_read(fp, (char*)buf, read_size)) > 0) { +- EVP_VerifyUpdate (&md_ctx, buf, len); ++ EVP_VerifyUpdate (md_ctx, buf, len); + read_len -= (off_t)len; + + if (read_len < read_size) { +@@ -1628,9 +1629,9 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ + } + } + +- if (EVP_VerifyFinal(&md_ctx, (unsigned char *)sig, sig_len, key) != 1) { ++ if (EVP_VerifyFinal(md_ctx, (unsigned char *)sig, sig_len, key) != 1) { + /* 1: signature verified, 0: signature does not match, -1: failed signature operation */ +- EVP_MD_CTX_cleanup(&md_ctx); ++ EVP_MD_CTX_destroy(md_ctx); + + if (error) { + spprintf(error, 0, "broken openssl signature"); +@@ -1639,7 +1640,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ + return FAILURE; + } + +- EVP_MD_CTX_cleanup(&md_ctx); ++ EVP_MD_CTX_destroy(md_ctx); + #endif + + *signature_len = phar_hex_str((const char*)sig, sig_len, signature TSRMLS_CC); +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude-use-pkgconfig-for-libxml2-config.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude-use-pkgconfig-for-libxml2-config.patch new file mode 100644 index 00000000..e7d326d7 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude-use-pkgconfig-for-libxml2-config.patch @@ -0,0 +1,90 @@ +From 003c9feaae6ed5c173edcea51193e49bc94ac39a Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen.kooi@linaro.org> +Date: Tue, 17 Jun 2014 09:53:00 +0200 +Subject: [PATCH 3/8] acinclude: use pkgconfig for libxml2 config + +Signed-off-by: Koen Kooi <koen.kooi@linaro.org> +Upstream-Status: Pending +--- + acinclude.m4 | 63 ++++++++++++++++++++++-------------------------------------- + 1 file changed, 23 insertions(+), 40 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 206fcbf..a6c0d84 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -2530,48 +2530,31 @@ dnl + dnl Common setup macro for libxml + dnl + AC_DEFUN([PHP_SETUP_LIBXML], [ +-AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path, +-[ +- +- ac_cv_php_xml2_config_path="$PHP_LIBXML_DIR/xml2-config" +- ++PKG_CHECK_MODULES([LIBXML], [libxml-2.0 > 2.6.11], [ ++ PHP_EVAL_LIBLINE($LIBXML_LIBS, $1) ++ PHP_EVAL_INCLINE($LIBXML_CFLAGS) ++ ++ dnl Check that build works with given libs ++ AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [ ++ PHP_TEST_BUILD(xmlInitParser, ++ [ ++ php_cv_libxml_build_works=yes ++ AC_MSG_RESULT(yes) ++ ], [ ++ AC_MSG_RESULT(no) ++ AC_MSG_ERROR([build test failed. Please check the config.log for details.]) ++ ], [ ++ [$]$1 ++ ]) ++ ]) ++ if test "$php_cv_libxml_build_works" = "yes"; then ++ AC_DEFINE(HAVE_LIBXML, 1, [ ]) ++ fi ++ $2 ++], [ ++ AC_MSG_ERROR([$LIBXML_PKG_ERRORS]) + ]) + +- if test -x "$ac_cv_php_xml2_config_path"; then +- XML2_CONFIG="$ac_cv_php_xml2_config_path" +- libxml_full_version=`$XML2_CONFIG --version` +- ac_IFS=$IFS +- IFS="." +- set $libxml_full_version +- IFS=$ac_IFS +- LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` +- if test "$LIBXML_VERSION" -ge "2006011"; then +- LIBXML_LIBS=`$XML2_CONFIG --libs` +- LIBXML_INCS=`$XML2_CONFIG --cflags` +- PHP_EVAL_LIBLINE($LIBXML_LIBS, $1) +- PHP_EVAL_INCLINE($LIBXML_INCS) +- +- dnl Check that build works with given libs +- AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [ +- PHP_TEST_BUILD(xmlInitParser, +- [ +- php_cv_libxml_build_works=yes +- ], [ +- AC_MSG_RESULT(no) +- AC_MSG_ERROR([build test failed. Please check the config.log for details.]) +- ], [ +- [$]$1 +- ]) +- ]) +- if test "$php_cv_libxml_build_works" = "yes"; then +- AC_DEFINE(HAVE_LIBXML, 1, [ ]) +- fi +- $2 +- else +- AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.]) +- fi +-ifelse([$3],[],,[else $3]) +- fi + ]) + + dnl ------------------------------------------------------------------------- +-- +1.9.3 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch new file mode 100644 index 00000000..a250cac8 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch @@ -0,0 +1,39 @@ +From dfebe81f946a83fe2499fc84d4f3dbdc5612276c Mon Sep 17 00:00:00 2001 +From: Anuj Mittal <anuj.mittal@intel.com> +Date: Tue, 3 Apr 2018 11:35:03 +0800 +Subject: [PATCH] acinclude.m4: don't unset cache variables + +Unsetting prevents cache variable from being passed to configure. + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> +--- + acinclude.m4 | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index f6a55ec..d3346df 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -1890,8 +1890,6 @@ define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])) + dnl + AC_DEFUN([PHP_CHECK_FUNC_LIB],[ + ifelse($2,,:,[ +- unset ac_cv_lib_$2[]_$1 +- unset ac_cv_lib_$2[]___$1 + unset found + AC_CHECK_LIB($2, $1, [found=yes], [ + AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) +@@ -1923,8 +1921,6 @@ dnl in the default libraries and as a fall back in the specified library. + dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. + dnl + AC_DEFUN([PHP_CHECK_FUNC],[ +- unset ac_cv_func_$1 +- unset ac_cv_func___$1 + unset found + + AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ]) +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch new file mode 100644 index 00000000..15329261 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch @@ -0,0 +1,56 @@ +From a2d146b8dd9d02f523d1e205d79792626a71dec3 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal <anuj.mittal@intel.com> +Date: Mon, 2 Apr 2018 15:27:09 +0800 +Subject: [PATCH] acinclude.m4: skip binconfig check for libxml + +We want libxml flags to be picked up using pkg-config instead of the +xml2-config file. + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> + +--- + acinclude.m4 | 29 ----------------------------- + 1 file changed, 29 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index d42d708..d32766a 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -2525,35 +2525,6 @@ dnl + AC_DEFUN([PHP_SETUP_LIBXML], [ + found_libxml=no + +- dnl First try to find xml2-config +- AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path, +- [ +- for i in $PHP_LIBXML_DIR /usr/local /usr; do +- if test -x "$i/bin/xml2-config"; then +- ac_cv_php_xml2_config_path="$i/bin/xml2-config" +- break +- fi +- done +- ]) +- +- if test -x "$ac_cv_php_xml2_config_path"; then +- XML2_CONFIG="$ac_cv_php_xml2_config_path" +- libxml_full_version=`$XML2_CONFIG --version` +- ac_IFS=$IFS +- IFS="." +- set $libxml_full_version +- IFS=$ac_IFS +- LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` +- if test "$LIBXML_VERSION" -ge "2006011"; then +- found_libxml=yes +- LIBXML_LIBS=`$XML2_CONFIG --libs` +- LIBXML_INCS=`$XML2_CONFIG --cflags` +- else +- AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.]) +- fi +- fi +- +- dnl If xml2-config fails, try pkg-config + if test "$found_libxml" = "no"; then + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-fix-error-caused-by-a-new-variable-is-declared-after.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-fix-error-caused-by-a-new-variable-is-declared-after.patch new file mode 100644 index 00000000..6ab101b4 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-fix-error-caused-by-a-new-variable-is-declared-after.patch @@ -0,0 +1,45 @@ +From 0d88d735887c6f2fa00a743c27124c7a52006a41 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Sun, 15 Apr 2018 19:17:27 -0700 +Subject: [PATCH] fix error caused by a new variable is declared after the + label + +There is a build failure on mips: +... +|sljitNativeMIPS_common.c: In function 'sljit_has_cpu_feature': +|sljitNativeMIPS_common.c:506:3: error: a label can only be part +of a statement and a declaration is not a statement +| sljit_sw fir; +| ^~~~~~~~ +... + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c b/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c +index ee207fe..adfd342 100644 +--- a/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c ++++ b/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c +@@ -498,12 +498,14 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil + + SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type) + { ++#if defined(__GNUC__) ++ sljit_sw fir; ++#endif + switch (feature_type) { + case SLJIT_HAS_FPU: + #ifdef SLJIT_IS_FPU_AVAILABLE + return SLJIT_IS_FPU_AVAILABLE; + #elif defined(__GNUC__) +- sljit_sw fir; + asm ("cfc1 %0, $0" : "=r"(fir)); + return (fir >> 22) & 0x1; + #else +-- +2.10.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch new file mode 100644 index 00000000..fce9738f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch @@ -0,0 +1,63 @@ +From 2842aa2a078eb1cad55540b61e7edf111395150d Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni <thomas.petazzoni@bootlin.com> +Date: Mon, 26 Feb 2018 19:30:55 +0100 +Subject: [PATCH] main/php_ini.c: build empty php_load_zend_extension_cb() when + !HAVE_LIBDL + +Commit 0782a7fc6314c8bd3cbfd57f12d0479bf9cc8dc7 ("Fixed bug #74866 +extension_dir = "./ext" now use current directory for base") modified +the php_load_zend_extension_cb() function to use php_load_shlib(), and +pass a handle to the newly introduced zend_load_extension_handle() +function instead of passing the extension path to +zend_load_extension(). + +While doing so, it introduced a call to php_load_shlib() from code +that is built even when HAVE_LIBDL is not defined. However, +php_load_shlib() is not implemented when HAVE_LIBDL is not defined, +for obvious reasons. + +It turns out that zend_load_extension_handle() anyway doesn't do +anything when ZEND_EXTENSIONS_SUPPORT is defined to 0, and +ZEND_EXTENSIONS_SUPPORT is not defined when HAVE_LIBDL is not defined +(Zend/zend_portability.h). + +Fixes the following build failure when building on a system that +doesn't have libdl: + +main/php_ini.o: In function `php_load_zend_extension_cb': +php_ini.c:(.text+0x478): undefined reference to `php_load_shlib' +php_ini.c:(.text+0x4b0): undefined reference to `php_load_shlib' +collect2: error: ld returned 1 exit status + +Upstream-Status: Backport [http://git.php.net/?p=php-src.git;a=commit;h=2842aa2a078eb1cad55540b61e7edf111395150d] +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> +Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> +--- + main/php_ini.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/main/php_ini.c b/main/php_ini.c +index ba58eb1..fca263e 100644 +--- a/main/php_ini.c ++++ b/main/php_ini.c +@@ -350,6 +350,7 @@ static void php_load_php_extension_cb(void *arg) + + /* {{{ php_load_zend_extension_cb + */ ++#ifdef HAVE_LIBDL + static void php_load_zend_extension_cb(void *arg) + { + char *filename = *((char **) arg); +@@ -409,6 +410,9 @@ static void php_load_zend_extension_cb(void *arg) + efree(libpath); + } + } ++#else ++static void php_load_zend_extension_cb(void *arg) { } ++#endif + /* }}} */ + + /* {{{ php_init_config +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch new file mode 100644 index 00000000..0d24d34f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch @@ -0,0 +1,385 @@ +From b2fb725dc404d471371731b663234e87cb0fca84 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal <anuj.mittal@intel.com> +Date: Mon, 2 Apr 2018 17:54:52 +0800 +Subject: [PATCH] opcache/config.m4: enable opcache + +We can't use AC_TRY_RUN to run programs in a cross compile environment. Set +the variables directly instead since we know that we'd be running on latest +enough linux kernel. + +Upstream-Status: Inappropriate [Configuration] + +Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> +--- + ext/opcache/config.m4 | 349 ++------------------------------------------------ + 1 file changed, 8 insertions(+), 341 deletions(-) + +diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 +index 7b500f0..10bb99a 100644 +--- a/ext/opcache/config.m4 ++++ b/ext/opcache/config.m4 +@@ -28,353 +28,20 @@ if test "$PHP_OPCACHE" != "no"; then + + AC_CHECK_HEADERS([unistd.h sys/uio.h]) + +- AC_MSG_CHECKING(for sysvipc shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/ipc.h> +-#include <sys/shm.h> +-#include <unistd.h> +-#include <string.h> ++ AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) + +-int main() { +- pid_t pid; +- int status; +- int ipc_id; +- char *shm; +- struct shmid_ds shmbuf; ++ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) + +- ipc_id = shmget(IPC_PRIVATE, 4096, (IPC_CREAT | SHM_R | SHM_W)); +- if (ipc_id == -1) { +- return 1; +- } ++ AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support]) + +- shm = shmat(ipc_id, NULL, 0); +- if (shm == (void *)-1) { +- shmctl(ipc_id, IPC_RMID, NULL); +- return 2; +- } +- +- if (shmctl(ipc_id, IPC_STAT, &shmbuf) != 0) { +- shmdt(shm); +- shmctl(ipc_id, IPC_RMID, NULL); +- return 3; +- } +- +- shmbuf.shm_perm.uid = getuid(); +- shmbuf.shm_perm.gid = getgid(); +- shmbuf.shm_perm.mode = 0600; +- +- if (shmctl(ipc_id, IPC_SET, &shmbuf) != 0) { +- shmdt(shm); +- shmctl(ipc_id, IPC_RMID, NULL); +- return 4; +- } +- +- shmctl(ipc_id, IPC_RMID, NULL); +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) +- +- AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/mman.h> +-#include <unistd.h> +-#include <string.h> +- +-#ifndef MAP_ANON +-# ifdef MAP_ANONYMOUS +-# define MAP_ANON MAP_ANONYMOUS +-# endif +-#endif +-#ifndef MAP_FAILED +-# define MAP_FAILED ((void*)-1) +-#endif +- +-int main() { +- pid_t pid; +- int status; +- char *shm; +- +- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); +- if (shm == MAP_FAILED) { +- return 1; +- } +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) +- +- AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/mman.h> +-#include <sys/stat.h> +-#include <fcntl.h> +-#include <unistd.h> +-#include <string.h> +- +-#ifndef MAP_FAILED +-# define MAP_FAILED ((void*)-1) +-#endif +- +-int main() { +- pid_t pid; +- int status; +- int fd; +- char *shm; +- +- fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR); +- if (fd == -1) { +- return 1; +- } +- +- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); +- if (shm == MAP_FAILED) { +- return 2; +- } +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) +- +- AC_MSG_CHECKING(for mmap() using shm_open() shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/mman.h> +-#include <sys/stat.h> +-#include <fcntl.h> +-#include <unistd.h> +-#include <string.h> +-#include <stdlib.h> +-#include <stdio.h> +- +-#ifndef MAP_FAILED +-# define MAP_FAILED ((void*)-1) +-#endif +- +-int main() { +- pid_t pid; +- int status; +- int fd; +- char *shm; +- char tmpname[4096]; +- +- sprintf(tmpname,"test.shm.%dXXXXXX", getpid()); +- if (mktemp(tmpname) == NULL) { +- return 1; +- } +- fd = shm_open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); +- if (fd == -1) { +- return 2; +- } +- if (ftruncate(fd, 4096) < 0) { +- close(fd); +- shm_unlink(tmpname); +- return 3; +- } +- +- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); +- if (shm == MAP_FAILED) { +- return 4; +- } +- shm_unlink(tmpname); +- close(fd); +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) ++ AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support]) + + AC_MSG_CHECKING(for mmap() using regular file shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/mman.h> +-#include <sys/stat.h> +-#include <fcntl.h> +-#include <unistd.h> +-#include <string.h> +-#include <stdlib.h> +-#include <stdio.h> +- +-#ifndef MAP_FAILED +-# define MAP_FAILED ((void*)-1) +-#endif +- +-int main() { +- pid_t pid; +- int status; +- int fd; +- char *shm; +- char tmpname[4096]; +- +- sprintf(tmpname,"test.shm.%dXXXXXX", getpid()); +- if (mktemp(tmpname) == NULL) { +- return 1; +- } +- fd = open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); +- if (fd == -1) { +- return 2; +- } +- if (ftruncate(fd, 4096) < 0) { +- close(fd); +- unlink(tmpname); +- return 3; +- } +- +- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); +- if (shm == MAP_FAILED) { +- return 4; +- } +- unlink(tmpname); +- close(fd); +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) +- +-flock_type=unknown +-AC_MSG_CHECKING("whether flock struct is linux ordered") +-AC_TRY_RUN([ +- #include <fcntl.h> +- struct flock lock = { 1, 2, 3, 4, 5 }; +- int main() { +- if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) { +- return 0; +- } +- return 1; +- } +-], [ +- flock_type=linux +- AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) +- AC_MSG_RESULT("yes") +-], AC_MSG_RESULT("no") ) ++ ++ AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support]) + +-AC_MSG_CHECKING("whether flock struct is BSD ordered") +-AC_TRY_RUN([ +- #include <fcntl.h> +- struct flock lock = { 1, 2, 3, 4, 5 }; +- int main() { +- if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) { +- return 0; +- } +- return 1; +- } +-], [ +- flock_type=bsd +- AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type]) +- AC_MSG_RESULT("yes") +-], AC_MSG_RESULT("no") ) ++ flock_type=linux ++ AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) + + if test "$flock_type" = "unknown"; then + AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no]) +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php-don-t-use-broken-wrapper-for-mkdir.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php-don-t-use-broken-wrapper-for-mkdir.patch new file mode 100644 index 00000000..2f7d5815 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-php-don-t-use-broken-wrapper-for-mkdir.patch @@ -0,0 +1,26 @@ +From ebc101e0728b9db6c687cff525e5dfc8eb0edbf3 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Thu, 3 Nov 2011 14:27:15 +0100 +Subject: [PATCH 2/8] php: don't use broken wrapper for mkdir + +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> +--- + +Upstream-Status: Inappropriate + + Makefile.global | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.global b/Makefile.global +index ff858c2..ae554b4 100644 +--- a/Makefile.global ++++ b/Makefile.global +@@ -1,4 +1,4 @@ +-mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p ++mkinstalldirs = mkdir -p + INSTALL = $(top_srcdir)/build/shtool install -c + INSTALL_DATA = $(INSTALL) -m 644 + +-- +1.9.3 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php5.conf b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php5.conf new file mode 100644 index 00000000..1de6fb11 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php5.conf @@ -0,0 +1,12 @@ +# vim: ft=apache sw=4 ts=4 +<IfDefine PHP5> + # Load the module first + <IfModule !sapi_apache2.c> + LoadModule php5_module lib/apache2/modules/libphp5.so + </IfModule> + + # Set it to handle the files + AddHandler php5-script .php .phtml .php3 .php4 .php5 + AddType application/x-httpd-php-source .phps + DirectoryIndex index.html index.html.var index.php index.phtml +</IfDefine> diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php7.conf b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php7.conf new file mode 100644 index 00000000..d206265a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php7.conf @@ -0,0 +1,9 @@ +LoadModule php7_module lib/apache2/modules/libphp7.so + +<FilesMatch "\.ph(p[2-7]?|tml)$"> + SetHandler application/x-httpd-php +</FilesMatch> + +<FilesMatch "\.phps$"> + SetHandler application/x-httpd-php-source +</FilesMatch> diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch new file mode 100644 index 00000000..728f25bb --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch @@ -0,0 +1,21 @@ +php: patch for CVE-2017-9120 + +Upstream-Status: Backport [https://bugs.php.net/bug.php?id=74544] + +CVE: CVE-2017-9120 + +Signed-off-by: Changqing Li <changqing.li@windriver.com> + +diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c +index 03a39d7..7b88731 100644 +--- a/ext/mysqli/mysqli_api.c ++++ b/ext/mysqli/mysqli_api.c +@@ -1965,7 +1965,7 @@ PHP_FUNCTION(mysqli_real_escape_string) { + } + MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); + +- newstr = zend_string_alloc(2 * escapestr_len, 0); ++ newstr = zend_string_safe_alloc(2, escapestr_len, 0, 0); + ZSTR_LEN(newstr) = mysql_real_escape_string(mysql->mysql, ZSTR_VAL(newstr), escapestr, escapestr_len); + newstr = zend_string_truncate(newstr, ZSTR_LEN(newstr), 0); + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/acinclude-xml2-config.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/acinclude-xml2-config.patch new file mode 100644 index 00000000..d0831669 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/acinclude-xml2-config.patch @@ -0,0 +1,25 @@ +Upstream-Status: Pending + +diff --git a/acinclude.m4 b/acinclude.m4 +index 4fd452e..206fcbf 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -2532,12 +2532,9 @@ dnl + AC_DEFUN([PHP_SETUP_LIBXML], [ + AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path, + [ +- for i in $PHP_LIBXML_DIR /usr/local /usr; do +- if test -x "$i/bin/xml2-config"; then +- ac_cv_php_xml2_config_path="$i/bin/xml2-config" +- break +- fi +- done ++ ++ ac_cv_php_xml2_config_path="$PHP_LIBXML_DIR/xml2-config" ++ + ]) + + if test -x "$ac_cv_php_xml2_config_path"; then +-- +1.9.3 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch new file mode 100644 index 00000000..3e901841 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch @@ -0,0 +1,61 @@ +From 3bfcc7fdd22261eaed10949714de0a90d31e10ab Mon Sep 17 00:00:00 2001 +From: Roy Li <rongqing.li@windriver.com> +Date: Thu, 20 Aug 2015 16:29:35 +0800 +Subject: [PATCH] [PATCH] config.m4: change AC_TRY_RUN to AC_TRY_LINK + +Upstream-Status: Pending + +AC_TRY_RUN is not suitable for cross-compile + +Signed-off-by: Roy Li <rongqing.li@windriver.com> + +%% original patch: change-AC_TRY_RUN-to-AC_TRY_LINK.patch +--- + ext/fileinfo/config.m4 | 31 ++++++------------------------- + 1 file changed, 6 insertions(+), 25 deletions(-) + +diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4 +index 523b4fd..0aaa4c8 100644 +--- a/ext/fileinfo/config.m4 ++++ b/ext/fileinfo/config.m4 +@@ -14,31 +14,12 @@ if test "$PHP_FILEINFO" != "no"; then + libmagic/readcdf.c libmagic/softmagic.c libmagic/der.c" + + AC_MSG_CHECKING([for strcasestr]) +- AC_TRY_RUN([ +-#include <string.h> +-#include <strings.h> +-#include <stdlib.h> +- +-int main(void) +-{ +- char *s0, *s1, *ret; +- +- s0 = (char *) malloc(42); +- s1 = (char *) malloc(8); +- +- memset(s0, 'X', 42); +- s0[24] = 'Y'; +- s0[26] = 'Z'; +- s0[41] = '\0'; +- memset(s1, 'x', 8); +- s1[0] = 'y'; +- s1[2] = 'Z'; +- s1[7] = '\0'; +- +- ret = strcasestr(s0, s1); +- +- return !(NULL != ret); +-} ++ AC_TRY_COMPILE([ ++ #include <string.h> ++ #include <strings.h> ++ #include <stdlib.h> ++ ],[ ++ strcasestr(NULL, NULL); + ],[ + dnl using the platform implementation + AC_MSG_RESULT(yes) +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/iconv.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/iconv.patch new file mode 100644 index 00000000..ecf7d872 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/iconv.patch @@ -0,0 +1,37 @@ +From 17cc5645f3acf943a5a06465d09d0ebcfea987bd Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Wed, 2 Nov 2011 16:54:57 +0100 +Subject: [PATCH] Upstream-Status: Pending + +--- + acinclude.m4 | 3 ++- + ext/iconv/config.m4 | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index d32766a..ad5166e 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -2445,7 +2445,8 @@ AC_DEFUN([PHP_SETUP_ICONV], [ + dnl Check libc first if no path is provided in --with-iconv + dnl + +- if test "$PHP_ICONV" = "yes"; then ++ dnl must check against no, not against yes as PHP_ICONV can also include a path, which implies yes ++ if test "$PHP_ICONV" != "no"; then + dnl Reset LIBS temporarily as it may have already been included + dnl -liconv in. + LIBS_save="$LIBS" +diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 +index 6a05697..973e750 100644 +--- a/ext/iconv/config.m4 ++++ b/ext/iconv/config.m4 +@@ -15,7 +15,7 @@ if test "$PHP_ICONV" != "no"; then + + if test "$iconv_avail" != "no"; then + if test -z "$ICONV_DIR"; then +- for i in /usr/local /usr; do ++ for i in $PHP_ICONV /usr/local /usr; do + if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then + PHP_ICONV_PREFIX="$i" + break diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/imap-fix-autofoo.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/imap-fix-autofoo.patch new file mode 100644 index 00000000..16359af9 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/imap-fix-autofoo.patch @@ -0,0 +1,51 @@ +From c084c8349d1780980e232cb28b60a109e3d89438 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Wed, 2 Nov 2011 16:54:57 +0100 +Subject: [PATCH] Upstream-Status: Pending + +--- + acinclude.m4 | 2 +- + ext/imap/config.m4 | 10 ++-------- + 2 files changed, 3 insertions(+), 9 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index ad5166e..f6a55ec 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -2350,7 +2350,7 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[ + PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl" + fi + +- for i in $PHP_OPENSSL_DIR; do ++ for i in $PHP_OPENSSL_DIR $PHP_OPENSSL_DIR/usr; do + if test -r $i/include/openssl/evp.h; then + OPENSSL_INCDIR=$i/include + fi +diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 +index badb6e2..8ff803c 100644 +--- a/ext/imap/config.m4 ++++ b/ext/imap/config.m4 +@@ -109,7 +109,7 @@ if test "$PHP_IMAP" != "no"; then + PHP_NEW_EXTENSION(imap, php_imap.c, $ext_shared) + AC_DEFINE(HAVE_IMAP,1,[ ]) + +- for i in $PHP_IMAP /usr/local /usr; do ++ for i in $PHP_IMAP $PHP_IMAP/usr /usr/local /usr; do + IMAP_INC_CHK() + el[]IMAP_INC_CHK(/include/c-client) + el[]IMAP_INC_CHK(/include/imap) +@@ -198,13 +198,7 @@ if test "$PHP_IMAP" != "no"; then + AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.) + fi + +- if test ! -r "$IMAP_DIR/c-client/libc-client.a" && test -r "$IMAP_DIR/c-client/c-client.a" ; then +- ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1 +- elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then +- ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1 +- fi +- +- for lib in c-client4 c-client imap; do ++ for lib in /usr/lib c-client4 c-client imap; do + IMAP_LIB=$lib + IMAP_LIB_CHK($PHP_LIBDIR) + IMAP_LIB_CHK(c-client) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/pear-makefile.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/pear-makefile.patch new file mode 100644 index 00000000..fcbf25be --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/pear-makefile.patch @@ -0,0 +1,22 @@ +From edd575a546d56bb5683aff19782b16963d61fd0b Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Wed, 2 Nov 2011 16:54:57 +0100 +Subject: [PATCH] Upstream-Status: Pending + +--- + pear/Makefile.frag | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pear/Makefile.frag b/pear/Makefile.frag +index bbe8ec3..16f43e2 100644 +--- a/pear/Makefile.frag ++++ b/pear/Makefile.frag +@@ -12,7 +12,7 @@ PEAR_SUFFIX = -ds a$(program_suffix) + PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar + + install-pear-installer: $(SAPI_CLI_PATH) +- @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX} ++ @$(PHP_NATIVE_DIR)/php $(PEAR_INSTALL_FLAGS) $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX} + + install-pear: + @echo "Installing PEAR environment: $(INSTALL_ROOT)$(peardir)/" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/phar-makefile.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/phar-makefile.patch new file mode 100644 index 00000000..336cf0d6 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/phar-makefile.patch @@ -0,0 +1,42 @@ +From 08962a56f69963e01892d98ca5b75de8354bd3f5 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Wed, 2 Nov 2011 16:54:57 +0100 +Subject: [PATCH] Fix phar packaging + +Inherited from OE-Classic, with some additions to fix host paths leaking +into the target package. + +Upstream-Status: Inappropriate [config] + +--- + ext/phar/Makefile.frag | 17 +++-------------- + 1 file changed, 3 insertions(+), 14 deletions(-) + +diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag +index 0e3713f..22f7898 100644 +--- a/ext/phar/Makefile.frag ++++ b/ext/phar/Makefile.frag +@@ -10,20 +10,9 @@ pharcmd: $(builddir)/phar.php $(builddir)/phar.phar + + PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0' + PHP_PHARCMD_EXECUTABLE = ` \ +- if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \ +- $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \ +- if test "x$(PHP_MODULES)" != "x"; then \ +- $(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \ +- for i in bz2 zlib phar; do \ +- if test -f "$(top_builddir)/modules/$$i.la"; then \ +- . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \ +- fi; \ +- done; \ +- fi; \ +- else \ +- $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \ +- fi;` +-PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";` ++ $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; ` ++ ++PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";` + + $(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc + -@test -d $(builddir)/phar || mkdir $(builddir)/phar diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm-apache.conf b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm-apache.conf new file mode 100644 index 00000000..77cdd82a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm-apache.conf @@ -0,0 +1,6 @@ +# Taken from http://wiki.apache.org/httpd/PHP-FPM + +LoadModule proxy_module lib/apache2/modules/mod_proxy.so +LoadModule proxy_fcgi_module lib/apache2/modules/mod_proxy_fcgi.so + +ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/usr/share/apache2/htdocs/ diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm.conf b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm.conf new file mode 100644 index 00000000..21e3dfb5 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm.conf @@ -0,0 +1,510 @@ +;;;;;;;;;;;;;;;;;;;;; +; FPM Configuration ; +;;;;;;;;;;;;;;;;;;;;; + +; All relative paths in this configuration file are relative to PHP's install +; prefix (/usr). This prefix can be dynamicaly changed by using the +; '-p' argument from the command line. + +; Include one or more files. If glob(3) exists, it is used to include a bunch of +; files from a glob(3) pattern. This directive can be used everywhere in the +; file. +; Relative path can also be used. They will be prefixed by: +; - the global prefix if it's been set (-p arguement) +; - /usr otherwise +;include=etc/fpm.d/*.conf + +;;;;;;;;;;;;;;;;;; +; Global Options ; +;;;;;;;;;;;;;;;;;; + +[global] +; Pid file +; Note: the default prefix is /var +; Default Value: none +;pid = run/php-fpm.pid + +; Error log file +; If it's set to "syslog", log is sent to syslogd instead of being written +; in a local file. +; Note: the default prefix is /var +; Default Value: log/php-fpm.log +;error_log = log/php-fpm.log + +; syslog_facility is used to specify what type of program is logging the +; message. This lets syslogd specify that messages from different facilities +; will be handled differently. +; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) +; Default Value: daemon +;syslog.facility = daemon + +; syslog_ident is prepended to every message. If you have multiple FPM +; instances running on the same server, you can change the default value +; which must suit common needs. +; Default Value: php-fpm +;syslog.ident = php-fpm + +; Log level +; Possible Values: alert, error, warning, notice, debug +; Default Value: notice +;log_level = notice + +; If this number of child processes exit with SIGSEGV or SIGBUS within the time +; interval set by emergency_restart_interval then FPM will restart. A value +; of '0' means 'Off'. +; Default Value: 0 +;emergency_restart_threshold = 0 + +; Interval of time used by emergency_restart_interval to determine when +; a graceful restart will be initiated. This can be useful to work around +; accidental corruptions in an accelerator's shared memory. +; Available Units: s(econds), m(inutes), h(ours), or d(ays) +; Default Unit: seconds +; Default Value: 0 +;emergency_restart_interval = 0 + +; Time limit for child processes to wait for a reaction on signals from master. +; Available units: s(econds), m(inutes), h(ours), or d(ays) +; Default Unit: seconds +; Default Value: 0 +;process_control_timeout = 0 + +; The maximum number of processes FPM will fork. This has been design to control +; the global number of processes when using dynamic PM within a lot of pools. +; Use it with caution. +; Note: A value of 0 indicates no limit +; Default Value: 0 +; process.max = 128 + +; Specify the nice(2) priority to apply to the master process (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool process will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. +; Default Value: yes +;daemonize = yes + +; Set open file descriptor rlimit for the master process. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit for the master process. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Specify the event mechanism FPM will use. The following is available: +; - select (any POSIX os) +; - poll (any POSIX os) +; - epoll (linux >= 2.5.44) +; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) +; - /dev/poll (Solaris >= 7) +; - port (Solaris >= 10) +; Default Value: not set (auto detection) +; events.mechanism = epoll + +;;;;;;;;;;;;;;;;;;;; +; Pool Definitions ; +;;;;;;;;;;;;;;;;;;;; + +; Multiple pools of child processes may be started with different listening +; ports and different management options. The name of the pool will be +; used in logs and stats. There is no limitation on the number of pools which +; FPM can handle. Your system will tell you anyway :) + +; Start a new pool named 'www'. +; the variable $pool can we used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or /usr) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = nobody +;group = nobody + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses on a +; specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = 127.0.0.1:9000 + +; Set listen(2) backlog. A value of '-1' means unlimited. +; Default Value: 128 (-1 on FreeBSD and OpenBSD) +;listen.backlog = -1 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0666 +;listen.owner = nobody +;listen.group = nobody +;listen.mode = 0666 + +; List of ipv4 addresses of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; priority = -19 + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 5 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/share/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: ouput header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +;slowlog = log/$pool.log.slow + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_slowlog_timeout = 0 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +;catch_workers_output = yes + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; exectute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm.service b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm.service new file mode 100644 index 00000000..ac79dc93 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php-fpm.service @@ -0,0 +1,10 @@ +[Unit] +Description=PHP-FPM +After=network.target +[Service] +Type=forking +PIDFile=@LOCALSTATEDIR@/run/php-fpm.pid +ExecStart=@SYSCONFDIR@/init.d/php-fpm start +ExecStop=@SYSCONFDIR@/init.d/php-fpm stop +[Install] +WantedBy=multi-user.target diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch new file mode 100644 index 00000000..7be67ea9 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch @@ -0,0 +1,387 @@ +From fafcfac0933c17e1bf551600080eb0541186caf5 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal <anuj.mittal@intel.com> +Date: Mon, 2 Apr 2018 17:54:52 +0800 +Subject: [PATCH] opcache/config.m4: enable opcache + +We can't use AC_TRY_RUN to run programs in a cross compile environment. Set +the variables directly instead since we know that we'd be running on latest +enough linux kernel. + +Upstream-Status: Inappropriate [Configuration] + +Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> + +%% original patch: php5-0001-opcache-config.m4-enable-opcache.patch +--- + ext/opcache/config.m4 | 349 ++------------------------------------------------ + 1 file changed, 8 insertions(+), 341 deletions(-) + +diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 +index 5a8b86c..6e87fa5 100644 +--- a/ext/opcache/config.m4 ++++ b/ext/opcache/config.m4 +@@ -11,353 +11,20 @@ if test "$PHP_OPCACHE" != "no"; then + AC_DEFINE(HAVE_MPROTECT, 1, [Define if you have mprotect() function]) + ]) + +- AC_MSG_CHECKING(for sysvipc shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/ipc.h> +-#include <sys/shm.h> +-#include <unistd.h> +-#include <string.h> ++ AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) + +-int main() { +- pid_t pid; +- int status; +- int ipc_id; +- char *shm; +- struct shmid_ds shmbuf; ++ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) + +- ipc_id = shmget(IPC_PRIVATE, 4096, (IPC_CREAT | SHM_R | SHM_W)); +- if (ipc_id == -1) { +- return 1; +- } ++ AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support]) + +- shm = shmat(ipc_id, NULL, 0); +- if (shm == (void *)-1) { +- shmctl(ipc_id, IPC_RMID, NULL); +- return 2; +- } +- +- if (shmctl(ipc_id, IPC_STAT, &shmbuf) != 0) { +- shmdt(shm); +- shmctl(ipc_id, IPC_RMID, NULL); +- return 3; +- } +- +- shmbuf.shm_perm.uid = getuid(); +- shmbuf.shm_perm.gid = getgid(); +- shmbuf.shm_perm.mode = 0600; +- +- if (shmctl(ipc_id, IPC_SET, &shmbuf) != 0) { +- shmdt(shm); +- shmctl(ipc_id, IPC_RMID, NULL); +- return 4; +- } +- +- shmctl(ipc_id, IPC_RMID, NULL); +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) +- +- AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/mman.h> +-#include <unistd.h> +-#include <string.h> +- +-#ifndef MAP_ANON +-# ifdef MAP_ANONYMOUS +-# define MAP_ANON MAP_ANONYMOUS +-# endif +-#endif +-#ifndef MAP_FAILED +-# define MAP_FAILED ((void*)-1) +-#endif +- +-int main() { +- pid_t pid; +- int status; +- char *shm; +- +- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); +- if (shm == MAP_FAILED) { +- return 1; +- } +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) +- +- AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/mman.h> +-#include <sys/stat.h> +-#include <fcntl.h> +-#include <unistd.h> +-#include <string.h> +- +-#ifndef MAP_FAILED +-# define MAP_FAILED ((void*)-1) +-#endif +- +-int main() { +- pid_t pid; +- int status; +- int fd; +- char *shm; +- +- fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR); +- if (fd == -1) { +- return 1; +- } +- +- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); +- if (shm == MAP_FAILED) { +- return 2; +- } +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) +- +- AC_MSG_CHECKING(for mmap() using shm_open() shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/mman.h> +-#include <sys/stat.h> +-#include <fcntl.h> +-#include <unistd.h> +-#include <string.h> +-#include <stdlib.h> +-#include <stdio.h> +- +-#ifndef MAP_FAILED +-# define MAP_FAILED ((void*)-1) +-#endif +- +-int main() { +- pid_t pid; +- int status; +- int fd; +- char *shm; +- char tmpname[4096]; +- +- sprintf(tmpname,"test.shm.%dXXXXXX", getpid()); +- if (mktemp(tmpname) == NULL) { +- return 1; +- } +- fd = shm_open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); +- if (fd == -1) { +- return 2; +- } +- if (ftruncate(fd, 4096) < 0) { +- close(fd); +- shm_unlink(tmpname); +- return 3; +- } +- +- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); +- if (shm == MAP_FAILED) { +- return 4; +- } +- shm_unlink(tmpname); +- close(fd); +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) ++ AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support]) + + AC_MSG_CHECKING(for mmap() using regular file shared memory support) +- AC_TRY_RUN([ +-#include <sys/types.h> +-#include <sys/wait.h> +-#include <sys/mman.h> +-#include <sys/stat.h> +-#include <fcntl.h> +-#include <unistd.h> +-#include <string.h> +-#include <stdlib.h> +-#include <stdio.h> +- +-#ifndef MAP_FAILED +-# define MAP_FAILED ((void*)-1) +-#endif +- +-int main() { +- pid_t pid; +- int status; +- int fd; +- char *shm; +- char tmpname[4096]; +- +- sprintf(tmpname,"test.shm.%dXXXXXX", getpid()); +- if (mktemp(tmpname) == NULL) { +- return 1; +- } +- fd = open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); +- if (fd == -1) { +- return 2; +- } +- if (ftruncate(fd, 4096) < 0) { +- close(fd); +- unlink(tmpname); +- return 3; +- } +- +- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); +- if (shm == MAP_FAILED) { +- return 4; +- } +- unlink(tmpname); +- close(fd); +- +- strcpy(shm, "hello"); +- +- pid = fork(); +- if (pid < 0) { +- return 5; +- } else if (pid == 0) { +- strcpy(shm, "bye"); +- return 6; +- } +- if (wait(&status) != pid) { +- return 7; +- } +- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) { +- return 8; +- } +- if (strcmp(shm, "bye") != 0) { +- return 9; +- } +- return 0; +-} +-],dnl +- AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support]) +- msg=yes,msg=no,msg=no) +- AC_MSG_RESULT([$msg]) +- +-flock_type=unknown +-AC_MSG_CHECKING("whether flock struct is linux ordered") +-AC_TRY_RUN([ +- #include <fcntl.h> +- struct flock lock = { 1, 2, 3, 4, 5 }; +- int main() { +- if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) { +- return 0; +- } +- return 1; +- } +-], [ +- flock_type=linux +- AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) +- AC_MSG_RESULT("yes") +-], AC_MSG_RESULT("no") ) ++ ++ AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support]) + +-AC_MSG_CHECKING("whether flock struct is BSD ordered") +-AC_TRY_RUN([ +- #include <fcntl.h> +- struct flock lock = { 1, 2, 3, 4, 5 }; +- int main() { +- if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) { +- return 0; +- } +- return 1; +- } +-], [ +- flock_type=bsd +- AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type]) +- AC_MSG_RESULT("yes") +-], AC_MSG_RESULT("no") ) ++ flock_type=linux ++ AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type]) + + if test "$flock_type" = "unknown"; then + AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no]) +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch new file mode 100644 index 00000000..1d21f8c5 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch @@ -0,0 +1,63 @@ +From 5f49987e88dfcbdb84be6e0c9025432fbd998709 Mon Sep 17 00:00:00 2001 +From: Roy Li <rongqing.li@windriver.com> +Date: Thu, 20 Aug 2015 16:29:35 +0800 +Subject: [PATCH] config.m4: change AC_TRY_RUN to AC_TRY_LINK + +Upstream-Status: Pending + +AC_TRY_RUN is not suitable for cross-compile + +Signed-off-by: Roy Li <rongqing.li@windriver.com> + +%% original patch: change-AC_TRY_RUN-to-AC_TRY_LINK.patch + +%% original patch: php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch +--- + ext/fileinfo/config.m4 | 31 ++++++------------------------- + 1 file changed, 6 insertions(+), 25 deletions(-) + +diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4 +index 7e98d62..8a8ea0e 100644 +--- a/ext/fileinfo/config.m4 ++++ b/ext/fileinfo/config.m4 +@@ -14,31 +14,12 @@ if test "$PHP_FILEINFO" != "no"; then + libmagic/readcdf.c libmagic/softmagic.c" + + AC_MSG_CHECKING([for strcasestr]) +- AC_TRY_RUN([ +-#include <string.h> +-#include <strings.h> +-#include <stdlib.h> +- +-int main(void) +-{ +- char *s0, *s1, *ret; +- +- s0 = (char *) malloc(42); +- s1 = (char *) malloc(8); +- +- memset(s0, 'X', 42); +- s0[24] = 'Y'; +- s0[26] = 'Z'; +- s0[41] = '\0'; +- memset(s1, 'x', 8); +- s1[0] = 'y'; +- s1[2] = 'Z'; +- s1[7] = '\0'; +- +- ret = strcasestr(s0, s1); +- +- return !(NULL != ret); +-} ++ AC_TRY_COMPILE([ ++ #include <string.h> ++ #include <strings.h> ++ #include <stdlib.h> ++ ],[ ++ strcasestr(NULL, NULL); + ],[ + dnl using the platform implementation + AC_MSG_RESULT(yes) +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-pear-makefile.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-pear-makefile.patch new file mode 100644 index 00000000..99743030 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-pear-makefile.patch @@ -0,0 +1,26 @@ +From 79725e82d5981fc94eb657f0f46a499dbfc1cc40 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Wed, 2 Nov 2011 16:54:57 +0100 +Subject: [PATCH] Upstream-Status: Pending + +%% original patch: php5-pear-makefile.patch +--- + pear/Makefile.frag | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pear/Makefile.frag b/pear/Makefile.frag +index 00bacae..739eeca 100644 +--- a/pear/Makefile.frag ++++ b/pear/Makefile.frag +@@ -11,7 +11,7 @@ PEAR_PREFIX = -dp a${program_prefix} + PEAR_SUFFIX = -ds a$(program_suffix) + + install-pear-installer: $(SAPI_CLI_PATH) +- @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX} ++ @$(PHP_NATIVE_DIR)/php $(PEAR_INSTALL_FLAGS) $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX} + + install-pear: + @echo "Installing PEAR environment: $(INSTALL_ROOT)$(peardir)/" +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-phar-makefile.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-phar-makefile.patch new file mode 100644 index 00000000..4e1efd40 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php5-phar-makefile.patch @@ -0,0 +1,46 @@ +From 3ea626a8d081f56b01004b7992534d4e6b81a9cc Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Wed, 2 Nov 2011 16:54:57 +0100 +Subject: [PATCH] Fix phar packaging + +Inherited from OE-Classic, with some additions to fix host paths leaking +into the target package. + +Upstream-Status: Inappropriate [config] + +%% original patch: php5-phar-makefile.patch +--- + ext/phar/Makefile.frag | 17 +++-------------- + 1 file changed, 3 insertions(+), 14 deletions(-) + +diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag +index b8b1b42..1005b2d 100644 +--- a/ext/phar/Makefile.frag ++++ b/ext/phar/Makefile.frag +@@ -5,20 +5,9 @@ pharcmd: $(builddir)/phar.php $(builddir)/phar.phar + + PHP_PHARCMD_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0' + PHP_PHARCMD_EXECUTABLE = ` \ +- if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \ +- $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \ +- if test "x$(PHP_MODULES)" != "x"; then \ +- $(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \ +- for i in bz2 zlib phar; do \ +- if test -f "$(top_builddir)/modules/$$i.la"; then \ +- . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \ +- fi; \ +- done; \ +- fi; \ +- else \ +- $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \ +- fi;` +-PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";` ++ $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; ` ++ ++PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";` + + $(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc + -@test -d $(builddir)/phar || mkdir $(builddir)/phar +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php_exec_native.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php_exec_native.patch new file mode 100644 index 00000000..80409000 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/php_exec_native.patch @@ -0,0 +1,22 @@ +From d251b5aa3d23803d016ca16818e2e1d2f2b70a02 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Wed, 2 Nov 2011 16:54:57 +0100 +Subject: [PATCH] Upstream-Status: Inappriate + +--- + sapi/cli/config.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4 +index 2168151..20a81db 100644 +--- a/sapi/cli/config.m4 ++++ b/sapi/cli/config.m4 +@@ -50,7 +50,7 @@ if test "$PHP_CLI" != "no"; then + esac + + dnl Set executable for tests +- PHP_EXECUTABLE="\$(top_builddir)/\$(SAPI_CLI_PATH)" ++ PHP_EXECUTABLE="${PHP_NATIVE_DIR}/php" + PHP_SUBST(PHP_EXECUTABLE) + + dnl Expose to Makefile diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch new file mode 100644 index 00000000..0c564cd8 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php/pthread-check-threads-m4.patch @@ -0,0 +1,30 @@ +From d8067ceacbf54e79c9c6b68675332c09eaa0b55d Mon Sep 17 00:00:00 2001 +From: Jackie Huang <jackie.huang@windriver.com> +Date: Mon, 8 Apr 2013 14:29:51 +0800 +Subject: [PATCH] pthread-check + +Enable pthreads support when cross-compiling + +Upstream-Status: Inapproprate [config] + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + TSRM/threads.m4 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/TSRM/threads.m4 b/TSRM/threads.m4 +index 38494ce..15d9454 100644 +--- a/TSRM/threads.m4 ++++ b/TSRM/threads.m4 +@@ -86,7 +86,7 @@ int main() { + pthreads_working=no + ], [ + dnl For cross compiling running this test is of no use. NetWare supports pthreads +- pthreads_working=no ++ pthreads_working=yes + case $host_alias in + *netware*) + pthreads_working=yes +-- +1.7.4.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php_5.6.38.bb b/external/meta-openembedded/meta-oe/recipes-devtools/php/php_5.6.38.bb new file mode 100644 index 00000000..d6f51454 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php_5.6.38.bb @@ -0,0 +1,24 @@ +require php.inc + +LIC_FILES_CHKSUM = "file://LICENSE;md5=b602636d46a61c0ac0432bbf5c078fe4" + +SRC_URI += "file://php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch \ + file://pthread-check-threads-m4.patch \ + file://0001-Add-lpthread-to-link.patch \ + file://acinclude-xml2-config.patch \ + file://0001-acinclude-use-pkgconfig-for-libxml2-config.patch \ + file://0001-PHP-5.6-LibSSL-1.1-compatibility.patch \ + " + +SRC_URI_append_class-target = " \ + file://php5-pear-makefile.patch \ + file://php5-phar-makefile.patch \ + file://php5-0001-opcache-config.m4-enable-opcache.patch \ + " + +SRC_URI[md5sum] = "5b98aa066567eca8e5738b8ef4a3545c" +SRC_URI[sha256sum] = "d65b231bbdd63be4439ef5ced965cfd63e62983429dbd4dfcfb49981593ebc03" + +DEPENDS += "libmcrypt" +EXTRA_OECONF += "--with-mcrypt=${STAGING_DIR_TARGET}${exec_prefix} \ + " diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/php/php_7.2.10.bb b/external/meta-openembedded/meta-oe/recipes-devtools/php/php_7.2.10.bb new file mode 100644 index 00000000..8dc64bb8 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/php/php_7.2.10.bb @@ -0,0 +1,25 @@ +require php.inc + +LIC_FILES_CHKSUM = "file://LICENSE;md5=67e369bc8d1f2e641236b8002039a6a2" + +SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch \ + file://0001-acinclude.m4-skip-binconfig-check-for-libxml.patch \ + file://0001-fix-error-caused-by-a-new-variable-is-declared-after.patch \ + file://CVE-2017-9120.patch \ + " +SRC_URI_append_class-target = " \ + file://pear-makefile.patch \ + file://phar-makefile.patch \ + file://0001-opcache-config.m4-enable-opcache.patch \ + " + +SRC_URI[md5sum] = "0ce8ff615bfb9de7a89bab8d742c11c0" +SRC_URI[sha256sum] = "01b6129a0921a1636b07da9bc598a876669e45a462cef4b5844fc26862dbda9d" + +PACKAGECONFIG[mysql] = "--with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config \ + --with-pdo-mysql=${STAGING_BINDIR_CROSS}/mysql_config \ + ,--without-mysqli --without-pdo-mysql \ + ,mysql5" +PACKAGECONFIG[valgrind] = "--with-valgrind=${STAGING_DIR_TARGET}/usr,--with-valgrind=no,valgrind" + +FILES_${PN}-fpm += "${sysconfdir}/php-fpm.d/www.conf.default" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/pmtools/pmtools/pmtools-switch-to-dynamic-buffer-for-huge-ACPI-table.patch b/external/meta-openembedded/meta-oe/recipes-devtools/pmtools/pmtools/pmtools-switch-to-dynamic-buffer-for-huge-ACPI-table.patch new file mode 100644 index 00000000..7ccdab0f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/pmtools/pmtools/pmtools-switch-to-dynamic-buffer-for-huge-ACPI-table.patch @@ -0,0 +1,66 @@ +From 03a886252f6555d6b0af76b654e76459642b89da Mon Sep 17 00:00:00 2001 +From: Yunguo Wei <yunguo.wei@windriver.com> +Date: Tue, 3 Dec 2013 18:12:50 +0800 +Subject: [PATCH] pmtools: switch to dynamic buffer for huge ACPI tables + +For servers like Canoe Pass or Thunder Ridge, there are much more +entries in ACPI table, so original 1K buffer is insufficient. + +We switch to dynamic buffer on this situation. + +Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com> + + +Upstream-Status: Pending + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + madt/madt.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/madt/madt.c b/madt/madt.c +index aed965c..8770cd5 100644 +--- a/madt/madt.c ++++ b/madt/madt.c +@@ -51,7 +51,9 @@ get_next_entry(acpi_table_entry_header * entry_header) + return retval; + } + +-u8 buffer[1024]; ++ ++u8 buf[1024]; ++u8 *buffer = buf; + + main() + { +@@ -75,6 +77,17 @@ main() + + if (verbose) printf("header.length %d\n", madt_header->header.length); + ++ /* if 1K buffer is insufficient for acpi table, switch to a larger memory buffer */ ++ if(expected_length > sizeof(buf)) { ++ buffer = malloc(expected_length); ++ if (!buffer) { ++ perror("malloc"); ++ exit(1); ++ } ++ memset(buffer, 0, expected_length); ++ memcpy(buffer, buf, sizeof(struct acpi_table_madt)); ++ } ++ + acpi_table_print((void*)&(buffer[bytes_read]), 0); + + bytes_read = sizeof(struct acpi_table_madt); +@@ -118,6 +131,9 @@ done: + printf("Checksum 0x%x != 0; 0x%x in header ERROR\n", csum, + madt_header->header.checksum); + ++ if(buffer != buf) ++ free(buffer); ++ + return 0; + } + +-- +1.8.1.2 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/pmtools/pmtools_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/pmtools/pmtools_git.bb new file mode 100644 index 00000000..8491fc90 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/pmtools/pmtools_git.bb @@ -0,0 +1,34 @@ +DESCRIPTION = "This is a small collection of power management \ + test and investigation tools" +HOMEPAGE = "http://lesswatts.org/projects/acpi" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" + +PV = "20130209+git${SRCPV}" + +SRC_URI = "git://github.com/anyc/pmtools.git \ + file://pmtools-switch-to-dynamic-buffer-for-huge-ACPI-table.patch \ +" +SRCREV = "3ebe0e54c54061b4c627236cbe35d820de2e1168" + +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" + +S = "${WORKDIR}/git" + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "90" +ALTERNATIVE_${PN} = "acpixtract" + +do_configure[noexec] = "1" +do_compile() { + oe_runmake +} + +do_install() { + install -d ${D}${bindir} ${D}${docdir} + install -m 755 ${S}/acpidump/acpidump ${D}${bindir} + install -m 755 ${S}/acpixtract/acpixtract ${D}${bindir} + install -m 755 ${S}/madt/madt ${D}${bindir} + install -m 644 ${S}/README ${D}${docdir} +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf-c_1.3.1.bb b/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf-c_1.3.1.bb new file mode 100644 index 00000000..7ef03009 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf-c_1.3.1.bb @@ -0,0 +1,35 @@ +SUMMARY = "Protocol Buffers - structured data serialisation mechanism" +DESCRIPTION = "This is protobuf-c, a C implementation of the Google Protocol Buffers data \ +serialization format. It includes libprotobuf-c, a pure C library that \ +implements protobuf encoding and decoding, and protoc-c, a code generator that \ +converts Protocol Buffer .proto files to C descriptor code, based on the \ +original protoc. protobuf-c formerly included an RPC implementation; that code \ +has been split out into the protobuf-c-rpc project." +HOMEPAGE = "https://github.com/protobuf-c/protobuf-c" +SECTION = "console/tools" +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=cb901168715f4782a2b06c3ddaefa558" + +DEPENDS = "protobuf-native protobuf" + +PV .= "+git${SRCPV}" +SRCREV = "269771b4b45d3aba04e59569f53600003db8d9ff" + +SRC_URI = "git://github.com/protobuf-c/protobuf-c.git" + +S = "${WORKDIR}/git" + +#make sure c++11 is used +CXXFLAGS += "-std=c++11" +BUILD_CXXFLAGS += "-std=c++11" + +inherit autotools pkgconfig + +PACKAGE_BEFORE_PN = "${PN}-compiler" + +FILES_${PN}-compiler = "${bindir}" + +RDEPENDS_${PN}-compiler = "protobuf-compiler" +RDEPENDS_${PN}-dev += "${PN}-compiler" + +BBCLASSEXTEND = "native nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch b/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch new file mode 100644 index 00000000..a2f7a4b7 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch @@ -0,0 +1,33 @@ +From 52959e8e01e39139d18f752e97283e45b4b7a426 Mon Sep 17 00:00:00 2001 +From: Changqing Li <changqing.li@windriver.com> +Date: Wed, 18 Jul 2018 17:52:34 +0800 +Subject: [PATCH] protobuf: fix configure error + +fix below error: +gnu-configize: 'configure.ac' or 'configure.in' is required + +third_party/googletest is git submodule of protobuf. Above error +caused by missing submodule googletest. + +Upstream-Status: Inappropriate [oe-specific] + +Signed-off-by: Changqing Li <changqing.li@windriver.com> +--- + configure.ac | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index aec10cf..7fbe57d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -214,7 +214,6 @@ AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory]) + # too. + export CFLAGS + export CXXFLAGS +-AC_CONFIG_SUBDIRS([third_party/googletest]) + + AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc]) + AC_OUTPUT +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest b/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest new file mode 100644 index 00000000..7c3a8d1b --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest @@ -0,0 +1,38 @@ +#!/bin/bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +TEST_FILE="/tmp/test.data" + +RETVAL=0 +# Test every writing test application +for write_exe_full_path in ${DIR}/add_person_*; do + if [ -x "${write_exe_full_path}" ]; then + write_exe=`basename ${write_exe_full_path}` + echo "Generating new test file using ${write_exe}..." + ${write_exe_full_path} "${TEST_FILE}" + RETVAL=$? + [ $RETVAL -eq 0 ] || exit $RETVAL + + # Test every reading test application + for read_exe_full_path in ${DIR}/list_people_*; do + read_exe=`basename ${read_exe_full_path}` + echo "Test: Write with ${write_exe}; Read with ${read_exe}..." + if [ -x "${read_exe_full_path}" ]; then + ${read_exe_full_path} "${TEST_FILE}" + RETVAL=$? + [ $RETVAL -eq 0 ] || exit $RETVAL + fi + done + + # Cleanup... + if [ -e "${TEST_FILE}" ]; then + rm "${TEST_FILE}" + fi + fi +done + +if [ $RETVAL -eq 0 ] ; then + echo "PASS: protobuf" +else + echo "FAIL: protobuf" +fi + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb b/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb new file mode 100644 index 00000000..cf72d9ca --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb @@ -0,0 +1,93 @@ +SUMMARY = "Protocol Buffers - structured data serialisation mechanism" +DESCRIPTION = "Protocol Buffers are a way of encoding structured data in an \ +efficient yet extensible format. Google uses Protocol Buffers for almost \ +all of its internal RPC protocols and file formats." +HOMEPAGE = "https://github.com/google/protobuf" +SECTION = "console/tools" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=37b5762e07f0af8c74ce80a8bda4266b" + +DEPENDS = "zlib" +DEPENDS_append_class-target = " protobuf-native" + +PV .= "+git${SRCPV}" + +SRCREV = "48cb18e5c419ddd23d9badcfe4e9df7bde1979b2" + +SRC_URI = "git://github.com/google/protobuf.git;branch=3.6.x \ + file://run-ptest \ + file://0001-protobuf-fix-configure-error.patch \ +" +S = "${WORKDIR}/git" + +inherit autotools-brokensep pkgconfig ptest + +PACKAGECONFIG ??= "" +PACKAGECONFIG[python] = ",," + +EXTRA_OECONF += "--with-protoc=echo" + +TEST_SRC_DIR = "examples" +LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" + +do_compile_ptest() { + # Modify makefile to use the cross-compiler + sed -e "s|c++|${CXX} \$(LDFLAGS)|g" -i "${S}/${TEST_SRC_DIR}/Makefile" + + mkdir -p "${B}/${TEST_SRC_DIR}" + + # Add the location of the cross-compiled header and library files + # which haven't been installed yet. + cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc" + sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" + sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" + sed -e 's|Libs:|Libs: -L${B}/src/.libs|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" + export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}" + + # Save the pkgcfg sysroot variable, and update it to nothing so + # that it doesn't append the sysroot to the beginning of paths. + # The header and library files aren't installed to the target + # system yet. So the absolute paths were specified above. + save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR + export PKG_CONFIG_SYSROOT_DIR= + + # Compile the tests + for lang in ${LANG_SUPPORT}; do + oe_runmake -C "${S}/${TEST_SRC_DIR}" ${lang} + done + + # Restore the pkgconfig sysroot variable + export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir +} + +do_install_ptest() { + local olddir=`pwd` + + cd "${S}/${TEST_SRC_DIR}" + install -d "${D}/${PTEST_PATH}" + for i in add_person* list_people*; do + if [ -x "$i" ]; then + install "$i" "${D}/${PTEST_PATH}" + fi + done + cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}" + cd "$olddir" +} + +PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite" + +FILES_${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}" +FILES_${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" + +RDEPENDS_${PN}-compiler = "${PN}" +RDEPENDS_${PN}-dev += "${PN}-compiler" +RDEPENDS_${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python-protobuf', '', d)}" + +MIPS_INSTRUCTION_SET = "mips" + +BBCLASSEXTEND = "native nativesdk" + +LDFLAGS_append_arm = " -latomic" +LDFLAGS_append_mips = " -latomic" +LDFLAGS_append_powerpc = " -latomic" +LDFLAGS_append_mipsel = " -latomic" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/python/python-cpuset_1.5.7.bb b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-cpuset_1.5.7.bb new file mode 100644 index 00000000..156e52a3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-cpuset_1.5.7.bb @@ -0,0 +1,18 @@ +SUMMARY = "Cpuset is a Python application to make using the cpusets facilities in the Linux kernel easier" +SECTION = "devel/python" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +S = "${WORKDIR}/git" +SRCREV = "ae629aa1dc959342745ad97406adddf63bb6dbdd" +SRC_URI = "git://github.com/lpechacek/cpuset.git;protocol=https;" + +inherit distutils + +RDEPENDS_${PN} = "\ + python-core \ + python-re \ + python-logging \ + python-textutils \ + python-unixadmin \ + " diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.bb b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.bb new file mode 100644 index 00000000..eb84f743 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.bb @@ -0,0 +1,7 @@ +require python-distutils-extra.inc + +inherit setuptools + +RDEPENDS_${PN} = "\ + python-distutils \ +" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.inc b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.inc new file mode 100644 index 00000000..4d87d77c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.inc @@ -0,0 +1,13 @@ +SUMMARY = "python-distutils extension" +DESCRITION = "python-distutils extension integrating gettext support, themed icons and scrollkeeper based documentation" +HOMEPAGE = "https://launchpad.net/python-distutils-extra" +SECTION = "devel/python" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=4325afd396febcb659c36b49533135d4" + +PV = "2.39" +SRC_URI = "https://launchpad.net/python-distutils-extra/trunk/${PV}/+download/python-distutils-extra-${PV}.tar.gz" +SRC_URI[md5sum] = "16e06db0ef73a35b4bff4b9eed5699b5" +SRC_URI[sha256sum] = "723f24f4d65fc8d99b33a002fbbb3771d4cc9d664c97085bf37f3997ae8063af" + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/python/python-futures_3.2.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-futures_3.2.0.bb new file mode 100644 index 00000000..3ee945fc --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-futures_3.2.0.bb @@ -0,0 +1,13 @@ +DESCRIPTION = "The concurrent.futures module provides a high-level interface for asynchronously executing callables." +SECTION = "devel/python" +LICENSE = "PSF" +LIC_FILES_CHKSUM = "file://LICENSE;md5=834d982f973c48b6d662b5944c5ab567" +HOMEPAGE = "https://github.com/agronholm/pythonfutures" +DEPENDS = "python" + +SRC_URI[md5sum] = "d1b299a06b96ccb59f70324716dc0016" +SRC_URI[sha256sum] = "9ec02aa7d674acb8618afb127e27fde7fc68994c0437ad759fa094a574adb265" + +inherit pypi setuptools + +BBCLASSEXTEND = "native nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/python/python-pygobject_3.28.3.bb b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-pygobject_3.28.3.bb new file mode 100644 index 00000000..348a0398 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/python/python-pygobject_3.28.3.bb @@ -0,0 +1,31 @@ +SUMMARY = "Python GObject bindings" +HOMEPAGE = "http://www.pygtk.org/" +SECTION = "devel/python" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7" + +inherit gnomebase gobject-introspection distutils-base upstream-version-is-even + +DEPENDS += "python glib-2.0" + +SRCNAME = "pygobject" +SRC_URI = " \ + http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \ +" + +SRC_URI[md5sum] = "3bac63c86bb963aa401f97859464aa90" +SRC_URI[sha256sum] = "3dd3e21015d06e00482ea665fc1733b77e754a6ab656a5db5d7f7bfaf31ad0b0" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +BBCLASSEXTEND = "native" + +EXTRA_OECONF = "--disable-cairo" + +RDEPENDS_${PN} += "python-setuptools" +RDEPENDS_${PN}_class-native = "" + +do_install_append() { + # Remove files that clash with python3-pygobject; their content is same + rm -r ${D}${includedir}/pygobject-3.0/pygobject.h ${D}${libdir}/pkgconfig +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/python/python3-distutils-extra.bb b/external/meta-openembedded/meta-oe/recipes-devtools/python/python3-distutils-extra.bb new file mode 100644 index 00000000..5836b090 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/python/python3-distutils-extra.bb @@ -0,0 +1,9 @@ +require python-distutils-extra.inc + +inherit setuptools3 + +S = "${WORKDIR}/python-distutils-extra-${PV}" + +RDEPENDS_${PN} = "\ + python3-setuptools \ +" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch b/external/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch new file mode 100644 index 00000000..cf3e16ea --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch @@ -0,0 +1,40 @@ +From 827155e5e659b2a5065b00d701bc59b57feab2bf Mon Sep 17 00:00:00 2001 +From: Andre McCurdy <armccurdy@gmail.com> +Date: Mon, 19 Dec 2016 01:37:11 -0800 +Subject: [PATCH] remove -march=native from CMAKE_CXX_FLAGS + +Not appropriate when cross compiling. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Andre McCurdy <armccurdy@gmail.com> +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: git/CMakeLists.txt +=================================================================== +--- git.orig/CMakeLists.txt ++++ git/CMakeLists.txt +@@ -51,10 +51,10 @@ endif(CCACHE_FOUND) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "powerpc" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64le") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() + #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER. +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") + set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wsign-conversion) +@@ -84,7 +84,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "C + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native") + else() + #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER. +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers") + set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wimplicit-fallthrough -Weverything) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson_git.bb new file mode 100644 index 00000000..c90eab04 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson_git.bb @@ -0,0 +1,23 @@ +SUMMARY = "A fast JSON parser/generator for C++ with both SAX/DOM style API" +HOMEPAGE = "http://rapidjson.org/" +SECTION = "libs" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://license.txt;md5=ba04aa8f65de1396a7e59d1d746c2125" + +SRC_URI = "git://github.com/miloyip/rapidjson.git;nobranch=1" + +SRCREV = "6a905f9311f82d306da77bd963ec5aa5da07da9c" + +PV = "1.1.0+git${SRCPV}" + +S = "${WORKDIR}/git" + +inherit cmake + +EXTRA_OECMAKE += "-DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF" + +# RapidJSON is a header-only C++ library, so the main package will be empty. + +ALLOW_EMPTY_${PN} = "1" + +BBCLASSEXTEND = "native nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Add-option-to-enable-internal-loopback.patch b/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Add-option-to-enable-internal-loopback.patch new file mode 100644 index 00000000..f69254a2 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Add-option-to-enable-internal-loopback.patch @@ -0,0 +1,81 @@ +From 059d5512e840fe68e2bb37add6c9208fa9c34d15 Mon Sep 17 00:00:00 2001 +From: Sekhar Nori <nsekhar@ti.com> +Date: Tue, 24 Feb 2015 22:16:37 +0530 +Subject: [PATCH 1/2] Add option to enable internal loopback + +Upstream-status: Pending +--- + serialcheck.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/serialcheck.c b/serialcheck.c +index 4f5b747..4100c37 100644 +--- a/serialcheck.c ++++ b/serialcheck.c +@@ -12,6 +12,8 @@ + #include <sys/ioctl.h> + #include <linux/serial.h> + ++#define TIOCM_LOOP 0x8000 ++ + #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) + #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) + #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) +@@ -40,6 +42,7 @@ struct g_opt { + unsigned char hflow; + unsigned char do_termios; + unsigned char *cmp_buff; ++ unsigned char loopback; + }; + + /* name, key, arg, flags, doc, group */ +@@ -51,6 +54,7 @@ static struct argp_option options[] = { + {"mode", 'm', "M", 0, "transfer mode (d = duplex, t = send r = receive)", 0}, + {"loops", 'l', "NUM", 0, "loops to perform (0 => wait fot CTRL-C", 0}, + {"no-termios", 'n', NULL, 0, "No termios change (baud rate etc. remains unchanged)", 0}, ++ {"loopback", 'k', NULL, 0, "loopback mode", 0}, + {NULL, 0, NULL, 0, NULL, 0} + }; + +@@ -67,6 +71,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) + go->baudrate = 115200; + go->loops = UINT_MAX; + go->do_termios = 1; ++ go->loopback = 0; + break; + case ARGP_KEY_ARG: + ret = ARGP_ERR_UNKNOWN; +@@ -113,6 +118,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) + } else + go->loops = num; + break; ++ case 'k': ++ go->loopback = 1; ++ break; + default: + ret = ARGP_ERR_UNKNOWN; + } +@@ -487,6 +495,21 @@ int main(int argc, char *argv[]) + die("tcflush failed: %m\n"); + } + ++ if (opts.loopback) { ++ unsigned int mcr; ++ ++ ret = ioctl(fd, TIOCMGET, &mcr); ++ if (ret < 0) ++ die("mcr get failed: %m\n"); ++ ++ mcr |= TIOCM_LOOP; ++ ++ ret = ioctl(fd, TIOCMSET, &mcr); ++ if (ret < 0) ++ die ("mcr set failed: %m\n"); ++ ++ } ++ + ret = fcntl(fd, F_SETFL, 0); + if (ret) + printf("Failed to remove nonblock mode\n"); +-- +1.9.1 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Makefile-Change-order-of-link-flags.patch b/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Makefile-Change-order-of-link-flags.patch new file mode 100644 index 00000000..2ab48345 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck/0001-Makefile-Change-order-of-link-flags.patch @@ -0,0 +1,34 @@ +From efc8a4e717ba919c869c2da1c7de2d08bc976926 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 24 Feb 2016 18:48:07 +0000 +Subject: [PATCH] Makefile: Change order of link flags + +This helps in injectcting LDFLAGS from env to take effect +as it appears last on cmdline now + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + Makefile | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index ba2bfbb..6d13e68 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,3 +1,9 @@ +-CFLAGS=-O2 -Wall -Wextra -g -Wno-sign-compare -Wno-pointer-sign +-CC=gcc ++CFLAGS?=-O2 -Wall -Wextra -g -Wno-sign-compare -Wno-pointer-sign ++CC?=gcc + all: serialcheck ++serialcheck : serialcheck.o ++ $(CC) -o serialcheck serialcheck.o $(CFLAGS) $(LDFLAGS) ++ ++%.o : %.c ++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ ++ +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck/0002-Restore-original-loopback-config.patch b/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck/0002-Restore-original-loopback-config.patch new file mode 100644 index 00000000..1b8c95b1 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck/0002-Restore-original-loopback-config.patch @@ -0,0 +1,49 @@ +From a6e5813d2f8402bf3a311c8bcda02623bfb76882 Mon Sep 17 00:00:00 2001 +From: Carlos Hernandez <ceh@ti.com> +Date: Tue, 24 Feb 2015 16:00:34 -0500 +Subject: [PATCH 2/2] Restore original loopback config + +If loopback option is enabled, disable it at the end of the test. + +Signed-off-by: Carlos Hernandez <ceh@ti.com> +Upstream-status: Pending +--- + serialcheck.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/serialcheck.c b/serialcheck.c +index 4100c37..06470f7 100644 +--- a/serialcheck.c ++++ b/serialcheck.c +@@ -427,6 +427,7 @@ int main(int argc, char *argv[]) + unsigned char *data; + unsigned int open_mode; + off_t data_len; ++ unsigned int mcr; + + argp_parse(&argp, argc, argv, 0, NULL, &opts); + if (!opts.file_trans) +@@ -496,8 +497,6 @@ int main(int argc, char *argv[]) + } + + if (opts.loopback) { +- unsigned int mcr; +- + ret = ioctl(fd, TIOCMGET, &mcr); + if (ret < 0) + die("mcr get failed: %m\n"); +@@ -535,6 +534,12 @@ int main(int argc, char *argv[]) + ret = tcsetattr(fd, TCSAFLUSH, &old_term); + if (ret) + printf("tcsetattr() of old ones failed: %m\n"); ++ if (opts.loopback) { ++ mcr &= ~(TIOCM_LOOP); ++ ret = ioctl(fd, TIOCMSET, &mcr); ++ } ++ if (ret) ++ printf("disabling loopback failed: %m\n"); + + close(fd); + return status; +-- +1.9.1 diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck_1.0.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck_1.0.0.bb new file mode 100644 index 00000000..cd5e0a4e --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/serialcheck/serialcheck_1.0.0.bb @@ -0,0 +1,30 @@ +SUMMARY = "Application to verify operation of serial ports" +HOMEPAGE = "http://git.breakpoint.cc/cgit/bigeasy/serialcheck.git/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI = "git://git.breakpoint.cc/bigeasy/serialcheck.git \ + file://0001-Add-option-to-enable-internal-loopback.patch \ + file://0002-Restore-original-loopback-config.patch \ + file://0001-Makefile-Change-order-of-link-flags.patch \ + " + +SRCREV = "63854a2d0c0129efab132ec328a75279e013fb84" + +S = "${WORKDIR}/git" + +DEPENDS_append_libc-musl = " argp-standalone" +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +CFLAGS_prepend = "-Wall -Wextra -Wno-sign-compare -Wno-pointer-sign " +LDFLAGS_append_libc-musl = " -largp" + +do_install() { + install -d ${D}${bindir} + install ${S}/serialcheck ${D}${bindir} + install -d ${D}${docdir}/${BP} + install ${S}/Readme.txt ${D}${docdir}/${BP} +} +CLEANBROKEN = "1" + +BBCLASSEXTEND = "nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/sip/sip.inc b/external/meta-openembedded/meta-oe/recipes-devtools/sip/sip.inc new file mode 100644 index 00000000..d0795454 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/sip/sip.inc @@ -0,0 +1,36 @@ +SUMMARY = "SIP is a C++/Python Wrapper Generator" +HOMEPAGE = "http://www.riverbankcomputing.co.uk/sip" +SECTION = "devel" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://LICENSE-GPL2;md5=e91355d8a6f8bd8f7c699d62863c7303" + +SRC_URI = "${SOURCEFORGE_MIRROR}/project/pyqt/sip/sip-${PV}/sip-${PV}.tar.gz \ + " +SRC_URI[md5sum] = "9124cb8978742685747a5415179a9890" +SRC_URI[sha256sum] = "e353a7056599bf5fbd5d3ff9842a6ab2ea3cf4e0304a0f925ec5862907c0d15e" + +S = "${WORKDIR}/sip-${PV}" + +BBCLASSEXTEND = "native" + +do_configure_prepend_class-target() { + echo "py_platform = linux" > sip.cfg + echo "py_inc_dir = %(sysroot)/${includedir}/python${PYTHON_BASEVERSION}${PYTHON_ABI}" >> sip.cfg + echo "sip_bin_dir = ${D}/${bindir}" >> sip.cfg + echo "sip_inc_dir = ${D}/${includedir}" >> sip.cfg + echo "sip_module_dir = ${D}/${libdir}/python${PYTHON_BASEVERSION}${PYTHON_ABI}/site-packages" >> sip.cfg + echo "sip_sip_dir = ${D}/${datadir}/sip" >> sip.cfg + ${PYTHON} configure.py --configuration sip.cfg --sip-module PyQt5.sip --sysroot ${STAGING_DIR_HOST} CC="${CC}" CXX="${CXX}" LINK="${CXX}" STRIP="" LINK_SHLIB="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LFLAGS="${LDFLAGS}" +} +do_configure_prepend_class-native() { + echo "py_platform = linux" > sip.cfg + echo "py_inc_dir = ${includedir}/python${PYTHON_BASEVERSION}${PYTHON_ABI}" >> sip.cfg + echo "sip_bin_dir = ${D}/${bindir}" >> sip.cfg + echo "sip_inc_dir = ${D}/${includedir}" >> sip.cfg + echo "sip_module_dir = ${D}/${libdir}/python${PYTHON_BASEVERSION}${PYTHON_ABI}/site-packages" >> sip.cfg + echo "sip_sip_dir = ${D}/${datadir}/sip" >> sip.cfg + ${PYTHON} configure.py --configuration sip.cfg --sip-module PyQt5.sip --sysroot=${STAGING_DIR_NATIVE} +} +do_install() { + oe_runmake install +} diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/sip/sip3_4.19.13.bb b/external/meta-openembedded/meta-oe/recipes-devtools/sip/sip3_4.19.13.bb new file mode 100644 index 00000000..dc15bc2e --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/sip/sip3_4.19.13.bb @@ -0,0 +1,11 @@ +require sip.inc + +DEPENDS = "python3" + +inherit python3-dir python3native + +PACKAGES += "python3-sip3" + +FILES_python3-sip3 = "${libdir}/${PYTHON_DIR}${PYTHON_ABI}/site-packages/" +FILES_${PN}-dbg += "${libdir}/${PYTHON_DIR}${PYTHON_ABI}/site-packages/.debug" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/sip/sip_4.19.13.bb b/external/meta-openembedded/meta-oe/recipes-devtools/sip/sip_4.19.13.bb new file mode 100644 index 00000000..3da15b84 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/sip/sip_4.19.13.bb @@ -0,0 +1,11 @@ +require sip.inc + +DEPENDS = "python" + +inherit python-dir pythonnative + +PACKAGES += "python-sip" + +FILES_python-sip = "${libdir}/${PYTHON_DIR}/site-packages/" +FILES_${PN}-dbg += "${libdir}/${PYTHON_DIR}/site-packages/.debug" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/tclap/tclap/Makefile.am-disable-docs.patch b/external/meta-openembedded/meta-oe/recipes-devtools/tclap/tclap/Makefile.am-disable-docs.patch new file mode 100644 index 00000000..358cbefd --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/tclap/tclap/Makefile.am-disable-docs.patch @@ -0,0 +1,31 @@ +From c209ed0e7ffca32fe3714bad9cc54bdb00c286bb Mon Sep 17 00:00:00 2001 +From: Ting Liu <b28495@freescale.com> +Date: Mon, 15 Apr 2013 16:28:37 +0800 +Subject: [PATCH] Makefile.am: disable docs + +Upstream-Status: Inappropriate [OE specific] + +docs need some generating tool (for example, doxygen) from host which may +be not available. Disable it to avoid build issue. + +Signed-off-by: Ting Liu <b28495@freescale.com> +--- + Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 0a6ebc9..6b42f41 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,7 +1,7 @@ + + ACLOCAL_AMFLAGS = -I config + +-SUBDIRS = include examples docs tests msc config ++SUBDIRS = include examples tests msc config + + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = $(PACKAGE).pc +-- +1.7.5 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/tclap/tclap_1.2.2.bb b/external/meta-openembedded/meta-oe/recipes-devtools/tclap/tclap_1.2.2.bb new file mode 100644 index 00000000..46a94080 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/tclap/tclap_1.2.2.bb @@ -0,0 +1,16 @@ +SUMMARY = "Templatized C++ Command Line Parser" +HOMEPAGE = "http://tclap.sourceforge.net/" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=0ca8b9c5c5445cfa7af7e78fd27e60ed" + +SRCREV = "75f440bcac1276c847f5351e14216f6e91def44d" +SRC_URI = "git://git.code.sf.net/p/tclap/code \ + file://Makefile.am-disable-docs.patch \ +" + +S = "${WORKDIR}/git" +inherit autotools + +ALLOW_EMPTY_${PN} = "1" + +BBCLASSEXTEND = "native nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/configure.use.fontconfig.with.xft.patch b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/configure.use.fontconfig.with.xft.patch new file mode 100644 index 00000000..a0c157f5 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/configure.use.fontconfig.with.xft.patch @@ -0,0 +1,13 @@ +--- a/configure.in.orig 2014-05-10 14:35:39.859147385 +0000 ++++ b/configure.in 2014-05-10 14:36:20.282925184 +0000 +@@ -554,8 +554,8 @@ + dnl make sure package configurator (xft-config or pkg-config + dnl says that xft is present. + found_xft=yes +- XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" +- XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" ++ XFT_CFLAGS=`pkg-config --cflags xft fontconfig 2>/dev/null` || found_xft="no" ++ XFT_LIBS=`pkg-config --libs xft fontconfig 2>/dev/null` || found_xft="no" + AC_MSG_RESULT([$found_xft]) + dnl make sure that compiling against Xft header file doesn't bomb + if test "$found_xft" = "yes" ; then diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/confsearch.diff b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/confsearch.diff new file mode 100644 index 00000000..4dbd9a4f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/confsearch.diff @@ -0,0 +1,35 @@ +Patch by Sergei Golovan allows to find tclConfig.sh in /usr/share/tcltk/tcl8.5 +and tkConfig.sh in /usr/share/tcltk/tk8.5 where they are located in Debian +installation. + +--- tk8.5-8.5.8.orig/unix/configure ++++ tk8.5-8.5.8/unix/configure +@@ -1431,7 +1431,8 @@ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/pkg/lib 2>/dev/null` \ ++ `ls -d /usr/share/tcltk/tcl8.5 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + `ls -d /usr/lib64 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then +--- tk8.5-8.5.8.orig/unix/tcl.m4 ++++ tk8.5-8.5.8/unix/tcl.m4 +@@ -93,7 +93,8 @@ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/pkg/lib 2>/dev/null` \ ++ `ls -d /usr/share/tcltk/tcl8.5 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + `ls -d /usr/lib64 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then +@@ -223,7 +224,8 @@ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ ++ `ls -d /usr/share/tcltk/tk8.5 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + `ls -d /usr/lib64 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/fix-xft.diff b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/fix-xft.diff new file mode 100644 index 00000000..d1bb7105 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/fix-xft.diff @@ -0,0 +1,16 @@ +--- /tmp/configure.in 2010-05-19 13:29:03.000000000 +0200 ++++ unix/configure.in 2010-05-19 13:42:05.000000000 +0200 +@@ -526,13 +526,9 @@ + found_xft="yes" + dnl make sure package configurator (xft-config or pkg-config + dnl says that xft is present. +- XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" +- XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" +- if test "$found_xft" = "no" ; then + found_xft=yes + XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" + XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" +- fi + AC_MSG_RESULT([$found_xft]) + dnl make sure that compiling against Xft header file doesn't bomb + if test "$found_xft" = "yes" ; then diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/non-linux.diff b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/non-linux.diff new file mode 100644 index 00000000..7d31f9fd --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/non-linux.diff @@ -0,0 +1,27 @@ +Patch by Sergei Golovan (originally by Mike Markley and Chris Waters) fixes +building on non-linux Debian architectures. + +--- tk8.5-8.5.8.orig/unix/configure ++++ tk8.5-8.5.8/unix/configure +@@ -4447,6 +4447,9 @@ + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi ++ if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then ++ tcl_cv_sys_version=NetBSD-Debian ++ fi + fi + fi + +--- tk8.5-8.5.8.orig/unix/tcl.m4 ++++ tk8.5-8.5.8/unix/tcl.m4 +@@ -962,6 +962,9 @@ + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi ++ if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then ++ tcl_cv_sys_version=NetBSD-Debian ++ fi + fi + fi + ]) diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/tklibrary.diff b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/tklibrary.diff new file mode 100644 index 00000000..ee38c2a1 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/tklibrary.diff @@ -0,0 +1,22 @@ +--- tk8.5-8.5.8.orig/unix/configure ++++ tk8.5-8.5.8/unix/configure +@@ -11070,7 +11070,7 @@ + TCL_STUB_FLAGS="-DUSE_TCL_STUBS" + fi + +-TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' ++test -z "$TK_LIBRARY" && TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' + PRIVATE_INCLUDE_DIR='$(includedir)' + HTML_DIR='$(DISTDIR)/html' + TK_PKG_DIR='tk$(VERSION)' +--- tk8.5-8.5.8.orig/unix/configure.in ++++ tk8.5-8.5.8/unix/configure.in +@@ -607,7 +607,7 @@ + TCL_STUB_FLAGS="-DUSE_TCL_STUBS" + fi + +-TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' ++test -z "$TK_LIBRARY" && TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' + PRIVATE_INCLUDE_DIR='$(includedir)' + HTML_DIR='$(DISTDIR)/html' + TK_PKG_DIR='tk$(VERSION)' diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/tkprivate.diff b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/tkprivate.diff new file mode 100644 index 00000000..4e154697 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk/tkprivate.diff @@ -0,0 +1,41 @@ +Patch by Chris Waters sets path which are normally point to a directory +with Tk sources to a subdirectory of /usr/include/tcl8.4 (debian/rules +puts private Tk headers there). + +--- tk8.5-8.5.8.orig/unix/tkConfig.sh.in ++++ tk8.5-8.5.8/unix/tkConfig.sh.in +@@ -55,7 +55,7 @@ + + # String to pass to linker to pick up the Tk library from its + # build directory. +-TK_BUILD_LIB_SPEC='@TK_BUILD_LIB_SPEC@' ++TK_BUILD_LIB_SPEC='@TK_LIB_SPEC@' + + # String to pass to linker to pick up the Tk library from its + # installed directory. +@@ -71,7 +71,7 @@ + # different place than the directory containing the source files, this + # points to the location of the sources, not the location where Tk was + # compiled. +-TK_SRC_DIR='@TK_SRC_DIR@' ++TK_SRC_DIR='@includedir@/tk-private' + + # Needed if you want to make a 'fat' shared library library + # containing tk objects or link a different wish. +@@ -86,14 +86,14 @@ + + # String to pass to linker to pick up the Tk stub library from its + # build directory. +-TK_BUILD_STUB_LIB_SPEC='@TK_BUILD_STUB_LIB_SPEC@' ++TK_BUILD_STUB_LIB_SPEC='@TK_STUB_LIB_SPEC@' + + # String to pass to linker to pick up the Tk stub library from its + # installed directory. + TK_STUB_LIB_SPEC='@TK_STUB_LIB_SPEC@' + + # Path to the Tk stub library in the build directory. +-TK_BUILD_STUB_LIB_PATH='@TK_BUILD_STUB_LIB_PATH@' ++TK_BUILD_STUB_LIB_PATH='@TK_STUB_LIB_PATH@' + + # Path to the Tk stub library in the install directory. + TK_STUB_LIB_PATH='@TK_STUB_LIB_PATH@' diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk_8.6.8.bb b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk_8.6.8.bb new file mode 100644 index 00000000..4e38525c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk_8.6.8.bb @@ -0,0 +1,71 @@ +SUMMARY = "Tool Command Language ToolKit Extension" +HOMEPAGE = "http://tcl.sourceforge.net" +SECTION = "devel/tcltk" + +# http://www.tcl.tk/software/tcltk/license.html +LICENSE = "tcl" +LIC_FILES_CHKSUM = "file://../license.terms;md5=c88f99decec11afa967ad33d314f87fe \ + file://../compat/license.terms;md5=c88f99decec11afa967ad33d314f87fe \ + file://../doc/license.terms;md5=c88f99decec11afa967ad33d314f87fe \ + file://../library/license.terms;md5=c88f99decec11afa967ad33d314f87fe \ + file://../macosx/license.terms;md5=c88f99decec11afa967ad33d314f87fe \ + file://../tests/license.terms;md5=c88f99decec11afa967ad33d314f87fe \ + file://../unix/license.terms;md5=c88f99decec11afa967ad33d314f87fe \ + file://../win/license.terms;md5=c88f99decec11afa967ad33d314f87fe \ + file://../xlib/license.terms;md5=c88f99decec11afa967ad33d314f87fe \ +" + +DEPENDS = "tcl virtual/libx11 libxt" + +SRC_URI = "\ + ${SOURCEFORGE_MIRROR}/tcl/${BPN}${PV}-src.tar.gz \ + file://confsearch.diff;striplevel=2 \ + file://non-linux.diff;striplevel=2 \ + file://tklibrary.diff;striplevel=2 \ + file://tkprivate.diff;striplevel=2 \ + file://fix-xft.diff \ + file://configure.use.fontconfig.with.xft.patch \ +" +SRC_URI[md5sum] = "5e0faecba458ee1386078fb228d008ba" +SRC_URI[sha256sum] = "49e7bca08dde95195a27f594f7c850b088be357a7c7096e44e1158c7a5fd7b33" + +S = "${WORKDIR}/${BPN}${PV}/unix" + +# Short version format: "8.6" +VER = "${@os.path.splitext(d.getVar('PV'))[0]}" + +LDFLAGS += "-Wl,-rpath,${libdir}/tcltk/${PV}/lib" +inherit autotools distro_features_check +# depends on virtual/libx11 +REQUIRED_DISTRO_FEATURES = "x11" + +EXTRA_OECONF = "\ + --enable-threads \ + --with-x \ + --with-tcl=${STAGING_BINDIR}/crossscripts \ + --libdir=${libdir} \ +" +export TK_LIBRARY='${libdir}/tk${VER}' +do_install_append() { + ln -sf libtk${VER}.so ${D}${libdir}/libtk${VER}.so.0 + oe_libinstall -so libtk${VER} ${D}${libdir} + ln -sf wish${VER} ${D}${bindir}/wish +} + +PACKAGECONFIG ??= "xft" +PACKAGECONFIG[xft] = "--enable-xft,--disable-xft,xft" +PACKAGECONFIG[xss] = "--enable-xss,--disable-xss,libxscrnsaver libxext" + +PACKAGES =+ "${PN}-lib" + +FILES_${PN}-lib = "${libdir}/libtk${VER}.so*" +FILES_${PN} += "${libdir}/tk*" + +# isn't getting picked up by shlibs code +RDEPENDS_${PN} += "tk-lib" +RDEPENDS_${PN}_class-native = "" + +BBCLASSEXTEND = "native nativesdk" + +# Fix the path in sstate +SSTATE_SCAN_FILES += "*Config.sh" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/uftrace/uftrace/0001-include-dlfcn.h-for-RTLD_DEFAULT.patch b/external/meta-openembedded/meta-oe/recipes-devtools/uftrace/uftrace/0001-include-dlfcn.h-for-RTLD_DEFAULT.patch new file mode 100644 index 00000000..fe7aac93 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/uftrace/uftrace/0001-include-dlfcn.h-for-RTLD_DEFAULT.patch @@ -0,0 +1,39 @@ +From cdf7f2e394fcfb93a61f509ae3388f29540a6b35 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 8 Sep 2018 11:56:13 -0700 +Subject: [PATCH] include dlfcn.h for RTLD_DEFAULT + +Fixes +plthook.c:128:41: error: use of undeclared identifier 'RTLD_DEFAULT' + +Upstream-Status: Submitted [https://github.com/namhyung/uftrace/pull/487] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libmcount/plthook.c | 1 + + utils/debug.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/libmcount/plthook.c b/libmcount/plthook.c +index d9d84f0..d54f5e8 100644 +--- a/libmcount/plthook.c ++++ b/libmcount/plthook.c +@@ -6,6 +6,7 @@ + #include <sys/mman.h> + #include <pthread.h> + #include <assert.h> ++#include <dlfcn.h> + + /* This should be defined before #include "utils.h" */ + #define PR_FMT "mcount" +diff --git a/utils/debug.c b/utils/debug.c +index 2134b09..5460def 100644 +--- a/utils/debug.c ++++ b/utils/debug.c +@@ -13,6 +13,7 @@ + #include <assert.h> + #include <limits.h> + #include <inttypes.h> ++#include <dlfcn.h> + + #include "utils/utils.h" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/uftrace/uftrace_0.8.3.bb b/external/meta-openembedded/meta-oe/recipes-devtools/uftrace/uftrace_0.8.3.bb new file mode 100644 index 00000000..ca38e6aa --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/uftrace/uftrace_0.8.3.bb @@ -0,0 +1,44 @@ +SUMMARY = "Trace and analyze execution of a program written in C/C++" +HOMEPAGE = "https://github.com/namhyung/uftrace" +BUGTRACKER = "https://github.com/namhyung/uftrace/issues" +SECTION = "devel" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +DEPENDS = "elfutils" +DEPENDS_append_libc-musl = " argp-standalone" + +inherit autotools + +# v0.8.3 +SRCREV = "8b723a6fae2ef30495cd6279774fba9c95cd9c88" +SRC_URI = "git://github.com/namhyung/${BPN} \ + file://0001-include-dlfcn.h-for-RTLD_DEFAULT.patch \ + " +S = "${WORKDIR}/git" + +LDFLAGS_append_libc-musl = " -largp" + +def set_target_arch(d): + import re + arch = d.getVar('TARGET_ARCH', True) + if re.match(r'i.86', arch, re.I): + return 'i386' + else: + return arch + +EXTRA_UFTRACE_OECONF = "ARCH=${@set_target_arch(d)} \ + with_elfutils=/use/libelf/from/sysroot" + +do_configure() { + ${S}/configure ${EXTRA_UFTRACE_OECONF} +} + +FILES_SOLIBSDEV = "" +FILES_${PN} += "${libdir}/*.so" + +COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm)" + +# uftrace supports armv6 and above +COMPATIBLE_HOST_armv4 = 'null' +COMPATIBLE_HOST_armv5 = 'null' diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/0001-Support-OpenSSL-1.1.patch b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/0001-Support-OpenSSL-1.1.patch new file mode 100644 index 00000000..d5610bbc --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/0001-Support-OpenSSL-1.1.patch @@ -0,0 +1,71 @@ +From 4c684542816a08b95444b8e2515f24d084e6e3c3 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 4 Sep 2018 22:05:17 -0700 +Subject: [PATCH] Support OpenSSL 1.1 + +When building with OpenSSL 1.1 and newer, use the new built-in + hostname verification instead of code that doesn't compile due to + structs having been made opaque. +Bug-Debian: https://bugs.debian.org/828589 + +Upstream-Status: Unknown + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/osdep/unix/ssl_unix.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/src/osdep/unix/ssl_unix.c b/src/osdep/unix/ssl_unix.c +index 3bfdff3..dec9467 100644 +--- a/src/osdep/unix/ssl_unix.c ++++ b/src/osdep/unix/ssl_unix.c +@@ -227,8 +227,16 @@ static char *ssl_start_work (SSLSTREAM *stream,char *host,unsigned long flags) + /* disable certificate validation? */ + if (flags & NET_NOVALIDATECERT) + SSL_CTX_set_verify (stream->context,SSL_VERIFY_NONE,NIL); +- else SSL_CTX_set_verify (stream->context,SSL_VERIFY_PEER,ssl_open_verify); ++ else { ++#if OPENSSL_VERSION_NUMBER >= 0x10100000 ++ X509_VERIFY_PARAM *param = SSL_CTX_get0_param(stream->context); ++ X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); ++ X509_VERIFY_PARAM_set1_host(param, host, 0); ++#endif ++ ++ SSL_CTX_set_verify (stream->context,SSL_VERIFY_PEER,ssl_open_verify); + /* set default paths to CAs... */ ++ } + SSL_CTX_set_default_verify_paths (stream->context); + /* ...unless a non-standard path desired */ + if (s = (char *) mail_parameters (NIL,GET_SSLCAPATH,NIL)) +@@ -266,6 +274,7 @@ static char *ssl_start_work (SSLSTREAM *stream,char *host,unsigned long flags) + if (SSL_write (stream->con,"",0) < 0) + return ssl_last_error ? ssl_last_error : "SSL negotiation failed"; + /* need to validate host names? */ ++#if OPENSSL_VERSION_NUMBER < 0x10100000 + if (!(flags & NET_NOVALIDATECERT) && + (err = ssl_validate_cert (cert = SSL_get_peer_certificate (stream->con), + host))) { +@@ -275,6 +284,7 @@ static char *ssl_start_work (SSLSTREAM *stream,char *host,unsigned long flags) + sprintf (tmp,"*%.128s: %.255s",err,cert ? cert->name : "???"); + return ssl_last_error = cpystr (tmp); + } ++#endif + return NIL; + } + +@@ -313,6 +323,7 @@ static int ssl_open_verify (int ok,X509_STORE_CTX *ctx) + * Returns: NIL if validated, else string of error message + */ + ++#if OPENSSL_VERSION_NUMBER < 0x10100000 + static char *ssl_validate_cert (X509 *cert,char *host) + { + int i,n; +@@ -342,6 +353,7 @@ static char *ssl_validate_cert (X509 *cert,char *host) + else ret = "Unable to locate common name in certificate"; + return ret; + } ++#endif + + /* Case-independent wildcard pattern match + * Accepts: base string diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007e-shared.patch b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007e-shared.patch new file mode 100644 index 00000000..4434e839 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007e-shared.patch @@ -0,0 +1,82 @@ +Fix linking libraries built with -fPIC with this library + +Patch borrowed from Fedora + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> + +Upstream-Status: Pending + +diff -up imap-2007e/src/osdep/unix/Makefile.shared imap-2007e/src/osdep/unix/Makefile +--- imap-2007e/src/osdep/unix/Makefile.shared 2009-07-07 19:28:02.909755512 -0500 ++++ imap-2007e/src/osdep/unix/Makefile 2009-07-07 19:29:35.870006799 -0500 +@@ -170,6 +170,10 @@ BUILD=$(MAKE) build EXTRACFLAGS='$(EXTRA + EXTRADRIVERS='$(EXTRADRIVERS)' EXTRAAUTHENTICATORS='$(EXTRAAUTHENTICATORS)'\ + PASSWDTYPE=$(PASSWDTYPE) SSLTYPE=$(SSLTYPE) IP=$(IP) + ++# Need this for the shared library rule to work correctly ++.SUFFIXES: .o .so ++SOFILES=${BINARIES:.o=.so} ++ + + # Here if no make argument established + +@@ -845,18 +849,24 @@ vu2: # VAX Ultrix 2.3, etc. + + # Build it! + +-build: clean once $(ARCHIVE) ++build: clean once $(ARCHIVE) $(SHLIBNAME) + +-all: $(ARCHIVE) ++all: $(ARCHIVE) $(SHLIBNAME) + + $(ARCHIVE): $(BINARIES) + sh -c '$(RM) $(ARCHIVE) || true' + @$(CAT) ARCHIVE + @$(SH) ARCHIVE + +-.c.o: +- `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c ++$(SHLIBNAME): $(SOFILES) ++ gcc -shared -Wl,-soname,$(SHLIBNAME) -o $(SHLIBNAME) $(SOFILES) `cat LDFLAGS` ++ ln -s $(SHLIBNAME) lib$(SHLIBBASE).so + ++.c.so: osdep.h ++ $(CC) -fPIC -DPIC -D_REENTRANT -c `$(CAT) CFLAGS` ${@:.so=.c} -o $@ ++ ++.c.o: ++ $(CC) -fPIC -DPIC -D_REENTRANT -c `$(CAT) CFLAGS` $*.c + + # Cleanup + +@@ -895,8 +905,7 @@ utf8aux.o: mail.h misc.h osdep.h utf8.h + + + # OS-dependent +- +-osdep.o:mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \ ++OSDEPS= mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \ + osdep.h env_unix.h tcp_unix.h \ + osdep.c env_unix.c fs_unix.c ftl_unix.c nl_unix.c tcp_unix.c ip_unix.c\ + auths.c crexcl.c flockcyg.c flocklnx.c flocksim.c fsync.c \ +@@ -910,12 +919,19 @@ osdep.o:mail.h misc.h env.h fs.h ftl.h n + write.c sslstdio.c \ + strerror.c strpbrk.c strstr.c strtok.c strtoul.c \ + OSCFLAGS ++ ++osdep.o: $(OSDEPS) ++ $(CC) -fPIC -DPIC -D_REENTRANT `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c ++ @echo ======================================================================== + @echo Building OS-dependent module + @echo If you get No such file error messages for files x509.h, ssl.h, + @echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL + @echo is not installed on your system. Either install OpenSSL first + @echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none +- `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c ++ @echo ======================================================================== ++ ++osdep.so: $(OSDEPS) ++ $(CC) -fPIC -DPIC -D_REENTRANT `$(CAT) CFLAGS` `cat OSCFLAGS` -c osdep.c -o $@ + + osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c + $(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007f-format-security.patch b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007f-format-security.patch new file mode 100644 index 00000000..6ec04761 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/imap-2007f-format-security.patch @@ -0,0 +1,20 @@ +Fix error found with "-Werror=format-security" flag + +Patch borrowed from Fedora + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> + +Upstream-Status: Pending + +diff -Naur imap-2007f.orig/src/osdep/unix/flocklnx.c imap-2007f/src/osdep/unix/flocklnx.c +--- imap-2007f.orig/src/osdep/unix/flocklnx.c 2011-07-23 02:20:11.000000000 +0200 ++++ imap-2007f/src/osdep/unix/flocklnx.c 2014-04-14 19:17:46.429000000 +0200 +@@ -57,7 +57,7 @@ + case ENOLCK: /* lock table is full */ + sprintf (tmp,"File locking failure: %s",strerror (errno)); + mm_log (tmp,WARN); /* give the user a warning of what happened */ +- if (!logged++) syslog (LOG_ERR,tmp); ++ if (!logged++) syslog (LOG_ERR, "%s", tmp); + /* return failure if non-blocking lock */ + if (op & LOCK_NB) return -1; + sleep (5); /* slow down in case it loops */ diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/quote_cctype.patch b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/quote_cctype.patch new file mode 100644 index 00000000..f729ee20 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap/quote_cctype.patch @@ -0,0 +1,12 @@ +diff -urN imap-2007.orig/Makefile imap-2007/Makefile +--- imap-2007.orig/Makefile 2007-12-20 23:11:10.000000000 +0100 ++++ imap-2007/Makefile 2008-03-19 14:08:47.000000000 +0100 +@@ -690,7 +690,7 @@ + @$(SH) -c '(test $(BUILDTYPE) = rebuild -o $(BUILDTYPE) = `$(CAT) OSTYPE`) || (echo Already built for `$(CAT) OSTYPE` -- you must do \"make clean\" first && exit 1)' + @echo Rebuilding c-client for `$(CAT) OSTYPE`... + @$(TOUCH) SPECIALS +- $(CD) c-client;$(MAKE) all CC=`$(CAT) CCTYPE` \ ++ $(CD) c-client;$(MAKE) all CC="`$(CAT) CCTYPE`" \ + CFLAGS="`$(CAT) CFLAGS`" `$(CAT) SPECIALS` + + rebuildclean: diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb new file mode 100644 index 00000000..0000f05a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb @@ -0,0 +1,45 @@ +SUMMARY = "UW c-client library for mail protocols" +SECTION = "devel" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a6a4ddbb7cd2999f6827ee143f6fcd97" + +DEPENDS = "openssl virtual/crypt" + +SRC_URI = "https://fossies.org/linux/misc/old/imap-${PV}.tar.gz \ + file://quote_cctype.patch \ + file://imap-2007e-shared.patch \ + file://imap-2007f-format-security.patch \ + file://0001-Support-OpenSSL-1.1.patch \ + " + +SRC_URI[md5sum] = "2126fd125ea26b73b20f01fcd5940369" +SRC_URI[sha256sum] = "53e15a2b5c1bc80161d42e9f69792a3fa18332b7b771910131004eb520004a28" + +S = "${WORKDIR}/imap-${PV}" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" +PACKAGECONFIG[pam] = ",,libpam" + +EXTRA_OEMAKE = "CC='${CC}' ARRC='${AR} -rc' RANLIB='${RANLIB}'" + +HEADERS = "src/c-client/*.h src/osdep/unix/*.h c-client/auths.c c-client/linkage.c c-client/linkage.h c-client/osdep.h" + +do_compile() { + echo "SSLINCLUDE=${STAGING_INCDIR} SSLLIB=${STAGING_LIBDIR}" > ${S}/SPECIALS + oe_runmake ${@bb.utils.contains('PACKAGECONFIG', 'pam', 'lnp', 'slx', d)} +} + +do_install() { + install -d ${D}${includedir}/c-client + install ${HEADERS} ${D}${includedir}/c-client + install -d ${D}${libdir} + install c-client/c-client.a ${D}${libdir}/libc-client.a +} + +RPROVIDES_${PN} = "libc-client" +RREPLACES_${PN} = "libc-client" +RCONFLICTS_${PN} = "libc-client" + +ALLOW_EMPTY_${PN} = "1" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/valijson/valijson_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/valijson/valijson_git.bb new file mode 100644 index 00000000..c3254d16 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/valijson/valijson_git.bb @@ -0,0 +1,21 @@ +SUMMARY = "Header-only C++ library for JSON Schema validation" +HOMEPAGE = "https://github.com/tristanpenman/valijson" +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=015106c62262b2383f6c72063f0998f2" + +SRC_URI = "git://github.com/tristanpenman/valijson.git" +PV = "0.1+git${SRCPV}" + +SRCREV = "c2f22fddf599d04dc33fcd7ed257c698a05345d9" + +S = "${WORKDIR}/git" + +inherit cmake + +EXTRA_OECMAKE = "-DINSTALL_HEADERS=1 -DBUILD_TESTS=0" + +# valijson is a header only C++ library, so the main package will be empty. +RDEPENDS_${PN}-dev = "" + +BBCLASSEXTEND = "native nativesdk" + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/xerces-c/xerces-c_3.1.4.bb b/external/meta-openembedded/meta-oe/recipes-devtools/xerces-c/xerces-c_3.1.4.bb new file mode 100644 index 00000000..0951307c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/xerces-c/xerces-c_3.1.4.bb @@ -0,0 +1,44 @@ +SUMMARY = "Xerces-c is a validating xml parser written in C++" +DESCRIPTION = "Xerces-C++ makes it easy to give your application \ + the ability to read and write XML data. \ + A shared library is provided for parsing, generating, \ + manipulating, and validating XML documents using \ + the DOM, SAX, and SAX2 APIs." +HOMEPAGE = "http://xerces.apache.org/xerces-c/" +SECTION = "libs" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" + +SRC_URI = "http://archive.apache.org/dist/xerces/c/3/sources/${BP}.tar.bz2" +SRC_URI[md5sum] = "d04ae9d8b2dee2157c6db95fa908abfd" +SRC_URI[sha256sum] = "9408f12c1628ecf80730bedbe8b2caad810edd01bb4c66f77b60c873e8cc6891" + +inherit autotools + +PACKAGECONFIG ??= "curl icu" +PACKAGECONFIG[curl] = "--with-curl=${STAGING_DIR_TARGET}${prefix},--with-curl=no,curl" +PACKAGECONFIG[icu] = "--with-icu=${STAGING_DIR_TARGET}${prefix},--with-icu=no,icu" + +do_install_prepend () { + sed -i -e 's:-L${STAGING_DIR}/lib:-L\$\{libdir\}:g' ${B}/xerces-c.pc +} + +PACKAGES = "libxerces-c \ + libxerces-c-dev \ + xerces-c-samples \ + libxerces-c-staticdev \ + ${PN}-dbg \ +" + +RPROVIDES_${PN}-dbg += "libxerces-c-dbg xerces-c-samples-dbg" + +FILES_libxerces-c = "${libdir}/libxerces-c-3.1.so" +FILES_libxerces-c-dev = "${libdir}/lib*.la \ + ${libdir}/libxerces-c.so \ + ${libdir}/pkgconfig/xerces-c.pc \ + ${includedir}/xercesc \ +" +FILES_xerces-c-samples = "${bindir}/*" +FILES_libxerces-c-staticdev = "${libdir}/lib*.a" + +BBCLASSEXTEND = "native" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-compile-failure-against-musl-C-library.patch b/external/meta-openembedded/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-compile-failure-against-musl-C-library.patch new file mode 100644 index 00000000..234d696f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-fix-compile-failure-against-musl-C-library.patch @@ -0,0 +1,52 @@ +From 950b27f8320b841490cafcb3e6e3b818c7174c0d Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Thu, 20 Jul 2017 22:32:50 -0400 +Subject: [PATCH] fix compile failure against musl C library + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + test/cpp/server_abyss.cpp | 2 +- + tools/xmlrpc_pstream/xmlrpc_pstream.cpp | 10 +++++++--- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/test/cpp/server_abyss.cpp b/test/cpp/server_abyss.cpp +index 2458a8f..82f91da 100644 +--- a/test/cpp/server_abyss.cpp ++++ b/test/cpp/server_abyss.cpp +@@ -18,7 +18,7 @@ + #ifdef WIN32 + #include <winsock2.h> + #else +- #include <sys/unistd.h> ++ #include <unistd.h> + #include <sys/socket.h> + #include <arpa/inet.h> + #include <netinet/in.h> +diff --git a/tools/xmlrpc_pstream/xmlrpc_pstream.cpp b/tools/xmlrpc_pstream/xmlrpc_pstream.cpp +index d39e105..1fd8900 100644 +--- a/tools/xmlrpc_pstream/xmlrpc_pstream.cpp ++++ b/tools/xmlrpc_pstream/xmlrpc_pstream.cpp +@@ -15,11 +15,15 @@ + #include "xmlrpc-c/girerr.hpp" + using girerr::throwf; + +-#include <features.h> // for __BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + +-__BEGIN_DECLS + #include "dumpvalue.h" /* An internal Xmlrpc-c header file ! */ +-__END_DECLS ++ ++#ifdef __cplusplus ++} ++#endif + + + #include <xmlrpc-c/base.hpp> +-- +2.8.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0002-fix-formatting-issues.patch b/external/meta-openembedded/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0002-fix-formatting-issues.patch new file mode 100644 index 00000000..9d92e471 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0002-fix-formatting-issues.patch @@ -0,0 +1,34 @@ +From 14f15cb0f03defa8efb4c8e2fece58e50655be6b Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Sun, 23 Jul 2017 22:20:29 -0400 +Subject: [PATCH] src/xmlrpc_server_abyss.c: fix formatting issues + +Fixed when compile with "-Wformat -Wformat-security -Werror=format-security": +|src/xmlrpc_server_abyss.c:771:13: error: format not a string literal +and no format arguments [-Werror=format-security] +| xmlrpc_faultf(envP, error); +| ^~~~~~~~~~~~~ + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + src/xmlrpc_server_abyss.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/xmlrpc_server_abyss.c b/src/xmlrpc_server_abyss.c +index 2388652..3843f10 100644 +--- a/src/xmlrpc_server_abyss.c ++++ b/src/xmlrpc_server_abyss.c +@@ -768,7 +768,7 @@ createServer(xmlrpc_env * const envP, + ServerInit2(abyssServerP, &error); + + if (error) { +- xmlrpc_faultf(envP, error); ++ xmlrpc_faultf(envP, "%s", error); + xmlrpc_strfree(error); + } + } +-- +2.8.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c_1.31.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c_1.31.0.bb new file mode 100644 index 00000000..efa58f19 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c_1.31.0.bb @@ -0,0 +1,24 @@ +DESCRIPTION = "XML-RPC for C/C++ is programming libraries and related tools to help you \ +write an XML-RPC server or client in C or C++." + +HOMEPAGE = "http://xmlrpc-c.sourceforge.net/" +LICENSE = "BSD & MIT" +LIC_FILES_CHKSUM = "file://doc/COPYING;md5=aefbf81ba0750f02176b6f86752ea951" + +SRC_URI = "git://github.com/ensc/xmlrpc-c.git;branch=master \ + file://0001-fix-compile-failure-against-musl-C-library.patch \ + file://0002-fix-formatting-issues.patch \ +" +SRCREV = "81443a9dc234cc275449dbc17867ad77ae189124" +S = "${WORKDIR}/git" + +DEPENDS = "curl libxml2" +RDEPENDS_${PN} = "curl perl" + +inherit cmake + +EXTRA_OECMAKE = "-D_lib:STRING=${baselib}" + +BBCLASSEXTEND = "native" + +TARGET_CFLAGS += "-Wno-narrowing" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_1.0.12.bb b/external/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_1.0.12.bb new file mode 100644 index 00000000..8ced7b84 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_1.0.12.bb @@ -0,0 +1,19 @@ +SUMMARY = "Yet Another JSON Library." + +DESCRIPTION = "YAJL is a small event-driven (SAX-style) JSON parser \ +written in ANSI C, and a small validating JSON generator." + +HOMEPAGE = "http://lloyd.github.com/yajl/" + +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=da2e9aa80962d54e7c726f232a2bd1e8" + +# Use 1.0.12 tag +SRCREV = "17b1790fb9c8abbb3c0f7e083864a6a014191d56" +SRC_URI = "git://github.com/lloyd/yajl;nobranch=1" + +inherit cmake lib_package + +S = "${WORKDIR}/git" + +EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb b/external/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb new file mode 100644 index 00000000..d9a5821c --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb @@ -0,0 +1,18 @@ +SUMMARY = "Yet Another JSON Library." + +DESCRIPTION = "YAJL is a small event-driven (SAX-style) JSON parser \ +written in ANSI C, and a small validating JSON generator." + +HOMEPAGE = "http://lloyd.github.com/yajl/" + +LICENSE = "ISC" +LIC_FILES_CHKSUM = "file://COPYING;md5=39af6eb42999852bdd3ea00ad120a36d" + +SRC_URI = "git://github.com/lloyd/yajl" +SRCREV = "a0ecdde0c042b9256170f2f8890dd9451a4240aa" + +S = "${WORKDIR}/git" + +inherit cmake lib_package + +EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}" diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/yasm/yasm_git.bb b/external/meta-openembedded/meta-oe/recipes-devtools/yasm/yasm_git.bb new file mode 100644 index 00000000..b20d4c05 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/yasm/yasm_git.bb @@ -0,0 +1,22 @@ +SUMMARY = "x86 (SSE) assembler supporting NASM and GAS-syntaxes" +LICENSE = "BSD" +HOMEPAGE = "http://www.tortall.net/projects/yasm/" + +LIC_FILES_CHKSUM = "file://COPYING;md5=a12d8903508fb6bfd49d8d82c6170dd9" + +DEPENDS += "flex-native bison-native xmlto-native" + +PV = "1.3.0+git${SRCPV}" +# v1.3.0 +SRCREV = "ba463d3c26c0ece2e797b8d6381b161633b5971a" +SRC_URI = "git://github.com/yasm/yasm.git" + +S = "${WORKDIR}/git" + +inherit autotools gettext pythonnative + +CACHED_CONFIGUREVARS = "CCLD_FOR_BUILD='${CC_FOR_BUILD}'" + +BBCLASSEXTEND = "native" + +PARALLEL_MAKE = "" |