libucontext: Bring in mips/mips64 support
PATCH 1/2 libucontext: Bring in mips/mips64 support
Latest master 0.10.x+ has added support for mips/mips64, which should help compile ruby on musl for these architectures
Switch SRC_URI to github upstream URI
Check for common arches before checking others in map_kernel_arch
Drop already upstreamed patches
Signed-off-by Khem Raj <[email protected]>
--- meta/recipes-core/musl/libucontext_git.bb | 46 +++++++++++------------ 1 file changed, 23 insertions(+), 23 deletions(-)
meta/recipes-core/musl/libucontext_git.bb +23 -23
@@ -8,22 +8,21 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=864cc1445419406b7093e8e531c9515e" SECTION = "libs" DEPENDS = "" -PV = "0.1.3+${SRCPV}" -SRCREV = "e6b4d7516dae9b200e94fcfcb9ebc9331389655f" -SRC_URI = "git://code.foxkit.us/adelie/libucontext.git;protocol=https \ - file://0001-pass-LDFLAGS-to-link-step.patch \ - file://0001-Makefile-Add-LIBDIR-variable.patch \ +PV = "0.10+${SRCPV}" +SRCREV = "272d6821039813818595e9a3b909ce18f33a89ab" +SRC_URI = "git://github.com/kaniini/libucontext \ " S = "${WORKDIR}/git" COMPATIBLE_HOST = ".*-musl.*" -valid_archs = "\ -i386 x86 \ -ppc powerpc powerpc64 ppc64 \ -arm aarch64 \ -s390 \ +valid_archs = " \ + x86 x86_64 \ + ppc ppc64 \ + mips mips64 \ + arm aarch64 \ + s390x \ " def map_kernel_arch(a, d):
@@ -31,18 +30,19 @@ def map_kernel_arch(a, d): valid_archs = d.getVar('valid_archs').split() - if re.match('(i.86|athlon)$', a): return 'x86' - elif re.match('x86.64$', a): return 'x86_64' - elif re.match('armeb$', a): return 'arm' - elif re.match('aarch64$', a): return 'aarch64' - elif re.match('aarch64_be$', a): return 'aarch64' - elif re.match('aarch64_ilp32$', a): return 'aarch64' - elif re.match('aarch64_be_ilp32$', a): return 'aarch64' - elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'mips' - elif re.match('p(pc|owerpc)', a): return 'ppc' - elif re.match('p(pc64|owerpc64)', a): return 'ppc64' - elif re.match('riscv64$', a): return 'riscv64' - elif a in valid_archs: return a + if a in valid_archs: return a + elif re.match('(i.86|athlon)$', a): return 'x86' + elif re.match('x86.64$', a): return 'x86_64' + elif re.match('armeb$', a): return 'arm' + elif re.match('aarch64$', a): return 'aarch64' + elif re.match('aarch64_be$', a): return 'aarch64' + elif re.match('aarch64_ilp32$', a): return 'aarch64' + elif re.match('aarch64_be_ilp32$', a): return 'aarch64' + elif re.match('mips(isa|)(32|)(r6|)(el|)$', a): return 'mips' + elif re.match('mips(isa|)64(r6|)(el|)$', a): return 'mips64' + elif re.match('p(pc|owerpc)', a): return 'ppc' + elif re.match('p(pc64|owerpc64)', a): return 'ppc64' + elif re.match('riscv64$', a): return 'riscv64' else: if not d.getVar("TARGET_OS").startswith("linux"): return a
@@ -50,7 +50,7 @@ def map_kernel_arch(a, d): export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH'), d)}" -CFLAGS += "-Iarch/${ARCH}" +CFLAGS += "-Iarch/${ARCH} -Iarch/common" EXTRA_OEMAKE = "CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' LIBDIR='${base_libdir}'"
Signature · 1 line
2.26.0
PATCH 2/2 ruby: Link with libucontext on musl
coroutines in ruby 2.7+ needs ucontext APIs which are not available in musl but an external library is available to provide them so use it
Use cached values for ac_cv_func_isnan and ac_cv_func_isinf this is not detected correctly by configure on musl
on ARM drop using old arm32 implementation of coroutine which is slow and inefficient
Signed-off-by Khem Raj <[email protected]>
--- meta/recipes-devtools/ruby/ruby_2.7.0.bb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
meta/recipes-devtools/ruby/ruby_2.7.0.bb +7 -2
@@ -1,5 +1,7 @@ require ruby.inc +DEPENDS_append_libc-musl = " libucontext" + SRC_URI += " \ file://remove_has_include_macros.patch \ file://run-ptest \
@@ -25,8 +27,11 @@ EXTRA_OECONF = "\ --with-pkg-config=pkg-config \ " -EXTRA_OECONF_append_libc-musl_arm = " --with-coroutine=arm32" -EXTRA_OECONF_append_libc-musl_armeb = " --with-coroutine=arm32" +EXTRA_OECONF_append_libc-musl = "\ + LIBS='-lucontext' \ + ac_cv_func_isnan=yes \ + ac_cv_func_isinf=yes \ +" do_install() { oe_runmake 'DESTDIR=${D}' install
Signature · 1 line
2.26.0