From 7192789b84bbe7c050c0c2ca0f07e708d726e9ae Mon Sep 17 00:00:00 2001 From: bsiegert Date: Fri, 28 Aug 2020 15:44:32 +0000 Subject: Pullup ticket #6310 - requested by he lang/mozjs60: PowerPC build fix Revisions pulled up: - lang/mozjs60/Makefile 1.10 - lang/mozjs60/distinfo 1.7 - lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h 1.1 - lang/mozjs60/patches/patch-js_src_jit_none_AtomicOperations-feeling-lucky.h 1.1 --- Module Name: pkgsrc Committed By: he Date: Sun Aug 23 22:29:47 UTC 2020 Modified Files: pkgsrc/lang/mozjs60: Makefile distinfo Added Files: pkgsrc/lang/mozjs60/patches: patch-js_src_jit_AtomicOperations.h patch-js_src_jit_none_AtomicOperations-feeling-lucky.h Log Message: Make this build on NetBSD/powerpc: * c++ doesn't predefine __ppc__, only __powerpc__. Compensate. * On NetBSD/powerpc, use libatomic for access to 64-bit atomics. PKGREVISION not bumped; build fix for NetBSD/powerpc, should not affect others. --- lang/mozjs60/Makefile | 8 +++++++- lang/mozjs60/distinfo | 4 +++- lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h | 15 +++++++++++++++ ...patch-js_src_jit_none_AtomicOperations-feeling-lucky.h | 15 +++++++++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h create mode 100644 lang/mozjs60/patches/patch-js_src_jit_none_AtomicOperations-feeling-lucky.h diff --git a/lang/mozjs60/Makefile b/lang/mozjs60/Makefile index a63dae93066..b0bd37261fc 100644 --- a/lang/mozjs60/Makefile +++ b/lang/mozjs60/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.9 2020/06/02 08:22:45 adam Exp $ +# $NetBSD: Makefile,v 1.9.2.1 2020/08/28 15:44:32 bsiegert Exp $ DISTNAME= mozjs60_60.8.0.orig PKGNAME= ${DISTNAME:S/_/-/:S/.orig//} @@ -56,6 +56,12 @@ post-install: ${CHMOD} -x ${DESTDIR}${PREFIX}/include/mozjs-60/js-config.h ${CHMOD} -x ${DESTDIR}${PREFIX}/lib/pkgconfig/mozjs-60.pc +.include "../../mk/bsd.prefs.mk" + +.if !empty(MACHINE_PLATFORM:MNetBSD-*-powerpc) +# 64 bit atomics +.include "../../devel/libatomic/buildlink3.mk" +.endif .include "../../devel/zlib/buildlink3.mk" .include "../../lang/python/tool.mk" .include "../../textproc/icu/buildlink3.mk" diff --git a/lang/mozjs60/distinfo b/lang/mozjs60/distinfo index 31b2fbdf8cc..4a87292d5bf 100644 --- a/lang/mozjs60/distinfo +++ b/lang/mozjs60/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.6 2020/05/28 15:26:23 triaxx Exp $ +$NetBSD: distinfo,v 1.6.2.1 2020/08/28 15:44:32 bsiegert Exp $ SHA1 (mozjs60_60.8.0.orig.tar.xz) = b66207ee477c110995029f173e6b026f2e013591 RMD160 (mozjs60_60.8.0.orig.tar.xz) = fef033969a51dc56c84669d33401f60bd499de6d @@ -9,6 +9,8 @@ SHA1 (patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py) = dda670432 SHA1 (patch-.._.._python_mozbuild_mozbuild_virtualenv.py) = 231d96ae8f66da1db36a4371c28d97a4db4c0f5c SHA1 (patch-.._public_TypeDecls.h) = 846e0707755cbe7e97cc380f66bfe6da0daf996e SHA1 (patch-gc_Memory.cpp) = ba865bee4b99ce6298404b41b465b281fd23555f +SHA1 (patch-js_src_jit_AtomicOperations.h) = fc9ff5be98f045500675a73c34eaa9855cea2bec +SHA1 (patch-js_src_jit_none_AtomicOperations-feeling-lucky.h) = 06108aad94437a12b2b80491dab917fe4bb0de37 SHA1 (patch-jsdate.cpp) = f9314460476ffbc00fe85a75bddc964807d0153f SHA1 (patch-threading_posix_Thread.cpp) = c48a642fa98d8112c149142a4af4ac633d3ae332 SHA1 (patch-util_NativeStack.cpp) = 68d2d80291a856c74bac2e6870317f143bb61355 diff --git a/lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h b/lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h new file mode 100644 index 00000000000..6aaacd7d0b0 --- /dev/null +++ b/lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h @@ -0,0 +1,15 @@ +$NetBSD: patch-js_src_jit_AtomicOperations.h,v 1.1.2.2 2020/08/28 15:44:32 bsiegert Exp $ + +Oddly, C++ on NetBSD/powerpc doesn't predefine __ppc__, only __powerpc__. + +--- jit/AtomicOperations.h.orig 2019-07-01 09:07:41.000000000 +0000 ++++ jit/AtomicOperations.h +@@ -378,7 +378,7 @@ inline bool AtomicOperations::isLockfree + #else + #error "No AtomicOperations support for this platform+compiler combination" + #endif +-#elif defined(__ppc__) || defined(__PPC__) ++#elif defined(__ppc__) || defined(__PPC__) || defined(__powerpc__) + #include "jit/none/AtomicOperations-feeling-lucky.h" + #elif defined(__sparc__) + #include "jit/none/AtomicOperations-feeling-lucky.h" diff --git a/lang/mozjs60/patches/patch-js_src_jit_none_AtomicOperations-feeling-lucky.h b/lang/mozjs60/patches/patch-js_src_jit_none_AtomicOperations-feeling-lucky.h new file mode 100644 index 00000000000..d5afffd3dc8 --- /dev/null +++ b/lang/mozjs60/patches/patch-js_src_jit_none_AtomicOperations-feeling-lucky.h @@ -0,0 +1,15 @@ +$NetBSD: patch-js_src_jit_none_AtomicOperations-feeling-lucky.h,v 1.1.2.2 2020/08/28 15:44:32 bsiegert Exp $ + +C++ on NetBSD/powerpc doesn't predefine __ppc__, only __powerpc__. Compensate. + +--- jit/none/AtomicOperations-feeling-lucky.h.orig 2019-07-01 09:07:41.000000000 +0000 ++++ jit/none/AtomicOperations-feeling-lucky.h +@@ -39,7 +39,7 @@ + // want WebAssembly support you can always just lie about the lock-freedom. + // After all, you're already feeling lucky. + +-#if defined(__ppc__) || defined(__PPC__) ++#if defined(__ppc__) || defined(__PPC__) || defined(__powerpc__) + #define GNUC_COMPATIBLE + #endif + -- cgit v1.2.3