Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#31603 closed defect (fixed)

apple-gcc42 fails to install: i686-apple-darwin11-gcc: command not found

Reported by: jsduncan2@… Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: apple-gcc42

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I am trying to install wine and have been unable to install apple-gcc42. I am new to MacPorts so I'm sure I'm just doing something wrong. I'm running xcode 4.2 so I had to go through the procedure of patching, described in Ticket #31584.

  Model Name:	iMac
  Model Identifier:	iMac12,1
  Processor Name:	Intel Core i7
  Processor Speed:	2.8 GHz
  Number of Processors:	1
  Total Number of Cores:	4
  L2 Cache (per Core):	256 KB
  L3 Cache:	8 MB
  Memory:	8 GB
  Boot ROM Version:	IM121.0047.B0A
  SMC Version (system):	1.71f22

Attachments (1)

main.log (357.5 KB) - added by jsduncan2@… 13 years ago.
Log file

Download all attachments as: .zip

Change History (14)

Changed 13 years ago by jsduncan2@…

Attachment: main.log added

Log file

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jeremyhu@… removed
Description: modified (diff)
Owner: changed from macports-tickets@… to jeremyhu@…
Summary: apple-gcc42 fails to installapple-gcc42 fails to install: i686-apple-darwin11-gcc: command not found

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Resolution: fixed
Status: newclosed

The problem was this block in the portfile:

if {[variant_isset universal]} {
	build.args-append \
		RC_ARCHS="${universal_archs}"
} else {
	build.args-append \
		RC_ARCHS="${build_arch}"
}

The code in the if section above will execute if the user requests the universal variant (on the command line or in variants.conf) even if the port doesn't declare a universal variant. And the log you attached shows you requested the universal variant, and I'm able to reproduce the problem when I request the universal variant.

I properly disabled the universal variant in r85607.

comment:3 Changed 13 years ago by jsduncan2@…

Do I need to do something differently now, or should it just work if I install apple-gcc42? I tried it again and it's still giving me an error.

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

As with any other fix, you'll need to run "sudo port selfupdate" to receive the fix.

comment:5 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

And running "sudo port clean apple-gcc42" before trying again would be a good idea too.

comment:6 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: closedreopened

Jeremy re-enabled the universal variant in r85677, re-breaking this.

comment:7 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I fail to see how adding the universal variant broke this. It builds universal for me on Lion just fine.

comment:8 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Well it doesn't for the reporter of this ticket on Lion, nor for me on Snow Leopard (same error, just with i686-apple-darwin10-gcc).

comment:9 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Has dupe #31657

comment:10 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

It's during this step in build_gcc:

# Build the cross-hosted compilers.
with BUILD=x86_64 h=i686 t=i686
...
make $MAKEFLAGS all CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1

failing in gcc/Makefile.in:

# Dump a specs file to make -B./ read these specs over installed ones.
$(SPECS): xgcc$(exeext)
        $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
        mv tmp-specs $(SPECS)

comment:11 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Ah, the problem is in gcc's configure... we're thinking that we're cross compiling even though we're not "really" cross compiling. The config.log shows us picking "pre-installed":

if test "x${build}" != "x${host}" ; then
  if expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then
    # We already found the complete path
    echo "$ac_t""pre-installed in `dirname $GCC_FOR_TARGET`" 1>&6
  else
    # Canadian cross, just use what we found
    echo "$ac_t""pre-installed" 1>&6
  fi
else
...
  if test $ok = yes; then
    # An in-tree tool is available and we can use it
    GCC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
    echo "$ac_t""just compiled" 1>&6
...

comment:12 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: reopenedclosed

comment:13 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Note that the systems that this was working on in the past probably had /usr/bin/i686-apple-darwin*-gcc present for one reason or another

Note: See TracTickets for help on using tickets.