Opened 6 years ago

Closed 3 years ago

#57032 closed defect (fixed)

mozjs52 @52.6.0, mozjs60 @60.1.0: Target C compiler target CPU (unknown) does not match --target CPU (powerpc)

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: evanmiller (Evan Miller)
Priority: Normal Milestone:
Component: ports Version: 2.5.3
Keywords: powerpc Cc: udbraumann, ryandesign (Ryan Carsten Schmidt), stevenptimms, khepler, evanmiller (Evan Miller)
Port: mozjs52, mozjs60

Description

By some reason mozjs52 wants to get installed and fails:

checking for the target C compiler... /opt/local/bin/gcc-mp-6
checking whether the target C compiler can be used... no
DEBUG: <truncated - see config.log for full output>
DEBUG: | #elif __linux__
DEBUG: | %KERNEL "Linux"
DEBUG: | #elif _WIN32 || __CYGWIN__
DEBUG: | %KERNEL "WINNT"
DEBUG: | #elif __NetBSD__
DEBUG: | %KERNEL "NetBSD"
DEBUG: | #elif __APPLE__
DEBUG: | %KERNEL "Darwin"
DEBUG: | #endif
DEBUG: | #if _MSC_VER || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
DEBUG: | %ENDIANNESS "little"
DEBUG: | #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
DEBUG: | %ENDIANNESS "big"
DEBUG: | #endif
DEBUG: Executing: `/opt/local/bin/gcc-mp-6 -std=gnu99 -E /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs52/mozjs52/work/.tmp/conftest.CpnwOJ.c`
DEBUG: COMPILER = gcc
DEBUG: VERSION = 6.4.0
DEBUG: STDC_VERSION = 199901L
DEBUG: KERNEL = Darwin
DEBUG: ENDIANNESS = big
ERROR: Target C compiler target CPU (unknown) does not match --target CPU (powerpc)
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj" && ../configure --prefix=/opt/local --with-system-icu --with-system-nspr --disable-readline --enable-threadsafe 
Exit code: 1
Error: Failed to configure mozjs52, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj/config.log
Error: Failed to configure mozjs52: configure failure: command execution failed
DEBUG: Error code: NONE

Attachments (5)

main.log (16.3 KB) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
Main.log from PPC Leopard
config.log (6.2 KB) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj/config.log
patch-mozjs52-portfile.diff (919 bytes) - added by kencu (Ken) 5 years ago.
patch-mozjs52-tiger-ppc-notfixedyetfully.diff (18.0 KB) - added by kencu (Ken) 5 years ago.
mozjs52-fail-tigerppc-end-of-log.log (7.7 KB) - added by kencu (Ken) 5 years ago.

Download all attachments as: .zip

Change History (73)

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from PPC Leopard

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: config.log added

/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj/config.log

comment:1 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

GCC 6.4 knows these upper case #defines:

