[MacPorts] #45832: defect: policykit 0.112_1 cannot be built on PPC Tiger and Leopard because it needs Clang 3.4 which cannot be built
MacPorts
noreply at macports.org
Thu Nov 27 09:42:15 PST 2014
#45832: defect: policykit 0.112_1 cannot be built on PPC Tiger and Leopard because
it needs Clang 3.4 which cannot be built
------------------------------+----------------------
Reporter: Peter_Dyballa@… | Owner: devans@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.3.2
Resolution: | Keywords:
Port: policykit |
------------------------------+----------------------
Comment (by Peter_Dyballa@…):
Replying to [comment:2 braumann@…]:
>
> For {{{mozjs17}}} I have tried both of them but always get this
"architecture was not detected as supported" error (also see my build
log):
>
> {{{
> ...
> :info:build
/Volumes/Data/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_mozjs17/mozjs17/work/mozjs17.0.0/mfbt
/double-conversion/utils.h:71:2: error: #error Target architecture was not
detected as supported by Double-Conversion.
> ...
> }}}
>
> Looking into {{{utils.h}}} one can see that the architecture check
obviously has failed, i.e. {{{__powerpc__}}} has not been defined. So my
first guess is that this symbols needs to be defined before in order to
let {{{gcc-4.2}}} do the compilation of {{{mozjs17}}}. Hope this can be
achieved via an official portfile modification, since I am sure it is not
difficult to work around this issue.
Could be {{{utils.h}}} is a bit incorrect…
Apple's GCC 4.2 defines
{{{
#define __ppc__ 1
#define __POWERPC__ 1
}}}
The file could be patched. I did try that last night but change Portfile a
bit:
{{{
37 autoconf.cmd autoconf213
38 #compiler.blacklist *gcc-*
39 configure.args --with-system-nspr \
40 --enable-system-ffi \
41 --disable-readline \
42 --enable-threadsafe \
43 --enable-macos-target=10.5 \
44 --with-arch=G4
45
46 configure.ccache no
}}}
but had no success. The configure option {{{--with-arch=…}}} leads to
setting a compiler switch {{{-march=…}}} which GCC 4.2 does not accept.
Changing configure to output {{{-mcpu=…}}} was successful. I finally left
port out but used its environment to run this command from {{{
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs17/mozjs17/work/mozjs17.0.0/js/src}}}:
{{{
env PATH=/opt/local/bin:$PATH CC='/usr/bin/gcc-4.2' CC_PRINT_OPTIONS='YES'
CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_mozjs17/mozjs17/work/.CC_PRINT_OPTIONS'
CFLAGS='-pipe -Os -arch ppc' CPATH='/opt/local/include'
CPPFLAGS='-I/opt/local/include -D__powerpc__' CXX='/usr/bin/g++-4.2'
CXXFLAGS='-pipe -Os -arch ppc' F77FLAGS='-m32' F90FLAGS='-pipe -Os -m32'
FCFLAGS='-pipe -Os -m32' FFLAGS='-pipe -Os' INSTALL='/usr/bin/install -c'
LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc'
LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.5'
OBJC='/usr/bin/gcc-4.2' OBJCFLAGS='-pipe -Os -arch ppc'
OBJCXX='/usr/bin/g++-4.2' OBJCXXFLAGS='-pipe -Os -arch ppc' ./configure
--prefix=/opt/local --with-system-nspr --enable-system-ffi --disable-
readline --enable-threadsafe --enable-macos-target=10.5 --with-arch=G4
}}}
Notice the {{{CPPFLAGS='-I/opt/local/include -D__powerpc__'}}}! This lead
a successful compilation of mozjs17, I also could invoke {{{make check}}}.
I could not wait until this step finished because the bed was calling for
me…
So I think that it is possible to compile mozjs17 for PPC Mac OS X
10.5.8/Leopard.
P.S.: With GCC it's possible to get the {{{#define}}}s with {{{cpp -dD <
/dev/null}}} for example. This does not seem to work with Clang, it seems
to need an empty C file, but then it emits:
{{{
#define __ppc__ 1
#define _ARCH_PPC 1
#define __powerpc__ 1
#define __POWERPC__ 1
#define __ppc__ 1
}}}
{{{llvm-gcc}}} gives
{{{
#define _ARCH_PPC 1
#define _ARCH_PPCGR 1
#define __ppc__ 1
#define __POWERPC__ 1
}}}
so it's as unusable as {{{GCC}}}. Tonight I'm going to test with port's
Clang {{{mp-clang-3.3}}}.
--
Ticket URL: <https://trac.macports.org/ticket/45832#comment:4>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list