diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-25 22:55:05 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-03-15 14:22:49 +0000 |
commit | d7bf8c17eca8f8c89898a7794462c773c449e983 (patch) | |
tree | d18618fca85ca5f0c077032cc7b009344b60f663 /import-layers/meta-openembedded/meta-oe/recipes-kernel | |
parent | e2b5abdc9f28cdf8578e5b9be803c8e697443c20 (diff) | |
download | talos-openbmc-d7bf8c17eca8f8c89898a7794462c773c449e983.tar.gz talos-openbmc-d7bf8c17eca8f8c89898a7794462c773c449e983.zip |
Yocto 2.4
Move OpenBMC to Yocto 2.4(rocko)
Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/meta-openembedded/meta-oe/recipes-kernel')
23 files changed, 1132 insertions, 226 deletions
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb new file mode 100644 index 000000000..8e370f962 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb @@ -0,0 +1,25 @@ +SUMMARY = "Proxy for UDP/TCP debug connections" +DESCRIPTION = "The agent-proxy will forward tcp or udp connections as well as allow for script multiplexing of terminal sessions." +HOMEPAGE = "http://kgdb.wiki.kernel.org/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a" + +SECTION = "devel" + +EXTRA_OEMAKE = "'CC=${CC}'" + +SRCREV = "e6c9d3d996bd55e7ab14dbd74deb7841e0c3a4f1" +PV = "1.96+git${SRCPV}" + +SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git;protocol=git \ + file://0001-Makefile-Add-LDFLAGS-variable.patch \ +" + +BBCLASSEXTEND = "native nativesdk" + +S = "${WORKDIR}/git" + +do_install () { + install -d ${D}${bindir} + install -m 0755 agent-proxy ${D}${bindir} +} diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch new file mode 100644 index 000000000..5eec91d72 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch @@ -0,0 +1,43 @@ +From 1beb0dad6f8b99eb3bf1b9982e0b49e81ff77bbc Mon Sep 17 00:00:00 2001 +From: Jackie Huang <jackie.huang@windriver.com> +Date: Wed, 23 Nov 2016 19:17:31 +0800 +Subject: [PATCH] Makefile: Add LDFLAGS variable + +Add LDFLAGS variable to make sure the extra linkder +flags can be passed. + +Upstream-Status: Pending + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index e20918f..25d92d3 100644 +--- a/Makefile ++++ b/Makefile +@@ -51,7 +51,7 @@ $(CROSS_COMPILE)agent-proxy: $(OBJS) + $(CC) -DAGENT_VER=$(AGENTVER) $(LINKFLAGS) $(CFLAGS) -o $(extpath)$@ $(OBJS) wsock32.lib + else + $(CROSS_COMPILE)agent-proxy: $(OBJS) +- $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) -o $(extpath)$@ $(OBJS) $(LDLIBS) ++ $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) $(LDFLAGS) -o $(extpath)$@ $(OBJS) $(LDLIBS) + endif + + +@@ -61,9 +61,9 @@ clean: + rm -f $(extpath)$(CROSS_COMPILE)agent-proxy $(extpath)agent-proxy $(extpath)*.o $(extpath)*.obj $(extpath)*.exp $(extpath)*.exe $(extpath)*.ilk $(extpath)*.pdb *~ + + $(extpath)$(CROSS_COMPILE)%.o::%.c +- $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) -c $< -o $@ ++ $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) $(LDFLAGS) -c $< -o $@ + + $(extpath)%.obj:%.c +- $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) -c -Fo$@ $(TLSPATH_INC) $< ++ $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) $(LDFLAGS) -c -Fo$@ $(TLSPATH_INC) $< + + +-- +2.8.3 + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb new file mode 100644 index 000000000..c963c8ef9 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb @@ -0,0 +1,36 @@ +SUMMARY = "Shows and sets processor power related values" +DESCRIPTION = "cpupower is a collection of tools to examine and tune power \ +saving related features of your processor." +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" +DEPENDS = "pciutils" +PROVIDES = "virtual/cpupower" + +inherit kernelsrc kernel-arch + +do_populate_lic[depends] += "virtual/kernel:do_patch" + +EXTRA_OEMAKE = "-C ${S}/tools/power/cpupower O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH}" + +do_configure[depends] += "virtual/kernel:do_shared_workdir" + +do_compile() { + oe_runmake +} + +do_install() { + oe_runmake DESTDIR=${D} install + # Do not ship headers + rm -rf ${D}${includedir} + chown -R root:root ${D} +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +RDEPENDS_${PN} = "bash" + +python do_package_prepend() { + d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0]) +} + +B = "${WORKDIR}/${BPN}-${PV}" diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-Fix-for-a-compilation-error-if-glibc-2.25-or-later-h.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-Fix-for-a-compilation-error-if-glibc-2.25-or-later-h.patch deleted file mode 100644 index 9434815d8..000000000 --- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-Fix-for-a-compilation-error-if-glibc-2.25-or-later-h.patch +++ /dev/null @@ -1,112 +0,0 @@ -From b8c8fbe0a2481e97fc57dd596346827a692a5768 Mon Sep 17 00:00:00 2001 -From: Dave Anderson <anderson@redhat.com> -Date: Tue, 28 Mar 2017 15:44:40 -0400 -Subject: [PATCH 1/3] Fix for a compilation error if glibc-2.25 or later has - been installed on the host build machine. Without the patch, the build fails - with the error message "amd64-linux-nat.c:496:1: error: conflicting types for - 'ps_get_thread_area'". (anderson@redhat.com) - -Upstream-Status: Backport - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - Makefile | 6 +++++ - configure.c | 2 +- - gdb-7.6-proc_service.h.patch | 55 ++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 62 insertions(+), 1 deletion(-) - create mode 100644 gdb-7.6-proc_service.h.patch - -diff --git a/Makefile b/Makefile -index 202ef8b..b6b7e80 100644 ---- a/Makefile -+++ b/Makefile -@@ -264,6 +264,12 @@ gdb_patch: - if [ "${ARCH}" = "x86_64" ] && [ "${TARGET}" = "PPC64" ] && [ -f ${GDB}-ppc64le-support.patch ]; then \ - patch -d ${GDB} -p1 -F0 < ${GDB}-ppc64le-support.patch ; \ - fi -+ if [ -f /usr/include/proc_service.h ]; then \ -+ grep 'extern ps_err_e ps_get_thread_area (struct' /usr/include/proc_service.h; \ -+ if [ $$? -eq 0 ]; then \ -+ patch -p0 < ${GDB}-proc_service.h.patch; \ -+ fi; \ -+ fi - - library: make_build_data ${OBJECT_FILES} - ar -rs ${PROGRAM}lib.a ${OBJECT_FILES} -diff --git a/configure.c b/configure.c -index d63cdd7..776defe 100644 ---- a/configure.c -+++ b/configure.c -@@ -240,7 +240,7 @@ struct supported_gdb_version { - "7.6", - "GDB_FILES=${GDB_7.6_FILES}", - "GDB_OFILES=${GDB_7.6_OFILES}", -- "GDB_PATCH_FILES=gdb-7.6.patch gdb-7.6-ppc64le-support.patch", -+ "GDB_PATCH_FILES=gdb-7.6.patch gdb-7.6-ppc64le-support.patch gdb-7.6-proc_service.h.patch", - "GDB_FLAGS=-DGDB_7_6", - "GPLv3" - }, -diff --git a/gdb-7.6-proc_service.h.patch b/gdb-7.6-proc_service.h.patch -new file mode 100644 -index 0000000..49d18bb ---- /dev/null -+++ b/gdb-7.6-proc_service.h.patch -@@ -0,0 +1,55 @@ -+--- gdb-7.6/gdb/gdb_proc_service.h.orig -++++ gdb-7.6/gdb/gdb_proc_service.h -+@@ -115,7 +115,7 @@ extern pid_t ps_getpid (struct ps_procha -+ /* Fetch the special per-thread address associated with the given LWP. -+ This call is only used on a few platforms (most use a normal register). -+ The meaning of the `int' parameter is machine-dependent. */ -+-extern ps_err_e ps_get_thread_area (const struct ps_prochandle *, -++extern ps_err_e ps_get_thread_area (struct ps_prochandle *, -+ lwpid_t, int, psaddr_t *); -+ -+ -+--- gdb-7.6/gdb/amd64-linux-nat.c.orig -++++ gdb-7.6/gdb/amd64-linux-nat.c -+@@ -493,7 +493,7 @@ amd64_linux_new_fork (struct lwp_info *p -+ a request for a thread's local storage address. */ -+ -+ ps_err_e -+-ps_get_thread_area (const struct ps_prochandle *ph, -++ps_get_thread_area (struct ps_prochandle *ph, -+ lwpid_t lwpid, int idx, void **base) -+ { -+ if (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 32) -+--- gdb-7.6/gdb/aarch64-linux-nat.c.orig -++++ gdb-7.6/gdb/aarch64-linux-nat.c -+@@ -750,7 +750,7 @@ aarch64_linux_new_fork (struct lwp_info -+ storage (or its descriptor). */ -+ -+ ps_err_e -+-ps_get_thread_area (const struct ps_prochandle *ph, -++ps_get_thread_area (struct ps_prochandle *ph, -+ lwpid_t lwpid, int idx, void **base) -+ { -+ struct iovec iovec; -+--- gdb-7.6/gdb/arm-linux-nat.c.orig -++++ gdb-7.6/gdb/arm-linux-nat.c -+@@ -613,7 +613,7 @@ supply_fpregset (struct regcache *regcac -+ /* Fetch the thread-local storage pointer for libthread_db. */ -+ -+ ps_err_e -+-ps_get_thread_area (const struct ps_prochandle *ph, -++ps_get_thread_area (struct ps_prochandle *ph, -+ lwpid_t lwpid, int idx, void **base) -+ { -+ if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) -+--- gdb-7.6/gdb/i386-linux-nat.c.orig -++++ gdb-7.6/gdb/i386-linux-nat.c -+@@ -849,7 +849,7 @@ i386_linux_new_fork (struct lwp_info *pa -+ storage (or its descriptor). */ -+ -+ ps_err_e -+-ps_get_thread_area (const struct ps_prochandle *ph, -++ps_get_thread_area (struct ps_prochandle *ph, -+ lwpid_t lwpid, int idx, void **base) -+ { -+ /* NOTE: cagney/2003-08-26: The definition of this buffer is found --- -2.8.1 - diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.9.bb index 9c31f5e1a..d40937e93 100644 --- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.8.bb +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.9.bb @@ -10,7 +10,7 @@ SECTION = "devel" LICENSE = "GPLv3" LIC_FILES_CHKSUM = "file://COPYING3;md5=d32239bcb673463ab874e80d47fae504" -DEPENDS = "zlib readline" +DEPENDS = "zlib readline coreutils-native" SRC_URI = "https://github.com/crash-utility/${BPN}/archive/${PV}.tar.gz;downloadfilename=${BP}.tar.gz \ http://ftp.gnu.org/gnu/gdb/gdb-7.6.tar.gz;name=gdb;subdir=${BP} \ @@ -22,14 +22,12 @@ SRC_URI = "https://github.com/crash-utility/${BPN}/archive/${PV}.tar.gz;download file://donnot-extract-gdb-during-do-compile.patch \ file://gdb_build_jobs_and_not_write_crash_target.patch \ file://remove-unrecognized-gcc-option-m32-for-mips.patch \ - file://0001-Fix-for-a-compilation-error-if-glibc-2.25-or-later-h.patch \ file://0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch \ file://0003-crash-detect-the-sysroot-s-glibc-header-file.patch \ file://0004-crash-fix-build-failure-with-mips.patch \ " - -SRC_URI[md5sum] = "31787074f267a3536eebff008a0652ec" -SRC_URI[sha256sum] = "9965dee9199d7e39764fbee7f21c7c45b1f7b6d17c8e92ad62f468f062876478" +SRC_URI[md5sum] = "f3b44a151dbe7046462b9caaa9847ca6" +SRC_URI[sha256sum] = "c48e1269443a6a8e8337e328b21b03e4e50248f607eed83fbb27eb0d833d6aa4" SRC_URI[gdb.md5sum] = "a9836707337e5f7bf76a009a8904f470" SRC_URI[gdb.sha256sum] = "8070389a5dcc104eb0be483d582729f98ed4d761ad19cedd3f17b5d2502faa36" diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap-module_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap-module_git.bb deleted file mode 100644 index 1119d4c90..000000000 --- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap-module_git.bb +++ /dev/null @@ -1,22 +0,0 @@ -# Released under the MIT license (see COPYING.MIT for the terms) - -require ktap.inc - -SUMMARY = "KTAP is a scripting dynamic tracing tool for Linux" - -inherit module - -# See https://github.com/ktap/ktap/issues/80 -PNBLACKLIST[ktap-module] ?= "Not compatible with 3.19 kernel - the recipe will be removed on 2017-09-01 unless the issue is fixed" - -# Only build the module -MAKE_TARGETS = "mod" - -# Kernel module packages MUST begin with 'kernel-module-', otherwise -# multilib image generation can fail. -# -# The following line is only necessary if the recipe name does not begin -# with kernel-module-. -# -PKG_${PN} = "kernel-module-${PN}" - diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap.inc b/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap.inc deleted file mode 100644 index c214a020d..000000000 --- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap.inc +++ /dev/null @@ -1,26 +0,0 @@ -# Released under the MIT license (see COPYING.MIT for the terms) - -HOMEPAGE = "http://www.ktap.org" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://LICENSE-GPL;md5=eb723b61539feef013de476e68b5c50a" - -PV = "0.4+gitr${SRCPV}" -SRCREV = "c8401e07c89cdec9a5f673da4ddb12b7982b522b" -SRC_URI = "git://github.com/ktap/ktap.git" - -S = "${WORKDIR}/git" - -# Package config is abused as a general compile time configuration tool. - -# Only supports x86_64 for now!. Needs to be enabled for ktap-module too. -PACKAGECONFIG[ffi] = "" - -# Needed to resolve symbols in DSO and for sdt -PACKAGECONFIG[libelf] = ",,elfutils" - -PACKAGECONFIG ?= "libelf" - -EXTRA_OEMAKE = " \ - ${@bb.utils.contains('PACKAGECONFIG', 'libelf', '', 'NO_LIBELF=1', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'ffi', 'FFI=1', '', d)} \ -" diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap_git.bb deleted file mode 100644 index a947b7fcc..000000000 --- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap_git.bb +++ /dev/null @@ -1,19 +0,0 @@ -# Released under the MIT license (see COPYING.MIT for the terms) - -require ktap.inc - -SUMMARY = "KTAP is a scripting dynamic tracing tool for Linux" -DEPENDS = "ktap-module" - -PNBLACKLIST[ktap] ?= "Depends on blacklisted kernel-module-ktapvm - the recipe will be removed on 2017-09-01 unless the issue is fixed" - -# Only build the userspace app -EXTRA_OEMAKE += "ktap" - -do_install() { - install -d ${D}${bindir} - install -m 0755 ${S}/ktap ${D}${bindir}/ -} - -PACKAGE_ARCH = "${MACHINE_ARCH}" -RRECOMMENDS_${PN} = "kernel-module-ktapvm" diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-Add-proper-format-string-to-print-a-str.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-Add-proper-format-string-to-print-a-str.patch deleted file mode 100644 index 056a0bade..000000000 --- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-Add-proper-format-string-to-print-a-str.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0fff28f31aef9ad1d5a817216a3c98ba9d605106 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Mon, 19 Jun 2017 23:52:14 -0700 -Subject: [PATCH] makedumpfile: Add proper format string to print a string - -Fix -makedumpfile.c: In function 'write_eraseinfo': -makedumpfile.c:8273:4: error: format not a string literal and no format arguments [-Werror=format-security] - DEBUG_MSG(obuf); - ^~~~~~~~~ -makedumpfile.c:8273:4: error: format not a string literal and no format arguments [-Werror=format-security] - -Upstream-Status: Pending - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - makedumpfile.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/makedumpfile.c b/makedumpfile.c -index e69b6df..8b8a6b0 100644 ---- a/makedumpfile.c -+++ b/makedumpfile.c -@@ -8270,7 +8270,7 @@ write_eraseinfo(struct cache_data *cd_page, unsigned long *size_out) - } - sprintf(obuf, "erase %s %s", erase_info[i].symbol_expr, - size_str); -- DEBUG_MSG(obuf); -+ DEBUG_MSG("%s", obuf); - if (!write_cache(cd_page, obuf, strlen(obuf))) - goto out; - size_eraseinfo += strlen(obuf); --- -2.13.1 - diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.2.bb index 83bbf7f41..d6f2d807e 100644 --- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.1.bb +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.2.bb @@ -24,10 +24,9 @@ SRC_URI = "\ ${SOURCEFORGE_MIRROR}/makedumpfile/${BPN}-${PV}.tar.gz \ file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \ file://0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch \ - file://0001-makedumpfile-Add-proper-format-string-to-print-a-str.patch \ " -SRC_URI[md5sum] = "16c0ae9902ae57be4a603a6ab1e86c53" -SRC_URI[sha256sum] = "0b6e73106998670407887de9e1a505b3a2dbb2fb517a4b968a665eda8fb097ce" +SRC_URI[md5sum] = "72be5bf973eed898c5127e3abc466583" +SRC_URI[sha256sum] = "ee3d21cb4032a60bd2c802d1d8b21b9f399710e1574f8de8ead5ab50cd821a6d" SECTION = "base" diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch new file mode 100644 index 000000000..6ba6ad481 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch @@ -0,0 +1,32 @@ +From 883f53ee33eaef8aca1288a110857402ad362966 Mon Sep 17 00:00:00 2001 +From: John Ogness <john.ogness@linutronix.de> +Date: Fri, 8 Sep 2017 15:03:03 -0700 +Subject: [PATCH] fix compile error on arch=x32 + +On the x32 architecture time_t is a "long long int". By + typecasting time_t to "long long", this should work correctly + for all architectures. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + src/minicoredumper/corestripper.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/minicoredumper/corestripper.c b/src/minicoredumper/corestripper.c +index fd39bfb..07dc318 100644 +--- a/src/minicoredumper/corestripper.c ++++ b/src/minicoredumper/corestripper.c +@@ -1241,7 +1241,7 @@ static int dump_compressed_tar(struct dump_info *di) + snprintf(hdr.mode, sizeof(hdr.mode), "%07o", 0644); + snprintf(hdr.uid, sizeof(hdr.uid), "%07o", 0); + snprintf(hdr.gid, sizeof(hdr.gid), "%07o", 0); +- snprintf(hdr.mtime, sizeof(hdr.mtime), "%011lo", ++ snprintf(hdr.mtime, sizeof(hdr.mtime), "%011llo", + (long long)time(NULL)); + memset(hdr.checksum, ' ', sizeof(hdr.checksum)); + hdr.type = 'S'; +-- +2.14.1 + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch new file mode 100644 index 000000000..ad255fae0 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch @@ -0,0 +1,29 @@ +From 6181d9c3c407ee030b4c3a94045318b9e3a3cc89 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 25 Jul 2017 14:08:54 -0700 +Subject: [PATCH] minicoredumper: Initialize pointer to config struct to null + +Fixes +corestripper.c:3632:13: error: variable 'cfg' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/minicoredumper/corestripper.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/minicoredumper/corestripper.c b/src/minicoredumper/corestripper.c +index a764073..ddb0d25 100644 +--- a/src/minicoredumper/corestripper.c ++++ b/src/minicoredumper/corestripper.c +@@ -3605,7 +3605,7 @@ out: + + static int do_all_dumps(struct dump_info *di, int argc, char *argv[]) + { +- struct config *cfg; ++ struct config *cfg = 0; + const char *recept; + bool live_dumper; + char *comm_base; +-- +2.13.3 + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb index 58cd45a53..1858e102d 100644 --- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb @@ -1,7 +1,7 @@ SUMMARY = "minicoredumper provides an alternate core dump facility for Linux \ to allow minimal and customized crash dumps" LICENSE = " LGPLv2.1 & BSD-2-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=709087c2ed0acda54a4d91497a889e42 \ +LIC_FILES_CHKSUM = "file://COPYING;md5=aa846ae365f71b69e9fa0d21a56391ec \ file://COPYING.BSD;md5=b915ac80d5236d6aa659cb986daf00e5 \ file://COPYING.LGPLv2.1;md5=321bf41f280cf805086dd5a720b37785 \ " @@ -9,14 +9,16 @@ DEPENDS = "elfutils dbus dbus-glib-native glib-2.0 dbus-glib util-linux json-c" inherit autotools pkgconfig systemd update-rc.d -SRCREV = "248019446ccf6079926efb54f8b6dd7be769bbae" +SRCREV = "cdc1faf1212a51e89b477468876e229223fceb9a" PR .= "+git${SRCPV}" -SRC_URI = "git://github.com/Linutronix/minicoredumper-debian;branch=unstable \ +SRC_URI = "git://git.linuxfoundation.org/diamon/minicoredumper.git;protocol=http \ file://minicoredumper.service \ file://minicoredumper.init \ -" + file://0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch \ + file://0001-fix-compile-error-on-arch-x32.patch \ + " S = "${WORKDIR}/git" diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc new file mode 100644 index 000000000..4b01654fa --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc @@ -0,0 +1,65 @@ +SUMMARY = "System-Wide Profiler" +DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \ +of profiling all running code at low overhead." +HOMEPAGE = "http://oprofile.sourceforge.net/news/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=16191&atid=116191" + +LICENSE = "LGPLv2.1+ & GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://libopagent/opagent.h;beginline=5;endline=26;md5=4f16f72c7a493d8a4704aa18d03d15c6 \ + " +SECTION = "devel" + +DEPENDS = "popt binutils" +RDEPENDS_${PN} = "binutils-symlinks" +RRECOMMENDS_${PN} = "kernel-vmlinux" + +FILES_${PN} = "${bindir} ${libdir}/${BPN}/lib*${SOLIBS} ${datadir}/${BPN}" +FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/lib*.la" +FILES_${PN}-staticdev += "${libdir}/${BPN}/lib*.a" + +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ + file://acinclude.m4 \ + file://automake-foreign.patch \ + file://oprofile-cross-compile-tests.patch \ + file://run-ptest \ + file://root-home-dir.patch \ + file://0001-Add-rmb-definition-for-NIOS2-architecture.patch \ + file://0001-Fix-FTBFS-problem-with-GCC-6.patch \ +" +UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\d+(\.\d+)+)/" +UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/" + +SRC_URI_append_libc-musl = " file://musl.patch" + +inherit autotools pkgconfig ptest + +EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC=" +do_configure () { + cp ${WORKDIR}/acinclude.m4 ${S}/ + autotools_do_configure +} + +EXTRA_OEMAKE = "SRCDIR=${PTEST_PATH}/libutil++/tests" +do_compile_ptest() { + oe_runmake check +} + +do_install_ptest() { + subdirs="libdb/tests libutil++/tests libregex/tests libutil/tests libop/tests libdb/tests " + for tooltest in ${subdirs} + do + find ${tooltest} -perm /u=x -type f| cpio -pvdu ${D}${PTEST_PATH} + done + + # needed by some libop tests + cp -r events ${D}${PTEST_PATH} + + # needed by libregex regex_test + cp libregex/stl.pat ${D}${PTEST_PATH}/libregex + cp libregex/tests/mangled-name ${D}${PTEST_PATH}/libregex/tests + + # needed by litutil++ file_manip_tests + cp ${S}/libutil++/tests/file_manip_tests.cpp \ + libutil++/tests/file_manip_tests.o ${D}${PTEST_PATH}/libutil++/tests +} diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch new file mode 100644 index 000000000..ae8562a23 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch @@ -0,0 +1,30 @@ +From 34b0d9b1a32fb404a30327a7ae8931c7c75583bf Mon Sep 17 00:00:00 2001 +From: Marek Vasut <marex@denx.de> +Date: Tue, 9 Feb 2016 02:00:29 +0100 +Subject: [PATCH] Add rmb() definition for NIOS2 architecture + +Signed-off-by: Marek Vasut <marex@denx.de> +Upstream-Status: Submitted [ http://marc.info/?l=oprofile-list&m=145501915931874&w=2 ] +--- + libperf_events/operf_utils.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libperf_events/operf_utils.h b/libperf_events/operf_utils.h +index 32954cc..8270e53 100644 +--- a/libperf_events/operf_utils.h ++++ b/libperf_events/operf_utils.h +@@ -178,6 +178,11 @@ void op_release_resources(void); + #define cpu_relax() asm volatile("" ::: "memory") + #endif + ++#ifdef __nios2__ ++#define rmb() asm volatile("" ::: "memory") ++#define cpu_relax() asm volatile("" ::: "memory") ++#endif ++ + #ifdef __tile__ + #include <asm/unistd.h> + #define rmb() __insn_mf() +-- +2.7.0 + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch new file mode 100644 index 000000000..d372fd527 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch @@ -0,0 +1,51 @@ +From 39d4d46a0bd504ac708ffe72df87bf74cd12ad30 Mon Sep 17 00:00:00 2001 +From: William Cohen <wcohen@redhat.com> +Date: Fri, 5 Feb 2016 17:30:19 -0500 +Subject: [PATCH] Fix FTBFS problem with GCC-6 + +GCC-6 is pickier about some of the type conversions causing the Fedora +24 mass rebuild the build of oprofile failed with: + +make[3]: Entering directory '/builddir/build/BUILD/oprofile-1.1.0/libutil++' +g++ -DHAVE_CONFIG_H -I. -I.. -I ../libutil -I ../libop -I ../libpp -W -Wall -fno-common -ftemplate-depth-50 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -c -o op_bfd.o op_bfd.cpp +op_bfd.cpp: In member function 'void op_bfd::get_symbol_range(symbol_index_t, long long unsigned int&, long long unsigned int&) const': +op_bfd.cpp:538:47: error: cannot convert 'std::ostream {aka std::basic_ostream<char>}' to 'const bool' in initialization + bool const verbose = cverb << (vbfd & vlevel1); + ^ +op_bfd.cpp:546:7: error: in argument to unary ! + if (!verbose) + ^~~~~~~ + +Avoid the intermediate bool type to make GCC-6 happy. + +Signed-off-by: William Cohen <wcohen@redhat.com> +--- +Upstream-Status: Backport + + libutil++/op_bfd.cpp | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/libutil++/op_bfd.cpp b/libutil++/op_bfd.cpp +index 389c920..f2eb42b 100644 +--- a/libutil++/op_bfd.cpp ++++ b/libutil++/op_bfd.cpp +@@ -535,15 +535,13 @@ void op_bfd::get_symbol_range(symbol_index_t sym_idx, + { + op_bfd_symbol const & sym = syms[sym_idx]; + +- bool const verbose = cverb << (vbfd & vlevel1); +- + if (anon_obj) + start = sym.vma(); + else + start = sym.filepos(); + end = start + sym.size(); + +- if (!verbose) ++ if (!(cverb << (vbfd & vlevel1))) + return; + + io_state state(cverb << (vbfd & vlevel1)); +-- +1.9.1 + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4 b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4 new file mode 100644 index 000000000..95ecd91b5 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4 @@ -0,0 +1,581 @@ +dnl AX_KERNEL_OPTION(option, action-if-found, action-if-not-found) +dnl see if autoconf.h defines the option +AC_DEFUN([AX_KERNEL_OPTION], [ +SAVE_CFLAGS=$CFLAGS +CFLAGS="-I$KINC -O2 -D__KERNEL__" +AC_TRY_COMPILE( [#include <linux/config.h>], +[ +#ifndef $1 +break_me_hard(\\\); +#endif +],[$2],[$3],) +CFLAGS=$SAVE_CFLAGS +]) + +dnl Handle the 2.4 module inside module/ +AC_DEFUN([AX_CONFIG_MODULE], +[ +if test ! -f $KINC/linux/autoconf.h; then + AC_MSG_ERROR([no suitably configured kernel include tree found]) +fi + +dnl --- Get Linux kernel version and compile parameters --- + +AC_SUBST(KVERS) +AC_MSG_CHECKING([for kernel version]) +dnl it's like this to handle mandrake's fubar version.h - bug #471448 +eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'` +AC_MSG_RESULT([$KVERS]) +case "$KVERS" in +2.2.*|2.4.*) ;; +*) AC_MSG_ERROR([Unsupported kernel version]) +esac + +dnl Check for the minimal kernel version supported +AC_MSG_CHECKING([kernel version]) +AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section])) + +dnl linux/spinlock.h added at some point in past +AC_MSG_CHECKING([for $KINC/linux/spinlock.h]) +if test -f $KINC/linux/spinlock.h; then + EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +AC_MSG_CHECKING([for rtc_lock]) +gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null +if test "$?" -eq 0; then + EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +arch="unknown" +AC_MSG_CHECKING(for x86-64 architecture) +AX_KERNEL_OPTION(CONFIG_X86_64, x8664=1, x8664=0) +AX_MSG_RESULT_YN($x8664) +BUILD_HAMMER=no +if test "$x8664" -eq 1; then + arch="x86" + BUILD_HAMMER=yes +else + AC_MSG_CHECKING(for x86 architecture) + AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0) + AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86) + AX_MSG_RESULT_YN($x86) + test "$x86" = 1 && arch="x86" + + if test "$arch" = "unknown"; then + AC_MSG_CHECKING(for ia64 architecture) + AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0) + AX_MSG_RESULT_YN($ia64) + test "$ia64" = 1 && arch="ia64" + fi + +fi +AC_SUBST(BUILD_HAMMER) + +test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture) + +dnl check to see if kernel verion appropriate for arch +AC_MSG_CHECKING(arch/kernel version combination) +case "$arch" in +ia64) + AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]), + AC_MSG_ERROR([unsupported arch/kernel])) ;; +*) AC_MSG_RESULT([ok]) +esac + +dnl for now we do not support PREEMPT patch +AC_MSG_CHECKING([for preempt patch]) +AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0) +AX_MSG_RESULT_YN([$preempt]) +test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT]) + +AC_SUBST(KINC) + +MODINSTALLDIR=/lib/modules/$KVERS + +OPROFILE_MODULE_ARCH=$arch +AC_SUBST(OPROFILE_MODULE_ARCH) +] +) + +dnl AX_MSG_RESULT_YN(a) +dnl results "yes" iff a==1, "no" else +AC_DEFUN([AX_MSG_RESULT_YN], [x=no +test "x$1" = "x1" && x=yes +AC_MSG_RESULT($x)]) + +dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc)) +AC_DEFUN([AX_MALLOC_ATTRIBUTE], +[ +AC_MSG_CHECKING([whether malloc attribute is understood]) +SAVE_CFLAGS=$CFLAGS +CFLAGS="-Werror $CFLAGS" +AC_TRY_COMPILE(,[ +void monkey() __attribute__((malloc)); +],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no])) +CFLAGS=$SAVE_CFLAGS +] +) + +dnl builtin_expect is used in module we can't add that in config.h +AC_DEFUN([AX_BUILTIN_EXPECT], +[ +AC_MSG_CHECKING([whether __builtin_expect is understood]) +SAVE_CFLAGS=$CFLAGS +CFLAGS="-Werror $CFLAGS" +AC_TRY_LINK(,[ +int i; +if (__builtin_expect(i, 0)) { } +], +AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK", +AC_MSG_RESULT([no]);) +CFLAGS=$SAVE_CFLAGS +] +) + +dnl AX_EXTRA_DIRS - Let user specify extra dirs for include/libs +AC_DEFUN([AX_EXTRA_DIRS], +[ +AC_ARG_WITH(extra-includes, +[ --with-extra-includes=DIR add extra include paths], + use_extra_includes="$withval", + use_extra_includes=NO +) +if test -n "$use_extra_includes" && \ + test "$use_extra_includes" != "NO"; then + ac_save_ifs=$IFS + IFS=':' + for dir in $use_extra_includes; do + extra_includes="$extra_includes -I$dir" + done + IFS=$ac_save_ifs + CPPFLAGS="$CPPFLAGS $extra_includes" +fi + +AC_ARG_WITH(extra-libs, +[ --with-extra-libs=DIR add extra library paths], + use_extra_libs=$withval, + use_extra_libs=NO +) +if test -n "$use_extra_libs" && \ + test "$use_extra_libs" != "NO"; then + ac_save_ifs=$IFS + IFS=':' + for dir in $use_extra_libs; do + extra_libraries="$extra_libraries -L$dir" + done + IFS=$ac_save_ifs + LDFLAGS="$LDFLAGS $extra_libraries" +fi +] +) + +dnl AX_POPT_CONST - check popt prototype +AC_DEFUN([AX_POPT_CONST], +[ +AC_MSG_CHECKING([popt prototype]) +SAVE_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-Werror $CXXFLAGS" +AC_TRY_COMPILE([#include <popt.h>], +[ +int c; char **v; +poptGetContext(0, c, v, 0, 0); +], +AC_MSG_RESULT([takes char **]);, +AC_MSG_RESULT([takes const char **]); AC_DEFINE(CONST_POPT, 1, [whether popt prototype takes a const char **])) +CXXFLAGS="$SAVE_CXXFLAGS" +] +) + +dnl AX_CHECK_SSTREAM - check if local sstream is needed to compile OK +AC_DEFUN([AX_CHECK_SSTREAM], +[ +AC_MSG_CHECKING([whether to use included sstream]) +AC_TRY_COMPILE([#include <sstream>], [], +AC_MSG_RESULT([no]);, +AC_MSG_RESULT([yes]); OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include") +] +) + +dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false) +dnl exec action-if-true if typedef_name is a typedef to type else exec +dnl action-if-false +dnl currently work only with type typedef'ed in stddef.h +AC_DEFUN([AX_CHECK_TYPEDEF], [ +dnl AC_LANG_PUSH(C) not in autoconf 2.13 +AC_LANG_SAVE +AC_LANG_C +SAVE_CFLAGS=$CFLAGS +CFLAGS="-Werror $CFLAGS" + +AC_TRY_COMPILE( + [ + #include <stddef.h> + ], + [ + typedef void (*fct1)($1); + typedef void (*fct2)($2); + fct1 f1 = 0; + fct2 f2 = 0; + if (f1 == f2) {} + ], +[$3],[$4]) + +CFLAGS=$SAVE_CFLAGS +AC_LANG_RESTORE +]) + + +dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name) +dnl set var_name to the typedef name of $1 which must be in canditate_list +dnl else produce a fatal error +AC_DEFUN([AX_TYPEDEFED_NAME], [ + AC_MSG_CHECKING([type of $1]) + for f in $2; do + AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="") + if test -n "${$3}"; then + break + fi + done + if test -n "${$3}"; then + AC_MSG_RESULT([${$3}]) + else + AC_MSG_ERROR([not found]) + fi +]) + +dnl find a binary in the path +AC_DEFUN([QT_FIND_PATH], +[ + AC_MSG_CHECKING([for $1]) + AC_CACHE_VAL(qt_cv_path_$1, + [ + qt_cv_path_$1="NONE" + if test -n "$$2"; then + qt_cv_path_$1="$$2"; + else + dirs="$3" + qt_save_IFS=$IFS + IFS=':' + for dir in $PATH; do + dirs="$dirs $dir" + done + IFS=$qt_save_IFS + + for dir in $dirs; do + if test -x "$dir/$1"; then + if test -n "$5"; then + evalstr="$dir/$1 $5 2>&1 " + if eval $evalstr; then + qt_cv_path_$1="$dir/$1" + break + fi + else + qt_cv_path_$1="$dir/$1" + break + fi + fi + done + fi + ]) + + if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then + AC_MSG_RESULT(not found) + $4 + else + AC_MSG_RESULT($qt_cv_path_$1) + $2=$qt_cv_path_$1 + fi +]) + +dnl Find the uic compiler on the path or in qt_cv_dir +AC_DEFUN([QT_FIND_UIC], +[ + QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin) + if test -z "$ac_uic" -a "$FATAL" = 1; then + AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !]) + fi +]) + +dnl Find the right moc in path/qt_cv_dir +AC_DEFUN([QT_FIND_MOC], +[ + QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin) + QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin) + + if test -n "$ac_moc1" -a -n "$ac_moc2"; then + dnl found both. Prefer Qt3's if it exists else moc2 + $ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null + if test "$?" = 0; then + ac_moc=$ac_moc1; + else + ac_moc=$ac_moc2; + fi + else + if test -n "$ac_moc1"; then + ac_moc=$ac_moc1; + else + ac_moc=$ac_moc2; + fi + fi + + if test -z "$ac_moc" -a "$FATAL" = 1; then + AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !]) + fi +]) + +dnl check a particular libname +AC_DEFUN([QT_TRY_LINK], +[ + SAVE_LIBS="$LIBS" + LIBS="$LIBS $1" + AC_TRY_LINK([ + #include <qglobal.h> + #include <qstring.h> + ], + [ + QString s("mangle_failure"); + #if (QT_VERSION < 221) + break_me_(\\\); + #endif + ], + qt_cv_libname=$1, + ) + LIBS="$SAVE_LIBS" +]) + +dnl check we can do a compile +AC_DEFUN([QT_CHECK_COMPILE], +[ + AC_MSG_CHECKING([for Qt library name]) + + AC_CACHE_VAL(qt_cv_libname, + [ + AC_LANG_CPLUSPLUS + SAVE_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS" + + for libname in -lqt-mt -lqt3 -lqt2 -lqt; + do + QT_TRY_LINK($libname) + if test -n "$qt_cv_libname"; then + break; + fi + done + + CXXFLAGS=$SAVE_CXXFLAGS + ]) + + if test -z "$qt_cv_libname"; then + AC_MSG_RESULT([failed]) + if test "$FATAL" = 1 ; then + AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !]) + fi + else + AC_MSG_RESULT([$qt_cv_libname]) + fi +]) + +dnl get Qt version we're using +AC_DEFUN([QT_GET_VERSION], +[ + AC_CACHE_CHECK([Qt version],lyx_cv_qtversion, + [ + AC_LANG_CPLUSPLUS + SAVE_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $QT_INCLUDES" + + cat > conftest.$ac_ext <<EOF +#line __oline__ "configure" +#include "confdefs.h" +#include <qglobal.h> +"%%%"QT_VERSION_STR"%%%" +EOF + lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \ + grep '^"%%%"' 2>/dev/null | \ + sed -e 's/"%%%"//g' -e 's/"//g'` + rm -f conftest.$ac_ext + CPPFLAGS=$SAVE_CPPFLAGS + ]) + + QT_VERSION=$lyx_cv_qtversion + AC_SUBST(QT_VERSION) +]) + +dnl start here +AC_DEFUN([QT_DO_IT_ALL], +[ + dnl Please leave this alone. I use this file in + dnl oprofile. + FATAL=0 + + AC_ARG_WITH(qt-dir, [ --with-qt-dir where the root of Qt is installed ], + [ qt_cv_dir=`eval echo "$withval"/` ]) + + AC_ARG_WITH(qt-includes, [ --with-qt-includes where the Qt includes are. ], + [ qt_cv_includes=`eval echo "$withval"` ]) + + AC_ARG_WITH(qt-libraries, [ --with-qt-libraries where the Qt library is installed.], + [ qt_cv_libraries=`eval echo "$withval"` ]) + + dnl pay attention to $QTDIR unless overridden + if test -z "$qt_cv_dir"; then + qt_cv_dir=$QTDIR + fi + + dnl derive inc/lib if needed + if test -n "$qt_cv_dir"; then + if test -z "$qt_cv_includes"; then + qt_cv_includes=$qt_cv_dir/include + fi + if test -z "$qt_cv_libraries"; then + qt_cv_libraries=$qt_cv_dir/lib + fi + fi + + dnl flags for compilation + QT_INCLUDES= + QT_LDFLAGS= + if test -n "$qt_cv_includes"; then + QT_INCLUDES="-I$qt_cv_includes" + fi + if test -n "$qt_cv_libraries"; then + QT_LDFLAGS="-L$qt_cv_libraries" + fi + AC_SUBST(QT_INCLUDES) + AC_SUBST(QT_LDFLAGS) + + QT_FIND_MOC + MOC=$ac_moc + AC_SUBST(MOC) + QT_FIND_UIC + UIC=$ac_uic + AC_SUBST(UIC) + + QT_CHECK_COMPILE + + QT_LIB=$qt_cv_libname; + AC_SUBST(QT_LIB) + + if test -n "$qt_cv_libname"; then + QT_GET_VERSION + fi +]) + +dnl AX_CXXFLAGS_OPTIONS(var-name, option) +dnl add option to var-name if $CXX support it. +AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [ +AC_MSG_CHECKING([whether ${CXX} support precompiled header]) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +SAVE_CXXFLAGS=$CXXFLAGS +dnl we consider than if -Winvalid-pch is accepted pch will works ... +CXXFLAGS=-Winvalid-pch +dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and +dnl the fact than some pch will be invalid for the given compilation option +AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no])) +CXXFLAGS=$SAVE_CXXFLAGS +AC_LANG_RESTORE +]) + +dnl AX_CHECK_DOCBOOK +AC_DEFUN([AX_CHECK_DOCBOOK], [ +# It's just rude to go over the net to build +XSLTPROC_FLAGS=--nonet +DOCBOOK_ROOT= +if test ! -f /etc/xml/catalog; then + for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/; + do + if test -d "$i"; then + DOCBOOK_ROOT=$i + fi + done + + # Last resort - try net + if test -z "$DOCBOOK_ROOT"; then + XSLTPROC_FLAGS= + fi +else + XML_CATALOG=/etc/xml/catalog + CAT_ENTRY_START='<!--' + CAT_ENTRY_END='-->' +fi + +AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,) +XSLTPROC_WORKS=no +if test -n "$XSLTPROC"; then + AC_MSG_CHECKING([whether xsltproc works]) + + if test -n "$XML_CATALOG"; then + DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" + else + DB_FILE="$DOCBOOK_ROOT/docbook.xsl" + fi + + $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END +<?xml version="1.0" encoding='ISO-8859-1'?> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> +<book id="test"> +</book> +END + if test "$?" = 0; then + XSLTPROC_WORKS=yes + fi + AC_MSG_RESULT($XSLTPROC_WORKS) +fi +AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes") + +AC_SUBST(XML_CATALOG) +AC_SUBST(XSLTPROC_FLAGS) +AC_SUBST(DOCBOOK_ROOT) +AC_SUBST(CAT_ENTRY_START) +AC_SUBST(CAT_ENTRY_END) +]) + +dnl AX_CFLAGS_OPTIONS(var-name, option) +dnl add option to var-name if $CC support it. +AC_DEFUN([AX_CFLAGS_OPTION], [ +AC_MSG_CHECKING([whether ${CC} $2 is understood]) +AC_LANG_SAVE +AC_LANG_C +SAVE_CFLAGS=$CFLAGS +CFLAGS=$2 +AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no])) +CFLAGS=$SAVE_CFLAGS +AC_LANG_RESTORE +]) + + +dnl AX_CXXFLAGS_OPTIONS(var-name, option) +dnl add option to var-name if $CXX support it. +AC_DEFUN([AX_CXXFLAGS_OPTION], [ +AC_MSG_CHECKING([whether ${CXX} $2 is understood]) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +SAVE_CXXFLAGS=$CXXFLAGS +CXXFLAGS=$2 +AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no])) +CXXFLAGS=$SAVE_CXXFLAGS +AC_LANG_RESTORE +]) + +dnl AX_COPY_IF_CHANGE(source, dest) +dnl copy source to dest if they don't compare equally or if dest doesn't exist +AC_DEFUN([AX_COPY_IF_CHANGE], [ +if test -r $2; then + if cmp $1 $2 > /dev/null; then + echo $2 is unchanged + else + cp -f $1 $2 + fi +else + cp -f $1 $2 +fi +]) + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch new file mode 100644 index 000000000..b9bb6c577 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch @@ -0,0 +1,12 @@ +oprofile doesn't want GNU-levels of automake strictness so tell it to be "foreign". + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/configure.ac b/configure.ac +index 5740585..cf6c316 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -16 +16 @@ AC_CONFIG_SRCDIR([libop/op_config.h]) +-AM_INIT_AUTOMAKE ++AM_INIT_AUTOMAKE([foreign]) diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch new file mode 100644 index 000000000..51db40845 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch @@ -0,0 +1,46 @@ +Fix glibc-isms so that oprofile builds with musl. + +Patch taken from openwrt (https://github.com/openwrt-mirror/openwrt/blob/master/package/devel/oprofile/patches/100-musl.patch) + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@intel.com> + +--- a/pe_profiling/operf.cpp ++++ b/pe_profiling/operf.cpp +@@ -857,11 +857,14 @@ static int __delete_old_previous_sample_ + int tflag __attribute__((unused)), + struct FTW *ftwbuf __attribute__((unused))) + { ++ int err; ++ + if (remove(fpath)) { ++ err = errno; + perror("sample data removal error"); +- return FTW_STOP; ++ return err; + } else { +- return FTW_CONTINUE; ++ return 0; + } + } + +@@ -896,7 +899,7 @@ static void convert_sample_data(void) + return; + + if (!operf_options::append) { +- int flags = FTW_DEPTH | FTW_ACTIONRETVAL; ++ int flags = FTW_DEPTH; + errno = 0; + if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 && + errno != ENOENT) { +--- a/libop/op_events.c ++++ b/libop/op_events.c +@@ -83,7 +83,7 @@ static int parse_hex(char const * str) + static u64 parse_long_hex(char const * str) + { + u64 value; +- if (sscanf(str, "%Lx", &value) != 1) ++ if (sscanf(str, "0x%llx", &value) != 1) + parse_error("expected long hexadecimal value"); + + fflush(stderr); diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch new file mode 100644 index 000000000..aefa9548e --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch @@ -0,0 +1,98 @@ +Prevent running check tests on host if cross compiling + +This patch enables running the 'make check' tests on the target +in a cross-compiled environment. If not cross-compiling, then 'make + check' builds and executes the tests; no change from this patch. +In a cross-compiling environment, the make variable CROSS_COMPILE is +set which bypasses assiging tests to the makekfile variable TESTS. +Since TESTS is empty, the 'make check' process never tries to run the +tests on the hosts. On the target, the tests must be run manually. + +Also, in the libutil++ tests, a makefile variable SRCDIR is passed into +the compilation phase, pointing to the runtime location of the test +'file-manip-tests'. The mechanism used for a host test, based on +'topdir' doesn't work. Instead, if CROSS_COMPILE is set, the +makefile takes the path of SRCDIR from the build environment and not +from an expression based on the host path 'topdir'. + +Upstream-Status: Pending + +Signed-off-by: Dave Lerner <dave.lerner@windriver.com> + +diff --git a/configure.ac b/configure.ac +index 41ece64..ce5a16f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -392,6 +392,7 @@ AC_ARG_ENABLE(account-check, + enable_account_check=$enableval, enable_account_check=yes) + + AM_CONDITIONAL(CHECK_ACCOUNT, test "x$enable_account_check" = "xyes") ++AM_CONDITIONAL(CROSS_COMPILE, test "x$cross_compiling" = "xyes") + + AC_SUBST(OP_CFLAGS) + AC_SUBST(OP_CXXFLAGS) +diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am +index 8a69003..d820090 100644 +--- a/libdb/tests/Makefile.am ++++ b/libdb/tests/Makefile.am +@@ -13,4 +13,6 @@ check_PROGRAMS = db_test + db_test_SOURCES = db_test.c + db_test_LDADD = ../libodb.a ../../libutil/libutil.a + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} ++endif +diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am +index 8a79eb5..6d417c4 100644 +--- a/libop/tests/Makefile.am ++++ b/libop/tests/Makefile.am +@@ -33,4 +33,6 @@ load_events_files_tests_LDADD = ${COMMON_LIBS} + mangle_tests_SOURCES = mangle_tests.c + mangle_tests_LDADD = ${COMMON_LIBS} + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} utf8_checker.sh ++endif +diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am +index 6f19838..1d176f9 100644 +--- a/libregex/tests/Makefile.am ++++ b/libregex/tests/Makefile.am +@@ -18,4 +18,6 @@ java_test_LDADD = \ + + EXTRA_DIST = mangled-name.in + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} ++endif +diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am +index 51af031..a01ea2d 100644 +--- a/libutil++/tests/Makefile.am ++++ b/libutil++/tests/Makefile.am +@@ -1,7 +1,9 @@ + + REALPATH= readlink -f + ++if ! CROSS_COMPILE + SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ ) ++endif + + AM_CPPFLAGS = \ + -I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\"" @OP_CPPFLAGS@ +@@ -46,4 +48,6 @@ cached_value_tests_LDADD = ${COMMON_LIBS} + utility_tests_SOURCES = utility_tests.cpp + utility_tests_LDADD = ${COMMON_LIBS} + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} ++endif +diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am +index dfcd6ec..e8831b5 100644 +--- a/libutil/tests/Makefile.am ++++ b/libutil/tests/Makefile.am +@@ -12,4 +12,6 @@ file_tests_LDADD = ../libutil.a + string_tests_SOURCES = string_tests.c + string_tests_LDADD = ../libutil.a + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} ++endif diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch new file mode 100644 index 000000000..3eaf6a794 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch @@ -0,0 +1,44 @@ +oprofile: Determine the root home directory dynamically + +This commit detects the root home directory dynamically with changes to +the oprofile gui app source. + +The commit replaces an earlier fix that detected and adjusted a +'non-standard' root home directory at build time. The advantage of this +patch is that the oprofile tools are adjusted to the current run-time +path to ~root, not the build time path. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Dave Lerner <dave.lerner@windriver.com> + +Index: oprofile-1.0.0/doc/oprofile.html +=================================================================== +--- oprofile-1.0.0.orig/doc/oprofile.html 2014-11-03 17:55:31.511034857 +0000 ++++ oprofile-1.0.0/doc/oprofile.html 2014-11-03 17:57:26.415037988 +0000 +@@ -1563,8 +1563,8 @@ + <span class="emphasis"><em>must</em></span> stop it in a controlled manner in order to process + the profile data it has collected. Use <code class="code">kill -SIGINT <operf-PID></code> + for this purpose. It is recommended that when running <span class="command"><strong>operf</strong></span> +- with this option, your current working directory should be <code class="filename">/root</code> or a subdirectory +- of <code class="filename">/root</code> to avoid storing sample data files in locations accessible by regular users. ++ with this option, your current working directory should be <code class="filename">~root</code> or a subdirectory ++ of <code class="filename">~root</code> to avoid storing sample data files in locations accessible by regular users. + </p> + </dd> + <dt> +Index: oprofile-1.0.0/doc/oprofile.xml +=================================================================== +--- oprofile-1.0.0.orig/doc/oprofile.xml 2014-11-03 17:55:31.515034857 +0000 ++++ oprofile-1.0.0/doc/oprofile.xml 2014-11-03 17:58:03.719039005 +0000 +@@ -654,8 +654,8 @@ + <emphasis>must</emphasis> stop it in a controlled manner in order to process + the profile data it has collected. Use <code>kill -SIGINT <operf-PID></code> + for this purpose. It is recommended that when running <command>operf</command> +- with this option, your current working directory should be <filename>/root</filename> or a subdirectory +- of <filename>/root</filename> to avoid storing sample data files in locations accessible by regular users. ++ with this option, your current working directory should be <filename>~root</filename> or a subdirectory ++ of <filename>~root</filename> to avoid storing sample data files in locations accessible by regular users. + </para></listitem> + </varlistentry> + <varlistentry> diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest new file mode 100644 index 000000000..4814be652 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest @@ -0,0 +1,19 @@ +#!/bin/sh + +saved_dir=$PWD +for dir in */tests ; do + cd $dir + for atest in * ; do + if [ \( -x $atest \) -a \( -f $atest \) ] ; then + ./$atest > ${atest}.stdout 2> ${atest}.stderr + if [ $? = 0 ] ; then + echo "PASS: $dir $atest" + rm ${atest}.stdout ${atest}.stderr + else + echo "FAIL: ${dir}/${atest}" + fi + fi + done + cd $saved_dir +done + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb new file mode 100644 index 000000000..92a94ad0d --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb @@ -0,0 +1,10 @@ +require oprofile.inc + +DEPENDS += "virtual/kernel" +DEPENDS_append_powerpc64 = " libpfm4" + +SRC_URI[md5sum] = "248c4c069f9476f427fa7195563f9867" +SRC_URI[sha256sum] = "cf759a6de1a6033d5dfc93bda129a9f2e128aecc4238cc657feb0801d1b0366c" + +S = "${WORKDIR}/oprofile-${PV}" + |