#define _ARCH_PPC 1
#define _ARCH_PPCGR 1
#define _BIG_ENDIAN 1
#define _Bool _Bool
#define _CALL_DARWIN 1
#define __ALTIVEC__ 1
#define __APPLE_ALTIVEC__ 1
#define __APPLE_CC__ 1
#define __APPLE__ 1
#define __ATOMIC_ACQUIRE 2
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_CONSUME 1
#define __ATOMIC_RELAXED 0
#define __ATOMIC_RELEASE 3
#define __ATOMIC_SEQ_CST 5
#define __BIGGEST_ALIGNMENT__ 16
#define __BIG_ENDIAN__ 1
#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
#define __CHAR16_TYPE__ short unsigned int
#define __CHAR32_TYPE__ unsigned int
#define __CHAR_BIT__ 8
#define __CONSTANT_CFSTRINGS__ 1
#define __DBL_DECIMAL_DIG__ 17
#define __DBL_DENORM_MIN__ ((double)4.94065645841246544176568792868221e-324L)
#define __DBL_DIG__ 15
#define __DBL_EPSILON__ ((double)2.22044604925031308084726333618164e-16L)
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_MAX_10_EXP__ 308
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX__ ((double)1.79769313486231570814527423731704e+308L)
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN__ ((double)2.22507385850720138309023271733240e-308L)
#define __DEC128_EPSILON__ 1E-33DL
#define __DEC128_MANT_DIG__ 34
#define __DEC128_MAX_EXP__ 6145
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __DEC128_MIN_EXP__ (-6142)
#define __DEC128_MIN__ 1E-6143DL
#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
#define __DEC32_EPSILON__ 1E-6DF
#define __DEC32_MANT_DIG__ 7
#define __DEC32_MAX_EXP__ 97
#define __DEC32_MAX__ 9.999999E96DF
#define __DEC32_MIN_EXP__ (-94)
#define __DEC32_MIN__ 1E-95DF
#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
#define __DEC64_EPSILON__ 1E-15DD
#define __DEC64_MANT_DIG__ 16
#define __DEC64_MAX_EXP__ 385
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __DEC64_MIN_EXP__ (-382)
#define __DEC64_MIN__ 1E-383DD
#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
#define __DECIMAL_DIG__ 33
#define __DEC_EVAL_METHOD__ 2
#define __DYNAMIC__ 1
#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 1058
#define __FINITE_MATH_ONLY__ 0
#define __FLOAT_WORD_ORDER__ __ORDER_BIG_ENDIAN__
#define __FLT_DECIMAL_DIG__ 9
#define __FLT_DENORM_MIN__ 1.40129846432481707092372958328992e-45F
#define __FLT_DIG__ 6
#define __FLT_EPSILON__ 1.19209289550781250000000000000000e-7F
#define __FLT_EVAL_METHOD__ 0
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MANT_DIG__ 24
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX__ 3.40282346638528859811704183484517e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN__ 1.17549435082228750796873653722225e-38F
#define __FLT_RADIX__ 2
#define __FP_FAST_FMA 1
#define __FP_FAST_FMAF 1
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __GCC_ATOMIC_LLONG_LOCK_FREE 1
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_IEC_559 2
#define __GCC_IEC_559_COMPLEX 2
#define __GNUC_MINOR__ 4
#define __GNUC_PATCHLEVEL__ 0
#define __GNUC_STDC_INLINE__ 1
#define __GNUC__ 6
#define __GXX_ABI_VERSION 1010
#define __HAVE_BSWAP__ 1
#define __INT16_C(c) c
#define __INT16_MAX__ 0x7fff
#define __INT16_TYPE__ short int
#define __INT32_C(c) c
#define __INT32_MAX__ 0x7fffffff
#define __INT32_TYPE__ int
#define __INT64_C(c) c ## LL
#define __INT64_MAX__ 0x7fffffffffffffffLL
#define __INT64_TYPE__ long long int
#define __INT8_C(c) c
#define __INT8_MAX__ 0x7f
#define __INT8_TYPE__ signed char
#define __INTMAX_C(c) c ## LL
#define __INTMAX_MAX__ 0x7fffffffffffffffLL
#define __INTMAX_TYPE__ long long int
#define __INTPTR_MAX__ 0x7fffffffL
#define __INTPTR_TYPE__ long int
#define __INT_FAST16_MAX__ 0x7fff
#define __INT_FAST16_TYPE__ short int
#define __INT_FAST32_MAX__ 0x7fffffff
#define __INT_FAST32_TYPE__ int
#define __INT_FAST64_MAX__ 0x7fffffffffffffffLL
#define __INT_FAST64_TYPE__ long long int
#define __INT_FAST8_MAX__ 0x7f
#define __INT_FAST8_TYPE__ signed char
#define __INT_LEAST16_MAX__ 0x7fff
#define __INT_LEAST16_TYPE__ short int
#define __INT_LEAST32_MAX__ 0x7fffffff
#define __INT_LEAST32_TYPE__ int
#define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL
#define __INT_LEAST64_TYPE__ long long int
#define __INT_LEAST8_MAX__ 0x7f
#define __INT_LEAST8_TYPE__ signed char
#define __INT_MAX__ 0x7fffffff
#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
#define __LDBL_DIG__ 31
#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 106
#define __LDBL_MAX_10_EXP__ 308
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
#define __LDBL_MIN_10_EXP__ (-291)
#define __LDBL_MIN_EXP__ (-968)
#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
#define __LONGDOUBLE128 1
#define __LONG_DOUBLE_128__ 1
#define __LONG_DOUBLE_IBM128__ 1
#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
#define __LONG_MAX__ 0x7fffffffL
#define __MACH__ 1
#define __NATURAL_ALIGNMENT__ 1
#define __NO_INLINE__ 1
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_PDP_ENDIAN__ 3412
#define __PIC__ 2
#define __POWERPC__ 1
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __PTRDIFF_MAX__ 0x7fffffff
#define __PTRDIFF_TYPE__ int
#define __RECIPF__ 1
#define __REGISTER_PREFIX__ 
#define __RSQRTE__ 1
#define __SCHAR_MAX__ 0x7f
#define __SHRT_MAX__ 0x7fff
#define __SIG_ATOMIC_MAX__ 0x7fffffff
#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
#define __SIG_ATOMIC_TYPE__ int
#define __SIZEOF_DOUBLE__ 8
#define __SIZEOF_FLOAT__ 4
#define __SIZEOF_INT__ 4
#define __SIZEOF_LONG_DOUBLE__ 16
#define __SIZEOF_LONG_LONG__ 8
#define __SIZEOF_LONG__ 4
#define __SIZEOF_POINTER__ 4
#define __SIZEOF_PTRDIFF_T__ 4
#define __SIZEOF_SHORT__ 2
#define __SIZEOF_SIZE_T__ 4
#define __SIZEOF_WCHAR_T__ 4
#define __SIZEOF_WINT_T__ 4
#define __SIZE_MAX__ 0xffffffffUL
#define __SIZE_TYPE__ long unsigned int
#define __STDC_HOSTED__ 1
#define __STDC_UTF_16__ 1
#define __STDC_UTF_32__ 1
#define __STDC_VERSION__ 199901L
#define __STDC__ 1
#define __UINT16_C(c) c
#define __UINT16_MAX__ 0xffff
#define __UINT16_TYPE__ short unsigned int
#define __UINT32_C(c) c ## U
#define __UINT32_MAX__ 0xffffffffU
#define __UINT32_TYPE__ unsigned int
#define __UINT64_C(c) c ## ULL
#define __UINT64_MAX__ 0xffffffffffffffffULL
#define __UINT64_TYPE__ long long unsigned int
#define __UINT8_C(c) c
#define __UINT8_MAX__ 0xff
#define __UINT8_TYPE__ unsigned char
#define __UINTMAX_C(c) c ## ULL
#define __UINTMAX_MAX__ 0xffffffffffffffffULL
#define __UINTMAX_TYPE__ long long unsigned int
#define __UINTPTR_MAX__ 0xffffffffUL
#define __UINTPTR_TYPE__ long unsigned int
#define __UINT_FAST16_MAX__ 0xffff
#define __UINT_FAST16_TYPE__ short unsigned int
#define __UINT_FAST32_MAX__ 0xffffffffU
#define __UINT_FAST32_TYPE__ unsigned int
#define __UINT_FAST64_MAX__ 0xffffffffffffffffULL
#define __UINT_FAST64_TYPE__ long long unsigned int
#define __UINT_FAST8_MAX__ 0xff
#define __UINT_FAST8_TYPE__ unsigned char
#define __UINT_LEAST16_MAX__ 0xffff
#define __UINT_LEAST16_TYPE__ short unsigned int
#define __UINT_LEAST32_MAX__ 0xffffffffU
#define __UINT_LEAST32_TYPE__ unsigned int
#define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL
#define __UINT_LEAST64_TYPE__ long long unsigned int
#define __UINT_LEAST8_MAX__ 0xff
#define __UINT_LEAST8_TYPE__ unsigned char
#define __USER_LABEL_PREFIX__ _
#define __VEC_ELEMENT_REG_ORDER__ __ORDER_BIG_ENDIAN__
#define __VEC__ 10206
#define __VERSION__ "6.4.0"
#define __WCHAR_MAX__ 0x7fffffff
#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
#define __WCHAR_TYPE__ int
#define __WINT_MAX__ 0x7fffffff
#define __WINT_MIN__ (-__WINT_MAX__ - 1)
#define __WINT_TYPE__ int

comment:2 Changed 6 years ago by jmroot (Joshua Root)

Cc: devans@… removed
Owner: set to dbevans
Status: newassigned
Summary: mozjs52 @52.6.0mozjs52 @52.6.0 configure failure

comment:3 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

configure reports this option:

  --enable-macos-target     Set the minimum MacOS version needed at runtime [10.7]

Could be mozjs52 does not build on Snow Leopard and older…

comment:4 Changed 6 years ago by kencu (Ken)

Snow Leopard is OK, at least.

$ port -v installed mozjs52
The following ports are currently installed:
  mozjs52 @52.6.0_0+universal (active) platform='darwin 10' archs='i386 x86_64' date='2018-08-24T20:12:27-0700'

comment:5 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Could be he problem comes from these lines in config.log:

DEBUG: | #elif __powerpc64__
DEBUG: | %CPU "ppc64"
DEBUG: | #elif __powerpc__
DEBUG: | %CPU "ppc"

These are tests on lower case strings, but GCC defines UPPER CASE STRINGS. So configure has to state: ERROR: Target C compiler target CPU (unknown) does not match --target CPU (powerpc). Some more files seem to think it's FORTRAN time in reverse:

