Joao Marcos Costa 05191ba25b
memcached: drop libhugetlbfs
In Linux, memcached relies on transparent huge pages, and even if
libhugetlbfs is enabled by the PACKAGECONFIG (and detected during
do_configure, of course), it is simply not used:

root@qemuriscv64:~# ldd $(which memcached)
    linux-vdso.so.1 (0x0000003fa4358000)
    libevent-2.1.so.7 => /lib/libevent-2.1.so.7 (0x0000003fa42b0000)
    libc.so.6 => /lib/libc.so.6 (0x0000003fa4157000)
    /usr/lib/ld-linux-riscv64-lp64d.so.1 (0x0000003fa435a000)

The main reason is the fact that the only call to a function coming from
libhugetlbfs is here:

https://github.com/memcached/memcached/blob/master/memcached.c#L4274

and getpagesizes() is only called if the #if block evaluates to true:

    int ret = -1;
    size_t sizes[32];
    int avail = getpagesizes(sizes, 32);
(...)
    /* check if transparent hugepages is compiled into the kernel */
    /* RH based systems possibly uses a different path */
    static const char *mm_thp_paths[] = {
        "/sys/kernel/mm/transparent_hugepage/enabled",
        "/sys/kernel/mm/redhat_transparent_hugepage/enabled",
        NULL
    };
(...)

This block relies on HAVE_MEMCNTL, which is a Solaris-specific feature.
Therefore, the dependency link between memcached and libhugetlbfs
doesn't exist in Linux.

Drop libhugetlbfs from memcached's recipe.

Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-04-24 18:39:52 -07:00

53 lines
1.9 KiB
BlitzBasic

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 pkgconfig
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"
SRC_URI[sha256sum] = "e097073c156eeff9e12655b054f446d57374cfba5c132dcdbe7fac64e728286a"
CVE_STATUS[CVE-2022-26635] = "disputed: this is a problem of applications using php-memcached inproperly"
UPSTREAM_CHECK_URI = "${HOMEPAGE}"
COMPATIBLE_HOST = "(i.86|x86_64|powerpc|powerpc64|riscv64|aarch64|arm).*-linux*"
# assoc.c:83:9: error: variable 'depth' set but not used [-Werror,-Wunused-but-set-variable]
CFLAGS:append:toolchain-clang = " -Wno-error=unused-but-set-variable"
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")
}
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
}