Question about Xcode 4.2.1 on Lion

Andrea D'Amore and.damore at macports.org
Sun Feb 5 01:40:15 PST 2012


On Sun, Feb 5, 2012 at 07:04, Jeff Singleton <gvibe06 at gmail.com> wrote:
> Basically…I am seeing that clang is being chosen as the default compiler now
> and not gcc.

That's not too much recent, and according to system version
llvm-gcc-4.2 was choosen before clang.

Did you jump straight from 3.2.x to 4.2.1? Did you upgrade to Lion at
the same time?

> This seems to be causing a lot of ports to simply not build at
> all, and is causing severe system failings to occur -- such as, not being
> able to access /var/log for error output logging,

This shouldn't be related to the compiler. Could mean some permission
issue but I doubt it'd be in Xcode, the build process is run by the
user, or in MacPorts' case as user "macports".

> and my Chrome browser begins to fail with the Crash Robot error page.

I'm very dubious about clang being the culprit here too.

> since I can't downgrade to Xcode3 which does work until MacPorts decides to version check and yell at
> me for using an old version that isn't supported on Lion.

IIRC you can, but you shouldn't.
While clang has issues with few ports those are generally just patched
for either working with clang or falling back to an older compiler.


> I will use the git-core port as my example…see below for the errors I am
> seeing all over the place as of recently:
[…]
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git-core/git-core/work/git-1.7.9"
> && /usr/bin/make -w install CFLAGS="-Wall -O2 -I/opt/local/include -arch
> x86_64 -arch i386" LDFLAGS="-L/opt/local/lib -arch x86_64 -arch i386"
> CC=/Developer/usr/bin/clang prefix=/opt/local CURLDIR=/opt/local
> OPENSSLDIR=/opt/local ICONVDIR=/opt/local
> PERL_PATH="/opt/local/bin/perl5.12" NO_FINK=1 NO_DARWIN_PORTS=1
> NO_R_TO_GCC_LINKER=1 PYTHON_PATH="/opt/local/bin/python2.7"
> LIBPCREDIR=/opt/local USE_LIBPCRE=1
> DESTDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git-core/git-core/work/destroot
> " returned error 2
> Error: Target org.macports.destroot returned: shell command failed (see log
> for details)

Notice that this isn't a compiler error, it's a make error, clang has
little to do here as well.
If you were getting issues with clang your command would have most
likely failed at build phase, not in destroot/install/activate that
follow.


Again, I confirm that on 10.7 with Xcode 4.2.1 things should just work
and I suggest you to not downgrade any component.

In case of an error check the log issue, as stated in output, or print
the debug output using -d flag to port command. I prefer the latter
for readability, terminal scroll space comes for free nowadays.

-- 
Andrea


More information about the macports-users mailing list