./js/src/ctypes/CTypes.cpp:#if defined(SPARC) || defined(__powerpc__)
./js/src/jit/arm/llvm-compiler-rt/assembly.h:#if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
./js/src/vm/TraceLogging.cpp:#elif defined(__powerpc__)
./memory/jemalloc/src/include/jemalloc/internal/jemalloc_internal.h.in:#  ifdef __powerpc__
./memory/jemalloc/src/include/jemalloc/internal/mb.h:#elif defined(__powerpc__)
./memory/mozjemalloc/jemalloc.c:#ifdef __powerpc__
./mfbt/EndianUtils.h:#elif defined(__APPLE__) || defined(__powerpc__) || defined(__ppc__)
./mfbt/double-conversion/utils.h:    defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \
./mfbt/lz4.c:   || defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) \
./nsprpub/pr/include/md/_beos.cfg:#ifdef __powerpc__
./nsprpub/pr/include/md/_beos.h:#ifdef __powerpc__
./nsprpub/pr/include/md/_freebsd.cfg:#elif defined(__powerpc__)
./nsprpub/pr/include/md/_freebsd.h:#elif defined(__powerpc__)
./nsprpub/pr/include/md/_linux.cfg:#elif defined(__powerpc__)
./nsprpub/pr/include/md/_linux.h:#elif defined(__powerpc__)
./nsprpub/pr/include/md/_linux.h:#if defined(__powerpc__) && !defined(__powerpc64__)
./nsprpub/pr/include/md/_linux.h:#ifdef __powerpc__
./nsprpub/pr/include/md/_linux.h:#endif /*__powerpc__*/
./nsprpub/pr/include/md/_linux.h:#ifdef __powerpc__
./nsprpub/pr/include/md/_linux.h:#endif /*__powerpc__*/
./nsprpub/pr/include/md/_netbsd.cfg:#elif defined(__powerpc__) || defined(__m68k__)
./nsprpub/pr/include/md/_netbsd.h:#elif defined(__powerpc__)
./nsprpub/pr/include/md/_netbsd.h:#if defined(__i386__) || defined(__sparc__) || defined(__m68k__) || defined(__powerpc__)
./nsprpub/pr/include/md/_openbsd.cfg:#elif defined(__powerpc__) || defined(__m68k__)
./nsprpub/pr/include/md/_openbsd.h:#elif defined(__powerpc__)
./nsprpub/pr/include/md/_openbsd.h:#elif defined(__powerpc__)
./nsprpub/pr/include/pratom.h:           defined(__powerpc__) || \
./python/mozbuild/mozbuild/configure/constants.py:    ('ppc', '__powerpc__'),
Übereinstimmungen in Binärdatei ./python/mozbuild/mozbuild/configure/constants.pyc
./python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py:                '__powerpc__': 1,
./python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py:                '__powerpc__': 1,

Since my tongue is more like that of a snail (Anglo-German insiders joke) *I* have no idea where to start patching because I do not speak Python…

comment:6 Changed 6 years ago by kencu (Ken)

Summary: mozjs52 @52.6.0 configure failuremozjs52 @52.6.0 configure failure on PPC

comment:7 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Clang 3.3 and 3.4 both define:

#define __POWERPC__ 1
#define __powerpc__ 1

comment:8 Changed 6 years ago by udbraumann

Cc: udbraumann added

comment:9 in reply to:  4 ; Changed 6 years ago by udbraumann

Replying to kencu:

Snow Leopard is OK, at least.

Can you tell which compiler is being used under 10.6?

comment:10 in reply to:  9 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to udbraumann:

Replying to kencu:

Snow Leopard is OK, at least.

Can you tell which compiler is being used under 10.6?

checking for the target C compiler... /opt/local/bin/gcc-mp-6

comment:11 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Looking in Leopard into mozjs-52.6.0gnome1/js/src/obj/config.log it seems rather that GCC has #defined lower case strings, but not ppc or __powerpc__. Instead it has __ppc__:

pete 238 /\ echo | g++-apple-4.2 -dM -E - | egrep -i 'ppc|cpu|app|darwin|gnu|plus'
#define _ARCH_PPCGR 1
#define __GNUC_PATCHLEVEL__ 4
#define __APPLE_CC__ 5666
#define __ppc__ 1
#define __APPLE__ 1
#define __GNUC__ 4
#define _ARCH_PPC 1
#define __VERSION__ "4.2.4 (Apple Inc. build 5666) (dot 3) (MacPorts apple-gcc42 5666.3_15+gpl3)"
#define __GNUC_MINOR__ 2
#define __GNUC_GNU_INLINE__ 1
pete 239 /\ g++-mp-6 -dM -E - < /dev/null | egrep -i 'ppc|cpu|app|darwin|gnu|plus'
#define _ARCH_PPCGR 1
#define __GNUC_PATCHLEVEL__ 0
#define _ARCH_PPC 1
#define __APPLE_CC__ 1
#define __ppc__ 1
#define __APPLE__ 1
#define __GNUC__ 6
#define _CALL_DARWIN 1
#define __GNUC_STDC_INLINE__ 1
#define __APPLE_ALTIVEC__ 1
#define __GNUC_MINOR__ 4

comment:12 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

I created a bug report on the bugzilla site: https://bugzilla.mozilla.org/show_bug.cgi?id=1489839.

comment:13 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

On Tiger I tried an "improved" command:

pete 228 /\ g++-mp-6 -dM -E - < /dev/null | egrep -i 'ppc|power|cpu|app|darwin|gnu|plus'
#define _ARCH_PPCGR 1
#define __GNUC_PATCHLEVEL__ 0
#define _ARCH_PPC 1
#define __APPLE_CC__ 1
#define __ppc__ 1
#define __APPLE__ 1
#define __GNUC__ 6
#define _CALL_DARWIN 1
#define __GNUC_STDC_INLINE__ 1
#define __GNUC_MINOR__ 4
#define __POWERPC__ 1

Similarly Apple's GCC 4.2.1 has also #defined the string __POWERPC__.

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:14 in reply to:  9 Changed 6 years ago by kencu (Ken)

Replying to udbraumann:

Replying to kencu:

Snow Leopard is OK, at least.

Can you tell which compiler is being used under 10.6?

I force 10.6 to build everything with clang-3.9 by setting the default_compilers in macports.conf.

checking for the target C compiler... /opt/local/bin/clang-mp-3.9
checking whether the target C compiler can be used... yes
checking the target C compiler version... 3.9.1
checking the target C compiler works... yes
checking for the target C++ compiler... /opt/local/bin/clang++-mp-3.9
checking whether the target C++ compiler can be used... yes
checking the target C++ compiler version... 3.9.1
checking the target C++ compiler works... yes
checking for the host C compiler... /opt/local/bin/clang-mp-3.9
checking whether the host C compiler can be used... yes
checking the host C compiler version... 3.9.1
checking the host C compiler works... yes
checking for the host C++ compiler... /opt/local/bin/clang++-mp-3.9
checking whether the host C++ compiler can be used... yes
checking the host C++ compiler version... 3.9.1
checking the host C++ compiler works... yes

comment:15 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

