Closed Bug 1489839 Opened 6 years ago Closed 6 years ago

mozjs52 cannot be built on PowerPC Mac OS X 10.4.11 (Tiger) and 10.5.8 (Leopard) because of faulty comparison in configure

Categories

(Firefox Build System :: General, defect)

52 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: Peter_Dyballa, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; PPC Mac OS X 10.5; FPR9; rv:45.0) Gecko/20100101 Firefox/45.0 TenFourFox/7450
Build ID: 20180830234842

Steps to reproduce:

Running wihin MacPorts configure à la: 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


Actual results:

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
Ignoring --enable-threadsafe : Unknown option
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/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.Fx9w9x.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



Expected results:

Success. With the correct strings to compare with. Comparison happens with lower case strings __powerpc64__,  __powerpc__, ppc64, and ppc while GCC 6 has these strings #defined (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

So comparison should happen with ppc || __ppc__ || __powerpc__.

See also: https://trac.macports.org/ticket/57032
Component: Untriaged → General
Product: Firefox → Firefox Build System
Are you trying to build FF 45.0?  This is not an active development stream.
Flags: needinfo?(Peter_Dyballa)
(In reply to Kim Moir [:kmoir] ET from comment #1)
> Are you trying to build FF 45.0?  This is not an active development stream.

No. It's a package in MacPorts system (https://www.macports.org/). It is needed by policykit:

	Description:          PolicyKit is an application-level toolkit for defining and handling the policy
	                      that allows unprivileged processes to speak to privileged processes
	Homepage:             https://www.freedesktop.org/wiki/Software/polkit/
	
	Build Dependencies:   pkgconfig, intltool, gtk-doc, autoconf, automake, libtool
	Library Dependencies: glib2, mozjs52, gobject-introspection


--

Pete
Flags: needinfo?(Peter_Dyballa)
The 52 branch isn't maintained anymore.
You should ask the MacPorts maintainer to add a patch to handle this case.
(but they should move to 60 for mozjs)
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Version: 45 Branch → 52 Branch
And in general, we don't maintain for old version of Mac (we support from macOS 10.9).

Please reopen, because the mozjs 60 branch that you recommended we use above has the same problem.

There are many different #defines that different compilers use to identify PowerPC systems. Not all of them use the __powerpc__ define you're checking for. GCC 6 on Mac OS X seems to be one of those that doesn't know that constant, but other OS/compiler combinations might be affected too.

Compare with the popular Boost library, which uses this list of defines to detect PowerPC systems. In python/mozbuild/mozbuild/configure/constants.py, CPU_preprocessor_checks already checks multiple defines to identify x86, x86_64 and ARM systems; something similar could be done for PowerPC systems. Though I do see several other places in the source code that check for __powerpc__ that might need to be investigated as well.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: