From 4bcefa8176cb832a20f17c548a3108e7e57d6cf0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 4 Jun 2021 12:07:22 -0700 Subject: memcached: upgrade to 1.6.9 Fix Set but unused clang warning sigignore issue is already fixed in 1.6.9 Signed-off-by: Khem Raj --- .../0001-Replace-sigignore-with-signal-API.patch | 74 ---------------------- ...x.c-Check-for-NDEBUG-before-using-total_w.patch | 48 ++++++++++++++ .../recipes-support/memcached/memcached_1.6.6.bb | 52 --------------- .../recipes-support/memcached/memcached_1.6.9.bb | 52 +++++++++++++++ 4 files changed, 100 insertions(+), 126 deletions(-) delete mode 100644 meta-networking/recipes-support/memcached/memcached/0001-Replace-sigignore-with-signal-API.patch create mode 100644 meta-networking/recipes-support/memcached/memcached/0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch delete mode 100644 meta-networking/recipes-support/memcached/memcached_1.6.6.bb create mode 100644 meta-networking/recipes-support/memcached/memcached_1.6.9.bb (limited to 'meta-networking/recipes-support') diff --git a/meta-networking/recipes-support/memcached/memcached/0001-Replace-sigignore-with-signal-API.patch b/meta-networking/recipes-support/memcached/memcached/0001-Replace-sigignore-with-signal-API.patch deleted file mode 100644 index e4aa8fda32..0000000000 --- a/meta-networking/recipes-support/memcached/memcached/0001-Replace-sigignore-with-signal-API.patch +++ /dev/null @@ -1,74 +0,0 @@ -From b9040acdba1245f8cdf5e94384830e3d04fde98a Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 22 Jul 2020 21:32:14 -0700 -Subject: [PATCH] Replace sigignore with signal API - -sigignore has been deprecated in glibc 2.32+ [1] and eventually it will be -removed, therefore substitute it - -[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=02802fafcf6e11ea3f998f685035ffe568dfddeb - -Upstream-Status: Submitted [https://github.com/memcached/memcached/pull/702] - -Signed-off-by: Khem Raj ---- - configure.ac | 1 - - memcached.c | 16 ++-------------- - 2 files changed, 2 insertions(+), 15 deletions(-) - -diff --git a/configure.ac b/configure.ac -index ffc98b2..4567b30 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -630,7 +630,6 @@ AC_CHECK_FUNCS(mlockall) - AC_CHECK_FUNCS(getpagesizes) - AC_CHECK_FUNCS(sysconf) - AC_CHECK_FUNCS(memcntl) --AC_CHECK_FUNCS(sigignore) - AC_CHECK_FUNCS(clock_gettime) - AC_CHECK_FUNCS(preadv) - AC_CHECK_FUNCS(pread) -diff --git a/memcached.c b/memcached.c -index 9cb778d..91ced9e 100644 ---- a/memcached.c -+++ b/memcached.c -@@ -8292,18 +8292,6 @@ static void sig_usrhandler(const int sig) { - stop_main_loop = GRACE_STOP; - } - --#ifndef HAVE_SIGIGNORE --static int sigignore(int sig) { -- struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = 0 }; -- -- if (sigemptyset(&sa.sa_mask) == -1 || sigaction(sig, &sa, 0) == -1) { -- return -1; -- } -- return 0; --} --#endif -- -- - /* - * On systems that supports multiple page sizes we may reduce the - * number of TLB-misses by using the biggest available page size -@@ -9996,7 +9984,7 @@ int main (int argc, char **argv) { - /* daemonize if requested */ - /* if we want to ensure our ability to dump core, don't chdir to / */ - if (do_daemonize) { -- if (sigignore(SIGHUP) == -1) { -+ if (signal(SIGHUP, SIG_IGN) == SIG_ERR) { - perror("Failed to ignore SIGHUP"); - } - if (daemonize(maxcore, settings.verbose) == -1) { -@@ -10146,7 +10134,7 @@ int main (int argc, char **argv) { - * ignore SIGPIPE signals; we can use errno == EPIPE if we - * need that information - */ -- if (sigignore(SIGPIPE) == -1) { -+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - perror("failed to ignore SIGPIPE; sigaction"); - exit(EX_OSERR); - } --- -2.27.0 - diff --git a/meta-networking/recipes-support/memcached/memcached/0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch b/meta-networking/recipes-support/memcached/memcached/0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch new file mode 100644 index 0000000000..2979552a34 --- /dev/null +++ b/meta-networking/recipes-support/memcached/memcached/0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch @@ -0,0 +1,48 @@ +From d6294e9166e4875a0572349aabcc5e51acbd2e3c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 4 Jun 2021 11:33:12 -0700 +Subject: [PATCH] stats_prefix.c: Check for NDEBUG before using total_written + variable + +When using NDEBUG assert macro is ineffective which is caught by latest +clang and reports that total_written is set but unused. Therefore check +for NDEBUG to make sure assert is used only when its effective + +Fixes +error: variable 'total_written' set but not used [-Werror,-Wunused-but-set-variable] + size_t size = 0, written = 0, total_written = 0; + ^ +Upstream-Status: Submitted [https://github.com/memcached/memcached/pull/792] +Signed-off-by: Khem Raj +--- + stats_prefix.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/stats_prefix.c b/stats_prefix.c +index 62f0d04..d72e514 100644 +--- a/stats_prefix.c ++++ b/stats_prefix.c +@@ -127,8 +127,10 @@ char *stats_prefix_dump(int *length) { + PREFIX_STATS *pfs; + char *buf; + int i, pos; +- size_t size = 0, written = 0, total_written = 0; +- ++ size_t size = 0, written = 0; ++#ifndef NDEBUG ++ size_t total_written = 0; ++#endif + /* + * Figure out how big the buffer needs to be. This is the sum of the + * lengths of the prefixes themselves, plus the size of one copy of +@@ -154,8 +156,10 @@ char *stats_prefix_dump(int *length) { + pfs->prefix, pfs->num_gets, pfs->num_hits, + pfs->num_sets, pfs->num_deletes); + pos += written; ++#ifndef NDEBUG + total_written += written; + assert(total_written < size); ++#endif + } + } + diff --git a/meta-networking/recipes-support/memcached/memcached_1.6.6.bb b/meta-networking/recipes-support/memcached/memcached_1.6.6.bb deleted file mode 100644 index 2eb24db9a8..0000000000 --- a/meta-networking/recipes-support/memcached/memcached_1.6.6.bb +++ /dev/null @@ -1,52 +0,0 @@ -SUMMARY = "A high-performance memory object caching system" -DESCRIPTION = "\ - memcached optimizes specific high-load serving applications that are designed \ - to take advantage of its versatile no-locking memory access system. Clients \ - are available in several different programming languages, to suit the needs \ - of the specific application. Traditionally this has been used in mod_perl \ - apps to avoid storing large chunks of data in Apache memory, and to share \ - this burden across several machines." -SECTION = "web" -HOMEPAGE = "http://memcached.org/" -LICENSE = "BSD-3-Clause" - -LIC_FILES_CHKSUM = "file://COPYING;md5=7e5ded7363d335e1bb18013ca08046ff" - -inherit autotools - -DEPENDS += "libevent" -RDEPENDS_${PN} += "perl perl-module-posix perl-module-autoloader \ - perl-module-tie-hash bash \ - " - -SRC_URI = "http://www.memcached.org/files/${BP}.tar.gz \ - file://memcached-add-hugetlbfs-check.patch \ - file://0001-Replace-sigignore-with-signal-API.patch \ - " -SRC_URI[sha256sum] = "908f0eecfa559129c9e44edc46f02e73afe8faca355b4efc5c86d902fc3e32f7" - -# set the same COMPATIBLE_HOST as libhugetlbfs -COMPATIBLE_HOST = "(i.86|x86_64|powerpc|powerpc64|aarch64|arm).*-linux*" - -python __anonymous () { - endianness = d.getVar('SITEINFO_ENDIANNESS') - if endianness == 'le': - d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=little") - else: - d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=big") -} - -PACKAGECONFIG ??= "" -PACKAGECONFIG[hugetlbfs] = "--enable-hugetlbfs, --disable-hugetlbfs, libhugetlbfs" - -inherit update-rc.d - -INITSCRIPT_NAME = "memcached" -INITSCRIPT_PARAMS = "defaults" - -do_install_append() { - install -D -m 755 ${S}/scripts/memcached-init ${D}${sysconfdir}/init.d/memcached - mkdir -p ${D}/usr/share/memcached/scripts - install -m 755 ${S}/scripts/memcached-tool ${D}/usr/share/memcached/scripts - install -m 755 ${S}/scripts/start-memcached ${D}/usr/share/memcached/scripts -} diff --git a/meta-networking/recipes-support/memcached/memcached_1.6.9.bb b/meta-networking/recipes-support/memcached/memcached_1.6.9.bb new file mode 100644 index 0000000000..73e18a4038 --- /dev/null +++ b/meta-networking/recipes-support/memcached/memcached_1.6.9.bb @@ -0,0 +1,52 @@ +SUMMARY = "A high-performance memory object caching system" +DESCRIPTION = "\ + memcached optimizes specific high-load serving applications that are designed \ + to take advantage of its versatile no-locking memory access system. Clients \ + are available in several different programming languages, to suit the needs \ + of the specific application. Traditionally this has been used in mod_perl \ + apps to avoid storing large chunks of data in Apache memory, and to share \ + this burden across several machines." +SECTION = "web" +HOMEPAGE = "http://memcached.org/" +LICENSE = "BSD-3-Clause" + +LIC_FILES_CHKSUM = "file://COPYING;md5=7e5ded7363d335e1bb18013ca08046ff" + +inherit autotools + +DEPENDS += "libevent" +RDEPENDS_${PN} += "perl perl-module-posix perl-module-autoloader \ + perl-module-tie-hash bash \ + " + +SRC_URI = "http://www.memcached.org/files/${BP}.tar.gz \ + file://memcached-add-hugetlbfs-check.patch \ + file://0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch \ + " +SRC_URI[sha256sum] = "d5a62ce377314dbffdb37c4467e7763e3abae376a16171e613cbe69956f092d1" + +# set the same COMPATIBLE_HOST as libhugetlbfs +COMPATIBLE_HOST = "(i.86|x86_64|powerpc|powerpc64|aarch64|arm).*-linux*" + +python __anonymous () { + endianness = d.getVar('SITEINFO_ENDIANNESS') + if endianness == 'le': + d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=little") + else: + d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=big") +} + +PACKAGECONFIG ??= "" +PACKAGECONFIG[hugetlbfs] = "--enable-hugetlbfs, --disable-hugetlbfs, libhugetlbfs" + +inherit update-rc.d + +INITSCRIPT_NAME = "memcached" +INITSCRIPT_PARAMS = "defaults" + +do_install_append() { + install -D -m 755 ${S}/scripts/memcached-init ${D}${sysconfdir}/init.d/memcached + mkdir -p ${D}/usr/share/memcached/scripts + install -m 755 ${S}/scripts/memcached-tool ${D}/usr/share/memcached/scripts + install -m 755 ${S}/scripts/start-memcached ${D}/usr/share/memcached/scripts +} -- cgit 1.2.3-korg