The Mozilla folks recommend to use mozjs60 because version 52 is not maintained anymore. (And their support starts with macOS 10.9. Of course.)

The option to patch file is beyond my knowledge. I have no how idea how Python works and how I could debug to see which files are used, that might need a patch or two…

comment:16 Changed 6 years ago by kencu (Ken)

I don't know if there will be much luck getting this to build on 10.4 or 10.5 PPC. It's not easy to do, I suspect.

A fairly recent (45, I think) version of mozjs is built in TenFourFox but that took some serious attention.

May I ask if you have narrowed down what you're trying to install (or upgrade) that is pulling this in? Maybe we could figure out how to get around the dependency instead.

comment:17 in reply to:  16 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

May I ask if you have narrowed down what you're trying to install (or upgrade) that is pulling this in? Maybe we could figure out how to get around the dependency instead.

It's policykit.

comment:18 Changed 6 years ago by kencu (Ken)

Yeah -- for now you will need to roll back to the last version before the update to 0.115, because it appears 0.115 needs mozjs52.

And you'll need to peg at that version, maybe forever, on PPC.

comment:19 in reply to:  15 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added
Keywords: powerpc added; leopard removed
Port: mozjs60 added
Summary: mozjs52 @52.6.0 configure failure on PPCmozjs52 @52.6.0, mozjs60 @60.1.0: Target C compiler target CPU (unknown) does not match --target CPU (powerpc)

Replying to ballapete:

The Mozilla folks recommend to use mozjs60 because version 52 is not maintained anymore.

mozjs60 has the same problem. I've updated the upstream bug report with this information and some hints about how they might solve it.

comment:20 Changed 5 years ago by khepler

Update: Clang defined those macros, not Python. Sorry for the noise.

Original message follows:


The config script detects arch fine when run outside of Macports:

[xserve:mozjs-52.6.0gnome1/js/src] kris% sudo -u macports ./configure
Creating Python environment
New python executable in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/_virtualenv/bin/python
Installing setuptools, pip, wheel...done.
running build_ext
copying build/lib.macosx-10.5-ppc-2.7/psutil/_psutil_osx.so -> psutil
copying build/lib.macosx-10.5-ppc-2.7/psutil/_psutil_posix.so -> psutil

Reexecuting in the virtualenv
checking for a shell... /bin/sh
checking for host system type... powerpc-apple-darwin9.8.0
checking for target system type... powerpc-apple-darwin9.8.0
checking for the Android toolchain directory... not found
checking whether cross compiling... no
checking for pkg_config... /opt/local/bin/pkg-config
checking for pkg-config version... 0.29.2
checking for yasm... not found
checking for android platform directory... no
checking for the target C compiler... /opt/local/bin/clang
checking whether the target C compiler can be used... yes
checking the target C compiler version... 3.4.2
checking the target C compiler works... yes
checking for the target C++ compiler... /opt/local/bin/clang++
checking whether the target C++ compiler can be used... no
DEBUG: <truncated - see config.log for full output>
DEBUG: | #elif __linux__
DEBUG: | %KERNEL "Linux"
DEBUG: | #elif _WIN32 || __CYGWIN__
DEBUG: | %KERNEL "WINNT"
DEBUG: | #elif __NetBSD__
DEBUG: | %KERNEL "NetBSD"
DEBUG: | #elif __APPLE__
DEBUG: | %KERNEL "Darwin"
DEBUG: | #endif
DEBUG: | #if _MSC_VER || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
DEBUG: | %ENDIANNESS "little"
DEBUG: | #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
DEBUG: | %ENDIANNESS "big"
DEBUG: | #endif
DEBUG: Executing: `/opt/local/bin/clang++ -std=gnu++11 -E /tmp/conftest.PmEJ4p.cpp`
DEBUG: COMPILER = clang
DEBUG: cplusplus = 201103L
DEBUG: CPU = ppc
DEBUG: KERNEL = Darwin
DEBUG: ENDIANNESS = big
ERROR: Only clang/llvm 3.6 or newer is supported.
[xserve:mozjs-52.6.0gnome1/js/src] kris%

I don't believe the macros the script looks for are GCC macros; they seem to be defined by python. I tested GCC v4.2-apple, v4.9-mp, v5-mp, v6-mp and v7-mp and none of them defined those macros. I'm still investigating, but right now it looks like there's no issue with Mozilla's configure script, but there's an incompatibility with Apple's python2.7 while Macports' python2.7 works.

Last edited 5 years ago by khepler (previous) (diff)

comment:21 Changed 5 years ago by khepler

For what it's worth, the pre-processor macros to be checked are defined on lines 80 and 81 of mozjs-52.6.0gnome1/python/mozbuild/mozbuild/configure/constants.py:

 71: # The order of those checks matter
 72: CPU_preprocessor_checks = OrderedDict((
 73:     ('x86', '__i386__ || _M_IX86'),
 74:     ('x86_64', '__x86_64__ || _M_X64'),
 75:     ('arm', '__arm__ || _M_ARM'),
 76:     ('aarch64', '__aarch64__'),
 77:     ('ia64', '__ia64__'),
 78:     ('s390x', '__s390x__'),
 79:     ('s390', '__s390__'),
 80:     ('ppc64', '__powerpc64__'),
 81:     ('ppc', '__powerpc__'),
 82:     ('Alpha', '__alpha__'),
 83:     ('hppa', '__hppa__'),
 84:     ('sparc64', '__sparc__ && __arch64__'),
 85:     ('sparc', '__sparc__'),
 86:     ('mips64', '__mips64'),
 87:     ('mips32', '__mips__'),
 88: ))

Setting the 'ppc64' and 'ppc' values to '__powerpc64__ || __POWERPC64__' and '__powerpc__ || __POWERPC__' allows the configure script to succeed, but the build later fails trying to pass -stdlib=libc++ to g++-mp-6:

