Re: [9fans] Compiling plan9port under Mac OS X 10.6

32 views
Skip to first unread message

Russ Cox

unread,
Sep 3, 2009, 11:05:54 AM9/3/09
to plu...@gmail.com, plan9port-dev
On Thu, Sep 3, 2009 at 2:53 AM, plus 852<plu...@gmail.com> wrote:
> Has anyone had success with compiling plan9port under Mac OS X 10.6
> (Snow Leopard)? I've submitted an issue report at
> http://code.swtch.com/plan9port/issue/27/compiling-under-snow-leopard
> that provides the error messages I received. I then tried adding
> CC9=gcc -m32 to a $PLAN9/LOCAL.config file, but when running ./install
> I ended up with a variety of the following errors:
>
>>>> /Users/--/plan9/config: line 1: -m32: command not found
>
> Does anyone have any suggestions?

Can you send the output of "uname -m" and "uname -p"?
I believe the issue is that the build thinks you are on a
386 but the compiler's default is to generate x86-64 binaries.

Russ

David Leimbach

unread,
Sep 3, 2009, 11:10:28 AM9/3/09
to r...@swtch.com, plu...@gmail.com, plan9port-dev
64bit binaries run fine on the 32bit kernel... however.

GHC has the same issue.  It was generating invalid 64bit code at some point (or had included invalid 64bit code somewhere trying to be compiled).  You can run 64bit code on a 32bit kernel on Snow Leopard, and for many, that's the default (you can hack up EFI to make it not so, as I did and run the 64bit kernel, but I haven't noticed a huge difference in day to day performance).

At any rate, the GHC folks are recommending that we stick -m32's everywhere in our wrapper scripts for GHC, and that's "solved the problem for now", while other folks are working on the .

I have not installed snow leopard on my remaining Intel mac which really is only 32bit capable.  I suspect Mac OS X tunes the defaults for GCC at install time to yield the correct output.

Dave
 

Russ

Russ Cox

unread,
Sep 3, 2009, 11:36:19 AM9/3/09
to David Leimbach, plu...@gmail.com, plan9port-dev
>> Can you send the output of "uname -m" and "uname -p"?
>> I believe the issue is that the build thinks you are on a
>> 386 but the compiler's default is to generate x86-64 binaries.
>
> 64bit binaries run fine on the 32bit kernel... however.

(presumably only on a 64-bit machine).

Assuming we can coax the Mac to tell us what its
architecture really is (maybe run gcc to find out)
I bet things will just work. The problem is not 64-bit
per se, but rather that the install looks around and
decides it is on a 32-bit machine and then tries to
use 32-bit assembly files.

Russ

plus 852

unread,
Sep 3, 2009, 7:34:52 PM9/3/09
to plan9port-dev
"uname -m" and "uname -p" both return "i386".

On Sep 3, 10:05 am, Russ Cox <r...@swtch.com> wrote:

David Leimbach

unread,
Sep 3, 2009, 10:50:21 PM9/3/09
to plu...@gmail.com, plan9port-dev
If you run "activity monitor" how many 64bit binaries do you see running?

plus 852

unread,
Sep 4, 2009, 6:28:21 PM9/4/09
to plan9port-dev
The significant majority of the processes are 64bit.

Russ Cox

unread,
Sep 11, 2009, 2:39:40 PM9/11/09
to plan9port-dev
Fixed: http://bitbucket.org/rsc/plan9port/changeset/fe02b669f7d1/

The fix is to force 32-bit compilation in all the tools.
My understanding is that even if we tried to build
64-bit binaries on Snow Leopard, the Carbon graphics
code would not be supported.

Russ

Reply all
Reply to author
Forward
0 new messages