...
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/m
ozjs52/work/mozjs-52.6.0gnome1/js/src/obj'
make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/m
ozjs52/work/mozjs-52.6.0gnome1/js/src/obj/mozglue/misc'
mkdir -p '.deps/'
make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/m
ozjs52/work/mozjs-52.6.0gnome1/js/src/obj/memory/mozalloc'
mkdir -p '.deps/'
/opt/local/bin/g++-mp-6 -std=gnu++11 -o StackWalk.o -c  -fvisibility=hidden -fvisibility-inlines-hidden -DNDEBUG=1 -DTRIMMED=1 -DIMPL_MFBT -DMOZ_HA
S_MOZGLUE -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs
-52.6.0gnome1/mozglue/misc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/m
ozjs52/work/mozjs-52.6.0gnome1/js/src/obj/mozglue/misc  -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_
tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj/dist/include  -I/opt/local/include/nspr        -fPIC  -DMOZILLA_CLIENT -incl
ude /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0g
nome1/js/src/obj/js/src/js-confdefs.h -MD -MP -MF .deps/StackWalk.o.pp -I/opt/local/include -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers
-Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wno-erro
r=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -fno-lifetime-dse -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32 -fno-c
ommon -stdlib=libc++ -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe  -g -O3 -fno-stack-protector -fomit-frame-pointer    /opt/local/var/m
acports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/mozglue/misc/S
tackWalk.cpp
/opt/local/bin/g++-mp-6 -std=gnu++11 -o Unified_cpp_memory_mozalloc0.o -c   -DNDEBUG=1 -DTRIMMED=1 -D_GNU_SOURCE -DIMPL_MFBT -DMOZ_HAS_MOZGLUE -I/o
pt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/
memory/mozalloc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/work
/mozjs-52.6.0gnome1/js/src/obj/memory/mozalloc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_
ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj/xpcom -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.
org_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/memory/build -I/opt/local/var/macports/build/_opt_local_var_macports_source
s_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj/dist/include  -I/opt/local/include/nspr
-fPIC  -DMOZILLA_CLIENT -include /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs
52/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj/js/src/js-confdefs.h -MD -MP -MF .deps/Unified_cpp_memory_mozalloc0.o.pp -I/opt/local/include -Wall -
Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-string
s -Wno-invalid-offsetof -Wc++14-compat -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -fno-lifetime-dse
-pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32 -fno-common -stdlib=libc++ -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe  -g -O3 -fno-stack-pr
otector -fomit-frame-pointer    /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs5
2/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj/memory/mozalloc/Unified_cpp_memory_mozalloc0.cpp
g++-mp-6: error: unrecognized command line option '-stdlib=libc++'
g++-mp-6: error: unrecognized command line option '-stdlib=libc++'
make[3]: *** [Unified_cpp_memory_mozalloc0.o] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mo
zjs52/work/mozjs-52.6.0gnome1/js/src/obj/memory/mozalloc'
make[3]: *** [StackWalk.o] Error 1
make[2]: *** [memory/mozalloc/target] Error 2
make[2]: make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_m
ozjs52/mozjs52/work/mozjs-52.6.0gnome1/js/src/obj/mozglue/misc'
*** Waiting for unfinished jobs....
make[2]: *** [mozglue/misc/target] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mo
zjs52/work/mozjs-52.6.0gnome1/js/src/obj'
make[1]: *** [compile] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mo
zjs52/work/mozjs-52.6.0gnome1/js/src/obj'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs
52/work/mozjs-52.6.0gnome1/js/src/obj'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/w
ork/mozjs-52.6.0gnome1/js/src/obj" && /usr/bin/make -j2 -w all
Exit code: 2
Error: Failed to build mozjs52: command execution failed
DEBUG: Error code: CHILDSTATUS 99258 2
DEBUG: Backtrace: command execution failed
DEBUG:     while executing
DEBUG: "system {*}$notty {*}$nice $fullcmdstring"
DEBUG:     invoked from within
DEBUG: "command_exec build"
DEBUG:     (procedure "portbuild::build_main" line 8)
DEBUG:     invoked from within
DEBUG: "$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/main.log for
 details.

comment:22 Changed 5 years ago by kencu (Ken)

I have some progress to report on getting this to build on Tiger PPC, but it's not yet working to build through to the end (and nothing is actually tested yet, of course). But if you're motivated and have some skills and interest, this will probably be helpful. I'll upload my WIP to date. The error at the moment comes because code to handle PPC on Darwin is not written for

js/src/wasm/WasmSignalHandlers.cpp

and will need to be added.

Error:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_mozjs52/mozjs52/work/mozjs-52.6.0gnome1/js/src/wasm/WasmSignalHandlers.cpp:379:4: error: #error Unsupported architecture
:info:build  #  error Unsupported architecture

Changed 5 years ago by kencu (Ken)

Attachment: patch-mozjs52-portfile.diff added

Changed 5 years ago by kencu (Ken)

Changed 5 years ago by kencu (Ken)

comment:23 in reply to:  22 Changed 5 years ago by ballapete (Peter "Pete" Dyballa)

I do not have that much time right now.

comment:24 Changed 5 years ago by ballapete (Peter "Pete" Dyballa)

The memalign problem seems to be well known, because a few patch files for this problem exist: /opt/mports/trunk/dports/devel/jemalloc/files/patch-memalign.diff /opt/mports/trunk/dports/math/fftw-3/files/leopard-no-memalign.patch /opt/mports/trunk/dports/net/libtorrent/files/no_posix_memalign.patch /opt/mports/trunk/dports/net/libtorrent-devel/files/no_posix_memalign.patch. Maybe they contain something useful. (I do not understand the problem.)

comment:25 Changed 5 years ago by dbevans (David B. Evans)

Owner: dbevans deleted

Will leave this to the various powerpc devotees to work out. Seems like @kencu has isolated the problem at least. But I'm afraid a solution is not likely to be forthcoming in the near future unless someone with access to the target hardware is able to put some time into this.

comment:26 Changed 5 years ago by dbevans (David B. Evans)

By the way, newer GNOME ports that use this port are indeed moving to mozjs60. Updating dependents of mozjs52 may be the best solution.

comment:27 in reply to:  25 Changed 5 years ago by ballapete (Peter "Pete" Dyballa)

Replying to dbevans:

Times has come! (Who said this?) The weather motivates to stay at home instead of exploring the world of creeks for Wikipedia. And my harvest (apple®s and walnaut®s) is almost brought in. So I can perform a lot of tests. On PPC hardware (7447A) in Leopard (Mac OS X 10.5.8) and Tiger (Mac OS X 10.4.11).

comment:28 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: stevenptimms added

Has duplicate #61360.

comment:29 in reply to:  18 Changed 4 years ago by stevenptimms

Replying to kencu:

Yeah -- for now you will need to roll back to the last version before the update to 0.115, because it appears 0.115 needs mozjs52.

And you'll need to peg at that version, maybe forever, on PPC.

Could someone please tell me the command required for me to peg this older version? Thank you

comment:30 Changed 4 years ago by kencu (Ken)

to "peg" a port in MacPorts is easy but not encouraged, so there is not one command like "peg" to do it.

The method is to create a folder that is structured like the ports tree folder, add ports in there you want modified from the main macports offerings, and then configure MacPorts to check your folder first when looking for ports. It takes less than two minutes to do this. The full instructions are here <https://guide.macports.org/chunked/development.local-repositories.html>.

I have been doing this for years. Mine is here <https://github.com/kencu/LeopardPorts/> for an example of what I'm using. You can use that as an idea. Specifically for policykit, my peg is here <https://github.com/kencu/LeopardPorts/tree/master/security/policykit>.

MPorts is much more supportive of older systems than other pkg managers for Mac...a few of us like doing this.

You'll be able to get your system running many many ports (I have thousands installed), but not every port is practical to fix.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:31 Changed 4 years ago by kencu (Ken)

I have a WIP for building mozjs52 on 10.5 PPC going here <https://github.com/kencu/macports-ports/tree/mozjs52PPC/lang/mozjs52>.

At present, it builds through to finishing the build for the mozjs52 dylib, but there are link errors due to multiply defined symbols in the JIT code.

I think the next step is to either sort out how to disable ION / JIT (the --disable-ion command is not seeming to do it...), or better to merge in some of the mozjs fixes for osxppc from TenFourFox and actually try to get that enabled.

The patch file might also be useful for getting mozjs52 building on Intel systems < 10.6 -- I haven't tried doing that as yet.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:32 Changed 4 years ago by khepler

Cc: khepler added

comment:33 Changed 3 years ago by evanmiller (Evan Miller)

Hi all, I have been working to get mozjs60 to build on a G3 running 10.4.11. Here is what I have so far, building off of the collected efforts in this ticket: https://github.com/evanmiller/macports-ports/commit/47ba685438f323287f6adbb1e623d0e575d02b03

Builds on my machine (finally) but may need some updates to work on PPC64 and 10.5. It compiles and installs, but the js60 command doesn't print anything for some reason. In addition, because I removed some static_asserts it would not surprise me if there are some crashes somewhere. The js60-config command works at least. Thought I'd collect some feedback here before opening a pull request.

comment:34 Changed 3 years ago by kencu (Ken)

well done!

the next step would be to take a stab at running the test suite, and see what comes from that. Would be good to run it first on a working Intel system to see what to expect.

I run the js test suite on TenFourFox like this, for a starting point perhaps:

run the tests in js/src/jit-test
./jit_test.py -f ../../../obj-ff-dbg/dist/bin/js

comment:35 Changed 3 years ago by kencu (Ken)

from the top level of the mozjs60 build tree, I ran this on 10.6.8 (Intel) and it seems to be testing as expected:

sudo chmod -R a+rw ./*
/opt/local/bin/python2.7 js/src/tests/jstests.py js/src/obj/js/src/js

This may not be 100% the perfect way to run the mozjs test suite, as I just googled around until i found something that looked workable, but it's running on my system at the moment at least.

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:36 Changed 3 years ago by kencu (Ken)

Here is the final bit of output of the test suite on 10.6.8 running 64 bit mozjs60:

[30600|    2|    0| 1715] 100% ======================================>| 817.6s
REGRESSIONS
    non262/Date/15.9.5.7.js
    non262/Date/time-zone-2038-pst.js
FAIL

If I read this right, there are two unexpected failures out of 30,600 tests. That is pretty good. The details on the two unexpected failures are available here, and appear to have something to do with PST time vs PDT time. I can live with that.

comment:37 Changed 3 years ago by kencu (Ken)

Looks like testing the Jit might be done like this:

$ /opt/local/bin/python2.7 js/src/jit-test/jit_test.py js/src/obj/js/src/js
[6262|   0|   0|   0] 100% ==========================================>| 204.6s
PASSED ALL

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:38 Changed 3 years ago by evanmiller (Evan Miller)

The main test suite doesn't complete on Tiger/PPC:

$ /opt/local/bin/python2.7 js/src/tests/jstests.py js/src/obj/js/src/js
Traceback (most recent call last):
  File "js/src/tests/jstests.py", line 393, in <module>
    sys.exit(main())
  File "js/src/tests/jstests.py", line 382, in main
    for out in run_all_tests(test_gen, prefix, results.pb, options):
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/tests/lib/tasks_unix.py", line 200, in run_all_tests
    tests = list(tests)
  File "js/src/tests/jstests.py", line 338, in <genexpr>
    test_gen = (test for test in test_gen for i in range(options.repeat))
  File "js/src/tests/jstests.py", line 335, in <genexpr>
    test_gen = (_ for _ in test_gen if not _.slow)
  File "js/src/tests/jstests.py", line 328, in <genexpr>
    test_gen = (_ for _ in test_gen if not _.random)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/tests/lib/manifest.py", line 443, in load_reftests
    _parse_test_header(fullpath, testcase, xul_tester)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/tests/lib/manifest.py", line 304, in _parse_test_header
    _parse_one(testcase, matches.group(2), xul_tester)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/tests/lib/manifest.py", line 144, in _parse_one
    if xul_tester.test(cond):
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/tests/lib/manifest.py", line 111, in test
    cond, out, err))
Exception: Failed to test XUL condition 'Android'; output was '', stderr was ''

The JIT tests run, but all appear to fail:

$ /opt/local/bin/python2.7 js/src/jit-test/jit_test.py js/src/obj/js/src/js
Exit code: 1
FAIL - backup-point-bug1315634.js
[   0|   1|   0|   0]   0% >                                           |   0.3s
Exit code: 1
FAIL - bug1213574.js
[   0|   2|   0|   0]   0% >                                           |   0.4s
Exit code: 1
FAIL - bug1323854-2.js
[   0|   3|   0|   0]   0% >                                           |   0.8s
Exit code: 1
FAIL - bug1366925.js
[   0|   4|   0|   0]   0% >                                           |   0.9s
Exit code: 1
FAIL - bug765479.js
[   0|   5|   0|   0]   0% >                                           |   1.1s
Exit code: 1
FAIL - bug793385.js
[   0|   6|   0|   0]   0% >                                           |   1.7s
Exit code: 1
FAIL - bug825379.js
[   0|   7|   0|   0]   0% >                                           |   1.7s

....

I haven't debugged at all.

comment:39 Changed 3 years ago by kencu (Ken)

Well, we are definitely further ahead than once we were.

XUL test condition 'Android' would seem to point to some confusion in platform selection.

In my repos I have pegged back to mozjs17 and software that needed that:

https://github.com/kencu/TigerPorts/tree/master/lang/mozjs17

and I haven't noticed any issues, but TBH I have not even tried to run the test suite there.

We certainly don't need a 100% pass on anything, but we would need to have some indication that it works at all before we commit it.

comment:40 Changed 3 years ago by evanmiller (Evan Miller)

Cc: evanmiller added

comment:41 Changed 3 years ago by kencu (Ken)

mozjs17 does quite well on Tiger Intel:

$ python2.7 js/src/tests/jstests.py js/src/shell/js17

[3000|   4|   3| 161] 100% ==========================================>| 551.0s
REGRESSIONS
    js1_8_5/extensions/typedarray.js
TIMEOUTS
    js1_8_1/regress/regress-452498-052-a.js
    js1_8_1/regress/regress-452498-099-a.js
    js1_8_1/regress/regress-452498-135-a.js
FAIL
$ python2.7 js/src/jit-test/jit_test.py  js/src/shell/js17
[4876|   0|   0|4876]    100% =======================================>|  262.8s
PASSED ALL
Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:42 Changed 3 years ago by evanmiller (Evan Miller)

Quick update here after some fooling around this afternoon. I found a "magic" compiler flag that let me restore the static_asserts in the code base that I had commented out earlier: -mone-byte-bool. The bool type is a 4-byte integer by default on Tiger/PPC, but a 1-byte char on Intel. This results in different layout and sizes when bools are packed into structs. But passing -mone-byte-bool to GCC on PPC results in an Intel-compatible bool size, and should fix some instances of highly optimized code. (Of course, as the docs note, it could also break ABI compatibility with external libraries that expose bools.)

Unfortunately the js60 shell still isn't starting for me on Tiger, so nothing else to report for now.

comment:43 Changed 3 years ago by kencu (Ken)

there exists a type called "Boolean" in mactypes that might possibly be useful.

Boolean         Mac OS historic type, sizeof(Boolean)==1

there are also pragmas available that affect struct packing that are often used in code that interacts with system libraries might prove relevant

be great if this worked! was there something in mozjs17 (builds and works on ppc) that was removed later?

also the TenFourFox code had a lot of tweaks done for mozjs by Cameron and there could be pearls in there.

comment:44 Changed 3 years ago by evanmiller (Evan Miller)

Some progress to report - I tracked down the Tiger issues to ICU failing to initialize (u_init() failing) on that platform. I didn't dig any further into it, but configuring --without-intl-api solved it, and I finally get a usable shell on Tiger/PPC:

$ js60
js> 1+1
2

Basic tests are looking good, but the full suite may take a while to run. Will open a PR later this morning if everything looks OK.

Bigger picture: It looks like the only MP consumers of mozjs are gjs (mozjs52) and policykit (mozjs60). It looks like their latest versions both require mozjs78. So rather than backport this work to mozjs52, the time is likely better spent forward-porting to mozjs78 and then updating the relevant packages.

comment:45 Changed 3 years ago by evanmiller (Evan Miller)

Pull request over here... Leopard testers needed! https://github.com/macports/macports-ports/pull/12186

comment:46 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

I tried to build mozjs60 on PPC Leopard by adding a line

onfigure.cflags-append -mone-byte-bool

in Portfile. Building fails because the processor type seems to be unknown:

checking whether cross compiling... no
checking for the target C compiler... /opt/local/bin/gcc-mp-7
checking whether the target C compiler can be used... no
DEBUG: <truncated - see config.log for full output>
DEBUG: | #elif __linux__
DEBUG: | %KERNEL "Linux"
DEBUG: | #elif _WIN32 || __CYGWIN__
DEBUG: | %KERNEL "WINNT"
DEBUG: | #elif __NetBSD__
DEBUG: | %KERNEL "NetBSD"
DEBUG: | #elif __APPLE__
DEBUG: | %KERNEL "Darwin"
DEBUG: | #endif
DEBUG: | #if _MSC_VER || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
DEBUG: | %ENDIANNESS "little"
DEBUG: | #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
DEBUG: | %ENDIANNESS "big"
DEBUG: | #endif
DEBUG: Executing: `/opt/local/bin/gcc-mp-7 -std=gnu99 -E /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/.tmp/conftest.BnpqsB.c`
DEBUG: COMPILER = gcc
DEBUG: VERSION = 7.5.0
DEBUG: STDC_VERSION = 199901L
DEBUG: KERNEL = Darwin
DEBUG: ENDIANNESS = big
ERROR: Target C compiler target CPU (unknown) does not match --target CPU (powerpc)

although GCC7 defines:

#define __POWERPC__ 1
#define __PPC 1
#define __PPC__ 1

comment:47 Changed 3 years ago by evanmiller (Evan Miller)

@ballapete Please try the complete Portfile and patch set in the Pull Request linked above.

comment:48 in reply to:  47 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to evanmiller:

@ballapete Please try the complete Portfile and patch set in the Pull Request linked above.

I think I see now that the interface provides a "Files changed" section from which I should copy.

comment:49 in reply to:  47 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to evanmiller: How can I download those patches as files in an appropriate format and with the names that will be used in the new version of Portfile? (I am neither developer nor GitHub user.)

comment:50 Changed 3 years ago by evanmiller (Evan Miller)

You can download the whole tree here:

https://github.com/evanmiller/macports-ports/archive/refs/heads/mozjs60-powerpc.zip

Open up the "lang" folder in the download.

In another Finder window, navigate to /opt/local/var/macports/sources/rsync.macports.org/ports/lang

Copy mozjs60 in the downloaded "lang" folder to the MacPorts "lang" folder, replacing the MacPorts "mozjs60" folder.

Then "sudo port install mozjs60" in the Terminal.

If it installs, run js60 in the Terminal and type an expression (e.g. 1+1)

If it does not install, report any errors here.

Thanks!

comment:51 in reply to:  50 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to evanmiller:

Sorry Evan! Probably I used the wrong words before. Corrected version: I don't know how to use GitHub with TenFourFox and I do not want to download another ½ GB and fool around with it and I do not know how to put the lang folder into a place that MacPorts would recognise – and when! For me it's much easier to get some kB of one or more patch files, programme or patch Portfile accordingly, and then run port -vds build mozjs60 once more.

How can I get the set of patch files in text format on PPC Leopard? If there is a way to press the right buttons of GitHub, and you could tell it, then I could try to fetch them myself. (I am European. And I think small is much bigger than Texas. And it's democratic here: exactly every person one vote.)

comment:52 Changed 3 years ago by evanmiller (Evan Miller)

Ok, here is a downloadable patch file:

https://github.com/evanmiller/macports-ports/commit/c2135be703a92eec7edd1176f3b7a63c7ec85722.diff

Then:

sudo port sync # To ensure a fresh Portfile
cd /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports
sudo -u macports patch -p1 < ~/Desktop/c2135be703a92eec7edd1176f3b7a63c7ec85722.diff
sudo port build mozjs60

comment:53 Changed 3 years ago by kencu (Ken)

looking good! The test suite does surprisingly well on a TigerG5, I thought. Only two failures in the regular tests out of 30,232 tests, and 2 failures in the jit out of 6,260 tests. So that is beyond hope, really.

Really well done, thanks.

$ /opt/local/bin/python2.7 js/src/tests/jstests.py js/src/obj/js/src/js
[  296|    0|    0|    7]   0% >                                       |  77.4s
## non262/Date/time-zones.js: rc = 3, run time = 0.563829
non262/Date/time-zones.js:216:5 Error: Assertion failed: got 0, expected 1
Stack:
  @non262/Date/time-zones.js:216:5
  inTimeZone@non262/Date/time-zones.js:21:9
  @non262/Date/time-zones.js:213:1
REGRESSION - non262/Date/time-zones.js
[15400|    1|    0|  977]  50% ==================>                    |1442.4s
## test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js: rc = 3, run time = 0.139753
uncaught exception: Test262Error: 51539607552,42,0,4,5,6,7,8 (Testing with Float64Array.)
REGRESSION - test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
[30232|    2|    0| 2083] 100% ======================================>|2808.5s
REGRESSIONS
    non262/Date/time-zones.js
    test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
FAIL


$ /opt/local/bin/python2.7 js/src/jit-test/jit_test.py js/src/obj/js/src/js
[2479|   0|   0|   0]  39% ================>                          | 268.6s
Cannot find `FNDA:1,top-level` in the following Lcov result:
 TN:Compartment_5f127f7c00
SF:/opt/local/var/macports/build/_opt_TigerPorts_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/jit-test/tests/coverage/simple.js line 60 > eval
FN:1,top-level
FNDA:%qu,top-level
FNF:1
FNH:1
BRF:0
BRH:0
DA:2,%qu
LF:1
LH:1
end_of_record

In the following source:
  //FN:$,top-level //FNDA:1,%
  ",".split(','); //DA:$,1
  //FNF:1
  //FNH:1
  //LF:1
  //LH:1

/opt/local/var/macports/build/_opt_TigerPorts_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/jit-test/tests/coverage/simple.js:69:7 Error: Assertion failed: got true, expected false
Stack:
  checkLcov@/opt/local/var/macports/build/_opt_TigerPorts_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/jit-test/tests/coverage/simple.js:69:7
  @/opt/local/var/macports/build/_opt_TigerPorts_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/jit-test/tests/coverage/simple.js:74:1
Exit code: 3
FAIL - coverage/simple.js
[5514|   1|   0|   0]  88% ====================================>      | 563.0s
Hit MOZ_CRASH(Cannot test assertRecoveredOnBailout) at /opt/local/var/macports/build/_opt_TigerPorts_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/shell/js.cpp:3034
Exit code: -10
FAIL - self-test/assertRecoveredOnBailout-1.js
[6260|   2|   0|   0] 100% ==========================================>| 633.3s
FAILURES:
    --code-coverage coverage/simple.js
    self-test/assertRecoveredOnBailout-1.js
TIMEOUTS:

comment:54 Changed 3 years ago by kencu (Ken)

the test result on LeopardPPC also look very good:

$ /opt/local/bin/python2.7 js/src/tests/jstests.py js/src/obj/js/src/js
[15401|    0|    0|  977]  50% ==================>                    |1597.7s
## test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js: rc = 3, run time = 0.157516
uncaught exception: Test262Error: 51539607552,42,0,4,5,6,7,8 (Testing with Float64Array.)
REGRESSION - test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
[30233|    1|    0| 2083] 100% ======================================>|3016.0s
REGRESSIONS
    test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
FAIL

$ /opt/local/bin/python2.7 js/src/jit-test/jit_test.py js/src/obj/js/src/js
[5524|   0|   0|   0]  88% ====================================>      | 584.9s
Hit MOZ_CRASH(Cannot test assertRecoveredOnBailout) at /opt/local/var/macports/build/_opt_TigerPorts_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/shell/js.cpp:3034
Exit code: -10
FAIL - self-test/assertRecoveredOnBailout-1.js
[6261|   1|   0|   0] 100% ==========================================>| 650.8s
FAILURES:
    self-test/assertRecoveredOnBailout-1.js
TIMEOUTS:

comment:55 in reply to:  52 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to evanmiller: cd `port file mozjs60`/../../.. would make the change of working directory indepent of the RSYNC server. The configure phase is over and the build started. How many days will it take to compile ½ GB of source code? (PowerBook G4 with 1.5 GHz PowerPC 7447A)

comment:56 Changed 3 years ago by evanmiller (Evan Miller)

comment:57 Changed 3 years ago by evanmiller (Evan Miller)

On my G3 it took... 8 hours, I think? So maybe half that on G4?

It sounds like the diff I provided will fail on Leopard so you may want to restart with an updated one:

https://github.com/macports/macports-ports/commit/50cdf084768436a421e2c6d05e995d122bc93bca.diff

Or do a port sync tonight/tomorrow - looks like @kencu has just merged the final version to master and has closed this ticket.

comment:58 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

I'll let it build silently at reduced CPU speed over night and shall see tomorrow morning, in nine hours, whether I could make -k check in /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/obj. I presume that's the proper place…

comment:59 Changed 3 years ago by kencu (Ken)

That is not how you run the tests for this, Pete. You do it as I outlined above.

But you don't have to do it -- I did them all on PPC over the last 24 hours, and posted the results above.

We could add an official "test" phase to this port-- but that's for next round.

comment:60 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Here the assembler failed:

:info:build /opt/local/bin/gcc-mp-7 -std=gnu99 -o icudata_gas.o -DNDEBUG=1 -DTRIMMED=1 -fPIC -g -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/config/external/icu/data -DPREFIX '-DICU_DATA_FILE="icudt60l.dat"' -DICU_DATA_SYMBOL=icudt60_dat  -c /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/config/external/icu/data/icudata_gas.S
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/config/external/icu/data/icudata_gas.S:8:Unknown pseudo-op: .global
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/config/external/icu/data/icudata_gas.S:8:Rest of line ignored. 1st junk character valued 105 (i).
:info:build make[3]: *** [icudata_gas.o] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/obj/config/external/icu/data'
:info:build make[2]: *** [config/external/icu/data/target] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs60/mozjs60/work/mozjs-60.8.0/js/src/obj'

(And the X server did not receive any input.)

comment:61 Changed 3 years ago by evanmiller (Evan Miller)

As I state in comment 57 the first patch that I provided will fail on Leopard. Just do port sync and port install mozjs60 and you should be good to go.

comment:62 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

After a selfupdate the port built regularly, tests ran quite fine:

root 240 /\ nice python2.7 js/src/tests/jstests.py js/src/obj/js/src/js
[15080|    0|    0|  975]  49% ==================>                    |9413.8s
## test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js: rc = 3, run time = 0.704174
uncaught exception: Test262Error: 51539607552,42,0,4,5,6,7,8 (Testing with Float64Array.)
REGRESSION - test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
[30233|    1|    0| 2083] 100% ======================================>|20410.8s
REGRESSIONS
    test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
FAIL

comment:63 Changed 3 years ago by evanmiller (Evan Miller)

@ballapete Thanks for the update. What port were you originally trying to install? When #12192 is merged, there should no longer be a need for mozjs52.

comment:64 in reply to:  63 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to evanmiller:

It was policykit.

comment:65 Changed 3 years ago by evanmiller (Evan Miller)

@ballapete Are you all set then? Current policykit should be using mozjs60.

comment:66 in reply to:  65 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to evanmiller:

Yes, thank you!

comment:67 Changed 3 years ago by evanmiller (Evan Miller)

Before anyone gets too excited for mozjs68 / mozjs78: It looks like everything after mozjs60 requires a Rust compiler, and we don’t have Rust on PPC. So this is the end of the line for now.

mozjs52 is no longer used by any other ports, so this ticket can be closed.

comment:68 Changed 3 years ago by evanmiller (Evan Miller)

Owner: set to evanmiller
Resolution: fixed
Status: assignedclosed

In 975c541d22092372bd35d6b30084fa6a27af0558/macports-ports (master):

mozjs52: deprecate

Closes: #57032

Note: See TracTickets for help on using tickets.